- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I have a problem using MKL Sparse Blas Level 3 routine "mkl_dcoomm" which calculates C=A*B where A is a sparse matrix in coordinate format and B is dense matrix. Clearly C is also a dense matrix. The problem is that I would like to perform C=A*B where B is sparse and A is dense (reverse of former case). Is there any other function for this (I didn't find!) or I should change my expression and use same matrix? My question might be very elementary, so sorry in advance!
Thanks for your help,
D.
I have a problem using MKL Sparse Blas Level 3 routine "mkl_dcoomm" which calculates C=A*B where A is a sparse matrix in coordinate format and B is dense matrix. Clearly C is also a dense matrix. The problem is that I would like to perform C=A*B where B is sparse and A is dense (reverse of former case). Is there any other function for this (I didn't find!) or I should change my expression and use same matrix? My question might be very elementary, so sorry in advance!
Thanks for your help,
D.
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - danltu.se
Hi,
I have a problem using MKL Sparse Blas Level 3 routine "mkl_dcoomm" which calculates C=A*B where A is a sparse matrix in coordinate format and B is dense matrix. Clearly C is also a dense matrix. The problem is that I would like to perform C=A*B where B is sparse and A is dense (reverse of former case). Is there any other function for this (I didn't find!) or I should change my expression and use same matrix? My question might be very elementary, so sorry in advance!
Thanks for your help,
D.
I have a problem using MKL Sparse Blas Level 3 routine "mkl_dcoomm" which calculates C=A*B where A is a sparse matrix in coordinate format and B is dense matrix. Clearly C is also a dense matrix. The problem is that I would like to perform C=A*B where B is sparse and A is dense (reverse of former case). Is there any other function for this (I didn't find!) or I should change my expression and use same matrix? My question might be very elementary, so sorry in advance!
Thanks for your help,
D.
C^T = (A*B)^T = B^T * A^T
B^T : set transa = 'T'
A^T : store A in row-major order, or transpose A if it is stored in column-major order
C^T : treat C as C-style dense array, or transpose C if you need column-major order
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - jaewonj
This might work.
C^T = (A*B)^T = B^T * A^T
B^T : set transa = 'T'
A^T : store A in row-major order, or transpose A if it is stored in column-major order
C^T : treat C as C-style dense array, or transpose C if you need column-major order
C^T = (A*B)^T = B^T * A^T
B^T : set transa = 'T'
A^T : store A in row-major order, or transpose A if it is stored in column-major order
C^T : treat C as C-style dense array, or transpose C if you need column-major order
Thank you janwonj for your answer. It can be a solution, but it sounds weired to me if MKL does not support such simple multiplication. Isn't really any suitable function to perform DENSE x SPARSE operation in MKL?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - danltu.se
Thank you janwonj for your answer. It can be a solution, but it sounds weired to me if MKL does not support such simple multiplication. Isn't really any suitable function to perform DENSE x SPARSE operation in MKL?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - danltu.se
Thank you janwonj for your answer. It can be a solution, but it sounds weired to me if MKL does not support such simple multiplication. Isn't really any suitable function to perform DENSE x SPARSE operation in MKL?
Anyway there are different ways to used MKL, but it depend to problem that required computation of DENSE matrix C
First way: Size of SPARSE matrix is enough small, then you could convert from COO to DENSE and use MKL dgemm.
Second way: Your interest is compute product y = C*x (x is vector) or Y=C*X (X is DENSE matrix) then you could used MKL by next way:
compute z = B * x (use mkl_dcoomv) and compute y= A * z (use dgemv)
or
compute Z = B * X (use mkl_dcoomm) and compute Y= A * Z (use dgemm)
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page