coo2csr undefined

Hello,
I am using CUDA 5. My nvcc compiler is claiming that cusparseScoo2csr, cusparseDcoo2csr, and other sare undefined. However (and this is the fishy part), cusparseDbsr2csr and others are defined. I’m including cusparse_v2.h and cuda_runtime.h. Any idea what the problem is? Are the coo2csr and csr2coo version deprecated in CUDA 5?

cheers,
nicolas

Hi,
you may want to look it up in manual.
There’s no cusparseScoo2csr or cusparseDcoo2csr or any other like this.
The only one that’s there is:
cusparseXcoo2csr
and it works with all of the data formats, since the only thing is modified by this function is an index array.

My best,
G.

Thanks so much for your reply. The compiler is still telling me that cusparseXcoo2csr is also undefined (I’ve tried several times). cusparseDbsr2csr (to take one example) does work though. Is there some setting I have to change in the compiler line, or another library I have to include? Incidentally, cusparseCreate() is undefined as well.

The example in chapter 13 of the cusparse manual includes only cuda_runtime.h and cusparse_v2.h, but are there others I need? I really appreciate the help.

cheers,
nicolas

When I copy and paste the example from http://docs.nvidia.com/cuda/cusparse/index.html (Appendix B), the compiler complains that many (though not all) of the cusparse functions are undefined:

/tmp/tmpxft_00005315_00000000-1_fromManual.o:fromManual.cpp:function main: error: undefined reference to 'cusparseDestroyMatDescr'
/tmp/tmpxft_00005315_00000000-1_fromManual.o:fromManual.cpp:function main: error: undefined reference to 'cusparseDestroy'
/tmp/tmpxft_00005315_00000000-1_fromManual.o:fromManual.cpp:function main: error: undefined reference to 'cusparseDestroyMatDescr'
/tmp/tmpxft_00005315_00000000-1_fromManual.o:fromManual.cpp:function main: error: undefined reference to 'cusparseDestroy'
/tmp/tmpxft_00005315_00000000-1_fromManual.o:fromManual.cpp:function main: error: undefined reference to 'cusparseDestroyMatDescr'
/tmp/tmpxft_00005315_00000000-1_fromManual.o:fromManual.cpp:function main: error: undefined reference to 'cusparseDestroy'
/tmp/tmpxft_00005315_00000000-1_fromManual.o:fromManual.cpp:function main: error: undefined reference to 'cusparseDestroyMatDescr'
/tmp/tmpxft_00005315_00000000-1_fromManual.o:fromManual.cpp:function main: error: undefined reference to 'cusparseDestroy'
/tmp/tmpxft_00005315_00000000-1_fromManual.o:fromManual.cpp:function main: error: undefined reference to 'cusparseCreate'
/tmp/tmpxft_00005315_00000000-1_fromManual.o:fromManual.cpp:function main: error: undefined reference to 'cusparseCreateMatDescr'
/tmp/tmpxft_00005315_00000000-1_fromManual.o:fromManual.cpp:function main: error: undefined reference to 'cusparseSetMatType'
/tmp/tmpxft_00005315_00000000-1_fromManual.o:fromManual.cpp:function main: error: undefined reference to 'cusparseSetMatIndexBase'
/tmp/tmpxft_00005315_00000000-1_fromManual.o:fromManual.cpp:function main: error: undefined reference to 'cusparseXcoo2csr'
/tmp/tmpxft_00005315_00000000-1_fromManual.o:fromManual.cpp:function main: error: undefined reference to 'cusparseDsctr'
/tmp/tmpxft_00005315_00000000-1_fromManual.o:fromManual.cpp:function main: error: undefined reference to 'cusparseDcsrmv_v2'
/tmp/tmpxft_00005315_00000000-1_fromManual.o:fromManual.cpp:function main: error: undefined reference to 'cusparseDcsrmm_v2'
collect2: ld returned 1 exit status

Is the only likely possibility that CUDA was not installed correctly?

Okay I’m good now. I did not know I needed to include “-lcusparse” while compiling. Thanks again for your response Glupol!