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.
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);
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/.
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?
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.