0

I want to call the sparse matrix multiplication function in cuSPARSE library inside the kernel instead of directly calling it at the host side. I write a __device__ function to implement it.My CUDA is 11.3 and My hardware is V100.My code all follows NVIDIA CUDALibrarySamples: spmm_csr

But it fails with:

error: calling a __host__ function("cusparseSpMM") from a __device__ function("spmm_csr") is not allowed

How can I call it in __device__ function?

Or there are others ways to implement sparse matrix multiplication inside kernel?

1 Answer 1

1

I want to call the sparse matrix multiplication function in cuSPARSE library inside the kernel instead of directly calling it at the host side

That is not possible. cuSPARSE is a host only library.

Sign up to request clarification or add additional context in comments.

3 Comments

Thanks!Do you know whether the cuBLAS library is a host only library?
Yes, cuBLAS is now also host only. There was a period where there was also a device side version of cuBLAS, but that was discontinued and removed from the CUDA toolkit several major release cycles ago
@ben286 Some linear algebra features (mostly GEMM) for device code are available through CUTLASS.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.