2つの行列の和のような簡単な計算をGPUで行っても高速化できないのはなぜですか?
Show older comments
大きなサイズの2つの行列をRANDNで作成し、それらの和を求める計算の所要時間を計測しましたが、CPUで計算した場合とGPUで計算した場合で大きな違いはありませんでした。
CPUでの計算のためのプログラムは以下の通りです。
size = 10000;
tic
x = rand(size);
y = rand(size);
z = x + y;
toc
一方、GPUでの計算のためのプログラムは以下の通りです。
size = 10000;
tic
xm = gpuArray(rand(size));
ym = gpuArray(rand(size));
zm = xm + ym;
toc
Accepted Answer
More Answers (0)
Categories
Find more on GPU 計算 in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!