removing FOR loop to solve Ax=B on multidimensional arrays on GPU
2 views (last 30 days)
Show older comments
Hi,
my code looks this way now(Its an example code i wrote):
A=gpuArray(rand([1000 1000 1000]));
B=gpuArray(rand([1000 1 1000]));
for kk=1:1000
C(:,kk)=A(:,:,kk)\B(:,kk);
end
Assume that A,B,C matrices are GPU matrices. Is it possible to remove FOR loop and perform same operation as above lines on GPU using GPU matrices?.(Assume that i do not want to use 'while' or 'if' or any other loops )
The closest i could find was on fileexchange . However she/he does not talk about 'A\B' kind of operations. Also she/he does not talk about GPU computing.
Thank you.
0 Comments
Accepted Answer
Matt J
on 28 Nov 2018
C=pagefun(@mldivide,A,B)
10 Comments
Joss Knight
on 1 Dec 2018
Yes, that. MLDIVIDE already works with multiple right-hand-sides, stacked along the columns of b. You only need PAGEFUN if A is changing.
More Answers (0)
See Also
Categories
Find more on GPU Computing 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!