Why does GPU processing not offer significant speed-up over CPU processing for simple processes like addition of two matrices?
Ältere Kommentare anzeigen
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.
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu GPU Computing finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!