Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Intel Community
- Software
- Software Development SDKs and Libraries
- Intel® oneAPI Math Kernel Library
- transpose matrix stored in CSR format using MKL

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

Thomas_D_

Beginner

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

06-05-2014
02:14 PM

331 Views

transpose matrix stored in CSR format using MKL

All,

I have some legacy parallel code that uses CSR format to store a very large, sparse matrix. In making some additions to the code, I have the need to transpose the matrix, storing the transpose in CSR format as well.

Is there a routine in the MKL that would help me do this? I thought of using a BLAS routine to repeatedly multiply column vectors with ones in successive locations by the matrix, and accumulate the results. Is there a better way?

Thanks,

Tom

Link Copied

6 Replies

mecej4

Black Belt

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

06-05-2014
03:19 PM

331 Views

Here is an idea for you to evaluate -- it may not be as efficient as writing your own code to do the transformation, but it is unlikely to lead to a bottleneck.

Note that the CSR representation of a matrix A is identical to the CSC representation of A^{T}. Therefore, code using the relevant version of mkl_?csrcsc may be the easiest to implement.

Alternatively, convert the CSR representation to a COO representation, say (IC, JC, VC). The COO representation of the transpose is (JC,IC,VC). Convert this COO representation to a CSR representation of the transposed matrix.

Which option to use depends on what other transformations you need to perform, if any, in addition to transposing.

Routines for doing the conversions indicated are provided in MKL.

Thomas_D_

Beginner

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

06-06-2014
11:44 AM

331 Views

Thanks, that look like a promising approach!

Regards,

Tom

Li__Yapeng

Beginner

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

12-19-2018
11:23 PM

331 Views

The function of mkl_sparse_?_add can perform what you want.

Gennady_F_Intel

Moderator

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

12-20-2018
06:48 AM

331 Views

Tibaldi__Alberto

Beginner

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

02-11-2020
09:56 AM

331 Views

Hi,

Another solution is to use MKL_SPARSE_CONVERT_CSR. Even if the matrix is in CSR format, if you perform (RACSR in my example is a matrix already stored in CSR format),

mkl_status = MKL_SPARSE_CONVERT_CSR(RACSR, SPARSE_OPERATION_TRANSPOSE, RACSR)

after this command, RACSR is transposed.

Best Regards,

Alberto

Gennady_F_Intel

Moderator

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

02-11-2020
07:21 PM

331 Views

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

For more complete information about compiler optimizations, see our Optimization Notice.