Why does GPU processing not offer significant speed-up over CPU processing for simple processes like addition of two matrices?
Mostrar comentarios más antiguos
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.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre GPU Computing en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!