why GPUarray is slower than CPU?
显示 更早的评论
Hi. GPU vs CPU speed check. why GPUarray is slower than CPU? GPU : GTX 1080, CPU i7-8700K
% ----------------CPU ---------------
for m=1:100
for n=1:100
aa = rand(m,n);
bb= rand(m,n);
cc = corr2(aa,bb);
end
end
fprintf('\n CPU Run time [%2f]', toc);
% ----------------GPU ---------------
for m=1:100
for n=1:100
aaa= rand(m,n,'gpuArray');
bbb= rand(m,n,'gpuArray');
ccc = corr2(aaa,bbb);
end
end
fprintf('\n GPU Run time [%2f]', toc);
Result : CPU Run time [0.320389], GPU Run time [9.299645]
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 GPU 연산 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!