Why does GPU processing not offer significant speed-up over CPU processing for simple processes like addition of two matrices?
显示 更早的评论
I measured the time required to create two large matrices using RANDN and then to add them. There was no significant difference between the times taken by the CPU and the GPU.
The code to measure the CPU processing time is:
size = 10000;
tic
x = rand(size);
y = rand(size);
z = x + y;
toc
The code to measure the GPU processing time is:
size = 10000;
tic
xm = gpuArray(rand(size));
ym = gpuArray(rand(size));
zm = xm + ym;
toc
The attached excel sheet tabulates the speed-up for different sizes of the matrices.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 GPU Computing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!