public Pointer toDenseMatrix(cusparseHandle cusparseHandle,cublasHandle cublasHandle,int rows,int cols) throws DMLRuntimeException {
  long size=rows * cols * Sizeof.DOUBLE;
  Pointer A=JCudaObject.allocate(size);
  cusparseDcsr2dense(cusparseHandle,rows,cols,descr,val,rowPtr,colInd,A,rows);
  return A;
}

public Pointer toDenseMatrix ( cusparseHandle cusparseHandle , cublasHandle cublasHandle , int rows , int cols ) throws DMLRuntimeException { long size = rows * cols * Sizeof . DOUBLE ; Pointer A = JCudaObject . allocate ( size ) ; cusparseDcsr2dense ( cusparseHandle , rows , cols , descr , val , rowPtr , colInd , A , rows ) ; return A ; }
copies this csr matrix on the gpu to a dense row - major matrix on the gpu . this is a temporary matrix for operations such as cusparsedcsrmv . since the allocated matrix is temporary , bookkeeping is not updated . the called is responsible for calling " free " on the returned pointer object
