Why does cusparseSpMM only supports Sparse x Dense but not Sparse x Sparse?

I am trying to compute J^TJ with cuSparse. J is a large but sparse matrix. I looked into the documents here

https://docs.nvidia.com/cuda/cusparse/index.html#cusparse-generic-function-spmm

but there doesn’t seem to be an API that I can call to do that. The closest one is cusparseSpMM but for some reason, it requires B matrix to be dense instead of sparse. The problem is I don’t have enough GPU memory to make J dense.

How come there isn’t a function that can allow us to do matrix multiplication between two sparse matrices? Or am I missing something?

Even the depreciated cusparseDcsrmm only supports multiplication with dense B matrix… is it possible to J^TJ with cuSparse? Needing to compute J^TJ is fairly common in solving non-linear optimization problems.

https://docs.nvidia.com/cuda/cusparse/index.html#csrgemm2

https://docs.nvidia.com/cuda/cusparse/index.html#csr2cscEx2

Thank you, Robert. I can’t believe I missed it.