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

Are there any examples of mkl_?csrmultcsr functions? I have MKL 11.3 but have not found examples for these functions. I am also interested in knowing the maximum dimension sizes for rows/cols of the matrices.

Thanks,

Kirk

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

Attached the sample.

And you may find the mkl_?csrmultcsr sample in the forum , for example. https://software.intel.com/en-us/forums/intel-math-kernel-library/topic/639846

Best Regards,

Ying

Link Copied

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

Note that I am using C/C++ and on Windows if that make any difference.

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

Hi Kirk,

For the performance, i may recommend you to use the function mkl_sparse_spmm, it can calculate sparce C = sparse A* sparse B

sparse_status_t mkl_sparse_spmm (sparse_operation_t operation, const sparse_matrix_t A, const sparse_matrix_t B, sparse_matrix_t *C);

Include Files

• mkl_spblas.h

Description

The mkl_sparse_spmm routine performs a matrix-matrix operation:

C := op(A) *B

where A, B, and C are sparse matrices.

I update one c sample and the sample will be in MKL install folder /example/.

Best Regards,

Ying

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

Attached the sample.

And you may find the mkl_?csrmultcsr sample in the forum , for example. https://software.intel.com/en-us/forums/intel-math-kernel-library/topic/639846

Best Regards,

Ying

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

Thank you for the sample, I was able to figure out what I functions calls I needed.

I have one question regarding the output however. One of the result matrix items from the mkl_sparse_d_create_csr, mkl_sparse_spmm, and mkl_sparse_d_export_csr calls is coming out to a value of 0, and I would expect it NOT to be included in the result matrix in csr format, but it is.

When looking at the matrix multiplication "by-hand" in dense matrix format, the cell in question should be calculated by (3*-2)+(9*0)+(0*0)+(0*5)+(0*9)+(3*2), which yields 0. Any idea why this zero would be included in the resulting csr matrix?

Thanks,

Kirk

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

Hi Kirk,

The reason of including "zero" element in resulted structure is the fact that structure and values calculated in different part of code to achieve better performance and it is hard to remove zero elements from structure after calculation.

Thanks,

Alex

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