Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

using MKL in place of CSparse library

meinyahanhoongmail_c
444 Views
Hi,
I've been working on a code where I want to implement MKL instead of CSparse library. Just for the reference, CSparse function routines can be seen on " http://www.cise.ufl.edu/research/sparse/CSparse/ ". I am finding trouble in handling the cs_multiply and cs_add functions. Also, the CSparse library has defines a structure " cs* " for storing and using sparse matrices, but for using MKL functions, one has to pass all the details manually every time. Please suggest some way to proceed ahead.
Also, which function of MKL can be used to multiply 2 sparse matrices? The function I found in MKL for solving C=A*B (A,B,C all are matrices) are for one sparse matrix and the rest are dense matrices.

Please look through this and help me out.

Thanks,
Regards..... :)
0 Kudos
5 Replies
ArturGuzik
Valued Contributor I
444 Views
Also, which function of MKL can be used to multiply 2 sparse matrices? The function I found in MKL for solving C=A*B (A,B,C all are matrices) are for one sparse matrix and the rest are dense matrices.


Hi,

(1) this link should help you. It demonstrates most of the things you'll need to call MKL from C#. In case of any problems, post some a bit more detailed info.
(2) sparse matrices -> see mkl_?csrmultcsr and this thread for details.

A.
0 Kudos
meinyahanhoongmail_c
444 Views
Quoting - ArturGuzik
Also, which function of MKL can be used to multiply 2 sparse matrices? The function I found in MKL for solving C=A*B (A,B,C all are matrices) are for one sparse matrix and the rest are dense matrices.


Hi,

(1) this link should help you. It demonstrates most of the things you'll need to call MKL from C#. In case of any problems, post some a bit more detailed info.
(2) sparse matrices -> see mkl_?csrmultcsr and this thread for details.

A.

thnx for the quick response.
I am using mkl 10.0.011 and didn't find the mkl_?csrmultcsr and mkl_?csradd functions. In which version are these functions included?
Also, the my matrices are in csc format. What could be the suggestions for using these functions? Is there any function to convert csc to csr format?

thanx,
regards...
0 Kudos
jaewonj
Novice
444 Views

thnx for the quick response.
I am using mkl 10.0.011 and didn't find the mkl_?csrmultcsr and mkl_?csradd functions. In which version are these functions included?
Also, the my matrices are in csc format. What could be the suggestions for using these functions? Is there any function to convert csc to csr format?

thanx,
regards...

I believe ?csrmultcsr is new in 10.1. As for csc to csr, youprobably need to usecs_transpose.

or you could go to the following url, download Sparsity source codes, and look at sparse_fcvt.c.

http://www.cs.berkeley.edu/~ejim/sparsity/


0 Kudos
ArturGuzik
Valued Contributor I
444 Views
Quoting - jaewonj

I believe ?csrmultcsr is new in 10.1. As for csc to csr, youprobably need to usecs_transpose.

or you could go to the following url, download Sparsity source codes, and look at sparse_fcvt.c.

http://www.cs.berkeley.edu/~ejim/sparsity/


That's true. It's from version 10.1. So your options are limited to (a) upgrade (b) get replacement code as pointed above.

A.
0 Kudos
Gennady_F_Intel
Moderator
444 Views

Is there any function to convert csc to csr format?

thanx,
regards...

Just for information:
The newest MKL version 10.2(we are going to release very soon) will contains another extended list of conversion routines, including a new one for conversion CSR (3-array variation) <-> CSC (3-array variation).
--Gennady

0 Kudos
Reply