Skip to main content

cusparseZbsr2csr

Function cusparseZbsr2csr 

Source
pub unsafe extern "C" fn cusparseZbsr2csr(
    handle: cusparseHandle_t,
    dirA: cusparseDirection_t,
    mb: c_int,
    nb: c_int,
    descrA: cusparseMatDescr_t,
    bsrSortedValA: *const cuDoubleComplex,
    bsrSortedRowPtrA: *const c_int,
    bsrSortedColIndA: *const c_int,
    blockDim: c_int,
    descrC: cusparseMatDescr_t,
    csrSortedValC: *mut cuDoubleComplex,
    csrSortedRowPtrC: *mut c_int,
    csrSortedColIndC: *mut c_int,
) -> cusparseStatus_t
Expand description

This function converts a sparse matrix in BSR format that is defined by the three arrays bsrValA, bsrRowPtrA, and bsrColIndA) into a sparse matrix in CSR format that is defined by arrays csrValC, csrRowPtrC, and csrColIndC.

Let m(=mb*blockDim) be the number of rows of A and n(=nb*blockDim) be number of columns of A, then A and C are m*n sparse matrices. The BSR format of A contains nnzb(=bsrRowPtrA\[mb\] - bsrRowPtrA\[0\]) nonzero blocks, whereas the sparse matrix A contains nnz(=nnzb*blockDim*blockDim) elements. The user must allocate enough space for arrays csrRowPtrC, csrColIndC, and csrValC. The requirements are as follows:

csrRowPtrC of m+1 elements

csrValC of nnz elements

csrColIndC of nnz elements

The general procedure is as follows:

  • The routine requires no extra storage
  • The routine supports asynchronous execution if blockDim != 1 or the Stream Ordered Memory Allocator is available
  • The routine supports CUDA graph capture if blockDim != 1 or the Stream Ordered Memory Allocator is available.