2つの行列の和のような簡単な計算をGPUで行っても高速化できないのはなぜですか?
Afficher commentaires plus anciens
大きなサイズの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
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur GPU 計算 dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!