- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
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?
Many thanks!
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Any help would be appreciated, thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Some questions that are relevant to the request:
- How is the symmetric matrix B currently stored (before being converted to full, dense)?
- What do you intend to do with A x B , after computing the product matrix?
- How do you wish to store the product matrix?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Wei,
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.
Best Regards,
Ying

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page