Backslash operator on GPU

조회 수: 5 (최근 30일)
Francesco
Francesco 2013년 11월 26일
편집: Edric Ellis 2024년 3월 15일
Hello,
I need to perform a backslash operation (A \ B = x) to solve Ax = B.
The A matrix has 10^4 - 10^6 D.O.F, so a square matrix of 10^6 x 10^6. It is very sparse, with approx. 21 non-zero entries per row.
Because of its sparseness, I can reach very large matrices on the CPU, by using the sparse() form. However, when I try to use the \ operator on gpuArrays, it says that I cannot have a sparse matrix as a gpuArray variable. This therefore limits me on the card to about ~8000x8000 square matrix.
The increase in performance on the GPU is substantial, above >1000x1000 square matrix, and is absolutely necessary for 10^6 x 10^6 matrices.
Is there any way I can input sparse matrices on the GPU? Any other way of accelerating such a computation? Any suggestions?
Cheers,
Francesco

채택된 답변

Edric Ellis
Edric Ellis 2013년 11월 27일
편집: Edric Ellis 2024년 3월 15일
Sparse arrays are now supported on the GPU, here's a page describing the support: https://www.mathworks.com/help/parallel-computing/work-with-sparse-arrays-on-a-gpu.html . This support was added several years ago (but was not available at the time the original question was posed).
  댓글 수: 1
Francesco
Francesco 2013년 11월 27일
Would writing a CUDA native program using cuSPARSE to solve the equation work? Would the input of that kernel when called by matlab have to consist of full or sparse matrices?
I could perhaps pre-process on Matlab the full matrix into a more compact form required by cuSPARSE but still make it "look" like a full matrix when I pass it to the cuda kernel, if that makes sense?
Thank you,
Francesco

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

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