Sparse Matrix (gpuArray) LU Decomposition

How can I do LU decomposition on GPU device to a sparse-matrix (H)? Suppose H is a sparse matrix, I did
>> H=gpuArray(H);
>> [L,U,P]=lu(H);
Error using gpuArray/lu
Sparse gpuArrays are not supported for this function.
Q1: Could you please let me know which function allows me to apply LU decomposition to a sparse matrix on GPU?
Later, I will use the L, U and P to process a series of data (d1,d2, ... dn) individually as below. Each data is a matrix where each column is d.
>>for id=1:nd
>>result(:,id)=L\U\P*data(:,id);
>>end
In this case, I can recycle the L, U and P in each inversion for a given data(:,id).
Thank you.

3 件のコメント

Matt J
Matt J 2018 年 10 月 5 日
What do you plan to do with the decomposition once you have it?
Ted
Ted 2018 年 10 月 6 日
Later, I will use the L, U and P to process a series of data (d1,d2, ... dn) individually as below. Each data is a matrix where each column is d.
>>for id=1:nd
>>result(:,id)=L\U\P*data(:,id);
>>end
In this case, I can recycle the L, U and P in each inversion for a given data(:,id).
Thank you.
Bruno Luong
Bruno Luong 2018 年 10 月 6 日
編集済み: Bruno Luong 2018 年 10 月 6 日
On sparse matrix LU use some graph technique to limits the band of the matrix so that avoid to fill L/U with too many non-zero elements. I suspect the graph method used by LU on sparse is not parallelizable and not suitable for GPU calculation.
Just stick with CPU solution for now.

サインインしてコメントする。

 採用された回答

Joss Knight
Joss Knight 2018 年 10 月 6 日

1 投票

It looks like you're just after the backslash operator, so why not use that, and forget about looping over the RHS.
result = gpuArray(H) \ data;

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeSparse Matrices についてさらに検索

質問済み:

Ted
2018 年 10 月 5 日

回答済み:

2018 年 10 月 6 日

Community Treasure Hunt

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

Start Hunting!

Translated by