Solving overdetemined (non-square) linear system using the GPU.

4 次查看(过去 30 天)
I need help big time. I have large overdetermined linear system and I want to use the computation advantages of the GPU to do this faster. I have the parallel computing toolbox (v5.1) and a Nvidia GTX 580. The mldivide or ("\") work with x=A\b on the cpu for non square dimension of A but for the gpu function this matrix needs to be square. Does anyone know of a solution to solve the non-square matrix on the GPU? I am a bit reluctant to start looking to much into CUDA programming at this point.
Thanks for all your help.

回答(3 个)

Jill Reese
Jill Reese 2011-6-13
Hi Jesper. If your MATLAB license is up to date you might like to have a look at the pre-release of R2011b which has just become available. This includes a number of updates to the GPU features which you might find useful.
It can be downloaded by logging in to the main www.mathworks.com page. After logging in, click on "My Account" at the top right of the page, then "Download R2011b Prerelease" from the "Account services" section.

Teja Muppirala
Teja Muppirala 2011-6-13
The pseudoinverse can be found by inv(A'*A)*A'
Thus you can solve your problem like this:
A = rand(4000,1000);
b = rand(4000,1);
tic
gA = gpuArray(A);
gb = gpuArray(b);
gx = (gA'*gA)\(gA'*gb);
x = gather(gx);
toc
Compare that with these:
tic
x_cpu1 = A\b;
toc
tic
x_cpu2 = (A'*A)\(A'*b);
toc

John Melonakos
John Melonakos 2011-7-24
Jacket is the only way to get this done directly in MATLAB, since PCT doesn't support very much. Download a free trial here: http://accelereyes.com/jacket_tour

类别

Help CenterFile Exchange 中查找有关 GPU Computing 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by