- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi All,
I want to multiply sparse matrix with a sparse matrix. Both matrices are stored in CSR format. The suitable function to do this operation is mkl_scsrmultcsr. I wrote a sample code but I'm getting incorrect result. Can you please help me in debugging the program or provide an example to use this function.
I'm having a i7 980x processor and fc13 OS.
The command I used for compiling is
gcc multiplication.c -L/opt/intel/mkl/lib/intel64 -Wl,--start-group -lmkl_intel_lp64 -lmkl_gnu_thread -lmkl_core -Wl,--end-group -fopenmp -lpthread -lm
The program is here http://pastebin.com/pf3pJwE8
The output matrix should be [4,0;0,9] ( [2,0;0,3] * [2,0;0,3] ) but the output the program is giving is
Result nnz = 1
ic[0] = 1
ic[1] = 1
ic[2] = 1
0.000000 0
Thanks and Regards,
M. Kiran Kumar.
I want to multiply sparse matrix with a sparse matrix. Both matrices are stored in CSR format. The suitable function to do this operation is mkl_scsrmultcsr. I wrote a sample code but I'm getting incorrect result. Can you please help me in debugging the program or provide an example to use this function.
I'm having a i7 980x processor and fc13 OS.
The command I used for compiling is
gcc multiplication.c -L/opt/intel/mkl/lib/intel64 -Wl,--start-group -lmkl_intel_lp64 -lmkl_gnu_thread -lmkl_core -Wl,--end-group -fopenmp -lpthread -lm
The program is here http://pastebin.com/pf3pJwE8
The output matrix should be [4,0;0,9] ( [2,0;0,3] * [2,0;0,3] ) but the output the program is giving is
Result nnz = 1
ic[0] = 1
ic[1] = 1
ic[2] = 1
0.000000 0
Thanks and Regards,
M. Kiran Kumar.
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
It's seems that you use zero-based indexing in arrays ia and ja in one-based functionmkl_scsrmultcsr. I've change arrays ia and ja in your code from
int ja[] = {0,1};
int ia[] = {0,1,2};
to
int ja[] = {1,2};
int ia[] = {1,2,3};
and got output from your example:
4.000000 1
9.000000 2
0.000000 0
With best regards,
Alexander Kalinkin
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page