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

mkl_sparse_d_spmmd does not support CSC matrices?

Mazur__Luke
Beginner
1,398 Views

Hello

So I created a handle for matrix A (MwqTHandle) in CSR form and a handle for matrix B in CSC form. I tried to multiply these two together using mkl_sparse_d_spmmd. Status was reported as success, but actually all it did is turn the resultant dense matrix to zeroes. Is this not supported? If I make B in CSR form it works however, but this seems inefficient to multiply a CSR matrix by a CSR matrix, surely CSC for the second form is more logical as the columns of the second matrix need to be accessed (or CSR by CSR if the second matrix is to be transposed, but there is no option to do this in spmmd!)

 

I tried doing this with mkl_sparse_spmm and storing the result as a sparse matrix instead, but the code said this was not supported. I tried doing it with mkl_sparse_sp2m and this also does not work with CSR + CSC combination. However it does work with CSR + CSR and allows me to transpose the second matrix, meaning that is essentially achieves the same goal. So I am happy to use that workaround if I want to store the result as sparse, but if I want to store the result as dense is there a workaround to this problem? Perhaps an sp2md that allows transposition of the second matrix?

I tried to upload my source code but not sure if that worked correctly. Please let me know if it hasn't uploaded correctly.

Regards, Luke Mazur

0 Kudos
1 Solution
Gennady_F_Intel
Moderator
1,398 Views

Luke, could you check the latest MKL v.2020 and let us know if the problem is still there?

View solution in original post

0 Kudos
4 Replies
Gennady_F_Intel
Moderator
1,398 Views

Actually, if mkl_sparse_d_spmmd doesn't support a case when A in CSR and B in CSC then this is the bug. We will check and escalate the problem against sparse blas owners.

0 Kudos
Gennady_F_Intel
Moderator
1,399 Views

Luke, could you check the latest MKL v.2020 and let us know if the problem is still there?

0 Kudos
Mazur__Luke
Beginner
1,398 Views

Hello Gennady,
I reran the calls to spmmd, spmm and sp2m using CSC matrices as I originally wanted to and everything appeared to work correctly, so it appears in the 2020 version these problems have disappeared.

0 Kudos
Gennady_F_Intel
Moderator
1,398 Views

Hi Luke,

Thanks for update. The issue was definitely fixed in v.2020.

0 Kudos
Reply