How to solve linear equation using GPU?
Show older comments
Assume I need to solve a linear matrix equation Ax=b where A is a 3x3 non-singular matrix and b is a column vector of 3 elements. I know I can use inv(A)*b or A\b to get the solution, but the statement is run in CPU. Now I wanna make sure GPU is employed to run the same statement. Since I'm not familiar with GPU support in Matlab so I ask you for help: how to do it? Ideally I guess there may be a function like enableGPU(true) so that all subsequent statements will be run in GPU automatically. Also, I don't want to limit myself to the above statements. If there is some specific GPU functions like gpuInv(A), that's fine, please tell me that function. Hopefully the GPU version of Matlab code to solve linear equation could be faster than its CPU counterpart. Thanks a lot.
Accepted Answer
More Answers (1)
John D'Errico
on 25 Jan 2017
0 votes
Do you have the proper toolbox? I would suggest this:
https://www.mathworks.com/products/parallel-computing.html
If you don't have it, then, no, you cannot simply invoke computations on your GPU.
Categories
Find more on GPU Computing in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!