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

matrix version of ?spmv

may_ka
Beginner
242 Views

Hi there,

I am wondering whether there is a matrix version of ?spmv, e.g. ?spmm. I am dealing with huge symmetric matrices (+50,000 row dimension) which I want to multiply with other matrices. Currently I store them in general format and call gemm. I am aware of calling ?spmv inside a loop but I am looking for a more elegant way. I found gemm_compute in the leatest manual, but it occurs to me that it is not doing what I want.

Any suggestions??

Thanks.

0 Kudos
2 Replies
Gennady_F_Intel
Moderator
242 Views
yes, MKL contains many such routines for different formats please refer to this list ( MKL 2018 ) https://software.intel.com/en-us/mkl-developer-reference-c-sparse-blas-level-2-and-level-3-routines-1
0 Kudos
may_ka
Beginner
242 Views

Hi Gennady,

thanks for the quick response.

However, you have pointed me to the sparse routines, but non of the matrices in my example is actually sparse.

My current understanding is:

  • the packed format used for the matrix in ?spmv is not equal to any sparse format because it lacks the integer index vectors.
  • a dense symmetric matrix does not need any index vectors at all because the full upper or lower triangular is stored as a vector
  • BLAS does not have a level 3 equivalent to ?spmv https://software.intel.com/en-us/mkl-developer-reference-fortran-blas-level-3-routines
  • a symmetric dense matrix which can be stored packed but is stored sparse will be less efficient in terms of RAM because it has an unnesseary overhead for the index vectors. In fact it will have no storage advantage at all compared to storing the full symmetric matrix. It will also be less efficient in terms of speed during multiplication from going through these index vectors.

Let me know what I am getting wrong.

0 Kudos
Reply