Dear all,

I was checking the example of the cusparseSpSV CSR found here and unless I am missing something, even if the check is true, the result is mathematically not correct:

The correct solution for the system (Y) in the example is [0, 0.5, 0.5, 0].

Please let me know what is the correct procedure for using cusparseSpSV.

Hi @Jhair_Acosta,

The formula should be `op(A) * X = alpha * op(Y)`

, where **X is the output** and **Y is the input (RHS)** . [Will be fixed soon]

SpSV and SpSM take a square sparse matrix and use cusparseSpMatSetAttribute() to specify the fill mode: lower/upper and diagonal type: unit/non-unit. In this example, CUSPARSE_FILL_MODE_LOWER and CUSPARSE_DIAG_TYPE_NON_UNIT are used.

Thanks

Hi @malmasri,

Thanks for your answer, now it makes senses to have [1,2,3,4] as the answer if I am considering only the lower diagonal. So that means that this example is already considering that A is the LU decomposition. Since that is the case, now I have the question of how to get the LU decomposition, because the cuSparse documentation says that cusparsecsrilu02 is depreciated and will be removed in the next major release.

Thanks,

Hi @malmasri,

Thanks for your answers.

We use all the time LU factorization in our program with Sparse matrices. It is to solve power systems, which are inherently sparse, so it will be really helpful to have those functions.

Thanks for your suggestion of cuDSS, I will check that library.