Have a quick question to ask, I need to do A x B where A is a sparse matrix stored in CSR format, B is a symmetric dense matrix. Now I am using csrmm to compute the multiplication, but have to convert B into full dense matrix first, which doubles the memory for B. Is there any routine in MKL that can handles this?
Some questions that are relevant to the request:
Thanks for reply.
1. The B matrix is stored column wise, packed form (upper triangle) before converting to full dense matrix.
2. After computing AxB=C, I will do a for loop i=1:n, for each i, I need to do D_i x C, where D_i is also a sparse matrix. Here I use csrmm for sure since the dense C matrix is not symmetric.
3. The product matrix C is not symmetric, so just the regular way to store it, we use column major to store dense matrix in our code.
It seems there is no good function can operate a spase matrix A*B (parcked upper triangle) form. You may either convert B to dense matrix. Then use mkl_?csrmm. Get sparse C matrix. Then call mkl_?csrmultd. to compute D_i *C.
Or convert B to sparse matrix. use mkl_?csrmultd. to compute C= A*B. Then mkl_?csrmm do D_i*C. But if convert B to sparse matrix. it still need double memory.
or call mkl_?csrgemv to compute ci=A*bi (B's colum vector). , then call csrmm do D_i*C.