フィルターのクリア

GPU multiplication 2 matrix different size

1 回表示 (過去 30 日間)
Tiki Tiki
Tiki Tiki 2018 年 7 月 20 日
回答済み: Matt J 2018 年 7 月 20 日
Hi everyone
Can you help me for my code about GPU?
I want to use gpu to mutiply 2 matrix different size.
to speed up, I use arrayfun. it gets error.
so i dont know how to mutiply 2 matrix.
this is my code.
function c = myCal(rawdata, gain)
c = (rawdata .* gain);
end
meas = gpuArray(ones(1,10)*3);
gn = [1 2 3 4 5 6 7 8 9 10;
2 3 4 5 6 7 8 9 2 1]';
gn = gpuArray(gn);
corrected = arrayfun(@myCal,meas,gn);
results = gather(corrected);
Thank for your help.

回答 (1 件)

Matt J
Matt J 2018 年 7 月 20 日
results= meas.' .* gn;

カテゴリ

Help Center および File ExchangeGPU Computing についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by