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

## side change for mkl_dcsrmm Beginner
240 Views

Hi all

the current version of mkl_dcsrmm implements the operations

C=AB+C and C=A'B+C, where in both cases A is the csr sparse matrix.

Is there any way/alternative such that B is the csr sparse matrix??

In my specific application C and A are large dense matrices of dimension eg 3,000,000:70. B is of dimension 70:70 with up to 80% zero coefficients. Ignoring the sparse structure of B would lead to dgemm, but this would cause a large overhead for multiplications with zeros. Also mkl_dcsrmm would be feasible with A and C being transposed before the operation, however, due to their size this is not possible with regard to speed (mkl_dcsrmm is called up to 10,000 times).

Any suggestions appreciated.

Cheers

2 Replies Employee
240 Views

Hi.

In case you need to compute C = A*B with B is sparse you can use C^t = B^t*A^t. The last formula equivalent to

C_1 = B^t*A_1 where C_1 = C^t and A_1 = A_t

To compute it you can use sparse_mm functionality with same matrices, opposite layout and transpose flag of sparse matrix

Thanks,

Alex Beginner
240 Views

Hi Alex,

thanks for the response.

Does your answer imply that I should transpose the dense matrices before calling the sparse multiplication routine? If so, that is not possible  because of their size. The multiplication is called several thousand times, and always transposing two 3,000,000x70 matrices will be to much overhead.

Or does your answer imply that I can provide transposition flags to one of spares multiplication routines similar to gemm? If so I am only aware that I can supply transposition flags for the sparse matrix but not for the dense.

Let me know if I am wrong.

Thanks 