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

gemv for sparse, rectangular matrices?

damienhocking
New Contributor I
392 Views

Is there a recommended routine in the MKL that can do a GEMV with the transpose of a rectangular sparse matrix?  I know I can pad it to square but I'd prefer not to have to do that.  These sparse matrices could be large, 10 million+ nonzeroes and a million rows or columns. 

Damien

0 Kudos
1 Solution
Zhen_Z_Intel
Employee
392 Views

Hi,

mkl_?<format>gemv is designed for square, but mkl_?<format>mv can be used for rectangular matrix (m * k). Or, you could use Inspector-execute sparse function mkl_sparse_?_mv, normally would provide a better performance. 

View solution in original post

0 Kudos
4 Replies
Zhen_Z_Intel
Employee
392 Views

Hi,

You provided BLAS level 2 function for sparse matrix. For sparse matrix, we normally use compressed data structure that Intel MKL supports CSR, CSC, COO, diagonal and skyline. You could learn more from developer reference about usage with different matrix structure& data compression format:

https://software.intel.com/en-us/node/520802

0 Kudos
damienhocking
New Contributor I
392 Views

Yes, but the docs are all for a square m x m matrix.  I have rectangular matrices.  

0 Kudos
Zhen_Z_Intel
Employee
393 Views

Hi,

mkl_?<format>gemv is designed for square, but mkl_?<format>mv can be used for rectangular matrix (m * k). Or, you could use Inspector-execute sparse function mkl_sparse_?_mv, normally would provide a better performance. 

0 Kudos
damienhocking
New Contributor I
392 Views

Thank you Fiona, that's exactly what I wanted.

0 Kudos
Reply