Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

mkl_sparse_z_trsv

toddwz
Beginner
322 Views

I have the following code, but mkl_sparse_z_trsv returns info as SPARSE_STATUS_NOT_SUPPORTED. Am I missing anything? I'm using 2023.1. Thanks.

 

MKL_INT N = 1;
MKL_INT ia[] = {0,1};
MKL_INT ja[] = {0};
MKL_Complex16 a; a.real = 2.0; a.imag = 1.0;
MKL_Complex16 x, y;
x.real = 2.0; x.imag = 1.0;
sparse_matrix_t A = NULL;
struct matrix_descr descr;
descr.type = SPARSE_MATRIX_TYPE_GENERAL;
descr.diag = SPARSE_DIAG_NON_UNIT;
descr.mode = SPARSE_FILL_MODE_UPPER;
sparse_status_t info = mkl_sparse_z_create_csr(&A, SPARSE_INDEX_BASE_ZERO, N, N, ia, ia+1, ja, &a);
info = mkl_sparse_z_trsv(SPARSE_OPERATION_NON_TRANSPOSE, a, A, descr, &x, &y);

0 Kudos
1 Solution
Gajanan_Choudhary
313 Views

Hi @toddwz,

 

Thanks for reaching out. Since TRSV is a triangular solve, please use "SPARSE_MATRIX_TYPE_TRIANGULAR" instead of "SPARSE_MATRIX_TYPE_GENERAL". TRSV C code examples are also provided with the oneMKL libraries in case you are interested in taking a look.

 

Please let us know if that fixes your issue.

 

Regards,

Gajanan Choudhary

View solution in original post

0 Kudos
2 Replies
Gajanan_Choudhary
314 Views

Hi @toddwz,

 

Thanks for reaching out. Since TRSV is a triangular solve, please use "SPARSE_MATRIX_TYPE_TRIANGULAR" instead of "SPARSE_MATRIX_TYPE_GENERAL". TRSV C code examples are also provided with the oneMKL libraries in case you are interested in taking a look.

 

Please let us know if that fixes your issue.

 

Regards,

Gajanan Choudhary

0 Kudos
toddwz
Beginner
300 Views

It works. Thanks.

0 Kudos
Reply