Diagonal type when calling cuSparse SpSV routine

Hi, I’ve got a question about the SpSV routine from cuSparse.

So before calling cusparseSpSV routines, it is necessary to set the properties of the sparse triangle matrix via cusparseSpMatSetAttribute(…). For a lower triangular matrix L with unity diagonal that comes from a iLU0 factorization of a sparse matrix A, it needs to set the diagonal type as “CUSPARSE_DIAG_TYPE_UNIT”.

Now my question is: does it require that the actual diagonal of L is all unity? I ask this, because typically L and U are stored in one matrix, say M, with the diagonal belongs to U. So when I pass M to the cusparseSpSV routine for L, its diagonal is actually not unity.

Thanks in advance.

Regards,
Lu

Hi @417luke318,
When CUSPARSE_DIAG_TYPE_UNIT and CUSPARSE_FILL_MODE_LOWER are used for diagonal type and fill mode of M, respectively, the lower matrix diagonal will be set to one regardless of M’s diagonal values.

Thanks,
Mohammad

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.