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

## Dense matrix multiply tansposed Sparse Matrix?

Beginner
256 Views

Hi,

I want to use MKL Sparse to compute a dense matrix multiply transposed sparse matrix. Particularly, if I have input A(dense, m-by-k), B(sparse, n-by-k), I want to compute:

C = A * B'

where C is a m-by-n dense matrix. Notice that the position of matrix is different from what mkl_?csrmm(https://software.intel.com/zh-cn/node/520832) defines. I am thinking about transpose the A and C and transpose them back after computation. But there is too much memory consumption when A and C are both big. Any thoughts on that?

Thanks!

1 Solution
Employee
256 Views

Hi Yiming,

Thanks for letting us know. I may escalate the interface request to engineer team to consider in future version. You may use the  transpose + mkl_?csrmm + transpose for temp workaround.

Best Regards,

Ying

transpose, void mkl_simatcopy (const char ordering, const char trans, size_t rows, size_t cols,
const float alpha, float * AB, size_t lda, size_t ldb);

3 Replies
Employee
256 Views

Hi Yiming,

Right, it seems there is no suitable function to do such operation besides that either B transpose, or A transpose. .

C= A(dense)*B'(sparse)  or  C'=B(sparse)*A'(dense) is for mkl_?csrmm.

What is the range of the m, k, n?

Best Regards,
Ying

Beginner
255 Views

Hi Ying,

Thanks for replying. I think the M and N might be in the range of 1,000 to 50,000. Do you have any plan for providing any interface with sparse matrix on the right?

Thanks!

Yiming

Ying H. (Intel) wrote:

Hi Yiming,

Right, it seems there is no suitable function to do such operation besides that either B transpose, or A transpose. .

C= A(dense)*B'(sparse)  or  C'=B(sparse)*A'(dense) is for mkl_?csrmm.

What is the range of the m, k, n?

Best Regards,
Ying

Employee
257 Views

Hi Yiming,

Thanks for letting us know. I may escalate the interface request to engineer team to consider in future version. You may use the  transpose + mkl_?csrmm + transpose for temp workaround.

Best Regards,

Ying

transpose, void mkl_simatcopy (const char ordering, const char trans, size_t rows, size_t cols,
const float alpha, float * AB, size_t lda, size_t ldb);