How can I do faster a loop using the GPU? (GPU: RTX 3070)
2 views (last 30 days)
% First questions: this loop takes to much time. How can I do this loop using the cores available in the GPU
AA(:,:,i)=As; %this is just an example, in practice, As is different for each i of the loop
MM(:,:,i)=Ms; %Ms is the same for all the indexes i.
%I m using this array to make 2 multiplications and a pointwise produt
% This are the multiplications
% what I need next is this result: sum(Ms.*Hs,[2 1]);
%But, I use a reshape to use all the cores in the pointwise multiplication
% I need to go back to recover the sum of the pointwise multiplication sum(Ms.*Hs,[2 1]);
%First questions: But now, again this loop is too slow
%how can I do faster a loop using the GPU?