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

Convert dense matrix to sparse BSR

Ahmadi__Afshin
364 Views

Hello,

I am currently struggling to find a function that can convert a dense matrix to sparse BSR storage format. I know there is mkl_?dnscsr which does the job for CSR format but how about other sparse formats which are supported in MKL?

My goal is to convert two dense matrices to BSR format, create the BSR handle for each of them using mkl_sparse_?_create_bsr, and pass them to mkl_sparse_spmm for multiplication. Any idea how to do this if it is not possible to convert the dense matrices to BSR and vice versa?

Best,

Afshin

0 Kudos
2 Replies
Gennady_F_Intel
Moderator
364 Views

There is no one call to do that. You may try to convert dense to CSR then from CSR - BSR ( mkl_?dndcsr, mkl_?csrbsr)

 

0 Kudos
Ahmadi__Afshin
364 Views

Gennady F. (Intel) wrote:

There is no one call to do that. You may try to convert dense to CSR then from CSR - BSR ( mkl_?dndcsr, mkl_?csrbsr)

 

 

But it will affect the performance since we are doing two operations instead of one, right? It will be nice if you can add direct functions for this purpose in future implementations of MKL.

I also noticed that there is no function to read a single value from a matrix if it is in one of the sparse storage formats. It will be nice if you add this function as well.

0 Kudos
Reply