Cusparse spmm of matB matC that shares device pointer

Hi,

I’m wondering whether it is valid to use the same device pointer in two matrices (matB and matC) in SpMM.
For instance,

cusparseCreateDnMat(&matB, ..., **d_X**, ...);
cusparseCreateDnMat(&matC, ..., **d_X**, ...);
cusparseSpMM_bufferSize(..., matA, matB, &ZERO, matC, CUDA_R_32F, CUSPARSE_SPMM_ALG_DEFAULT, &bufferSize)
cusparseSpMM(..., matA, matB, &ZERO, matC, CUDA_R_32F, CUSPARSE_SPMM_ALG_DEFAULT, d_buffer)

Would this work as expected?

Thank you in advance!