- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

I have a matrix A I want to perform the following operation in MKL,

C = A^{T}

Where A is a sparse matrix and A^{T} and then multiplying it using **spmmd. **Note that C is a dense matrix. But this approach wastes memory because I need to compute A^{T }separately. Is there any specific function in MKL that I can use for this?

Link Copied

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hello,

Have a look at mkl_sparse_?_syrkd, https://software.intel.com/en-us/mkl-developer-reference-c-mkl-sparse-syrkd. Isn't it what you're looking for?

Best,

Kirill

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Thanks. Not exactly. syrkd computes A*A^{T}. But I do not want to compute it. What I need is a subset of the rows of A times the transpose of A. I do not see how I can use syrkd for achieving this.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

I see, I didn't notice it. So, I guess then that h is relatively small, right? (if it was comparable with the size of the matrix you could use syrk and then throw away the part which is not needed).

If h is very small, you might consider conveting A(1:h,:) and the resulting matrix to a dense format, and make use of mkl_sparse_?_mm (and use an extra transposition of the result). Say, if A(1:h,:) = B (dense), you can write A(1:h,:)*A^T = B * A^T = (A * B^T)^T, so you can transpose B while converting A(1:h,:) to the dense format, compute the result using mm and then transpose the (skinny, dense) matrix product to get the final result (in the dense format).

You can also try to play around with CSR/CSC formats and transposition to avoid transposing the matrix A at the cost of transposing the other objects (similar to what I describe above) but I am not sure it will bring you a lot of benefits.

Also, if you tell us more about your use case and why it happens to be something important ~ critical for performance, we can add it to the list of feature requests.

Best,

Kirill

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