Skip to main content

cusparseCreateBsr

Function cusparseCreateBsr 

Source
pub unsafe extern "C" fn cusparseCreateBsr(
    spMatDescr: *mut cusparseSpMatDescr_t,
    brows: i64,
    bcols: i64,
    bnnz: i64,
    rowBlockSize: i64,
    colBlockSize: i64,
    bsrRowOffsets: *mut c_void,
    bsrColInd: *mut c_void,
    bsrValues: *mut c_void,
    bsrRowOffsetsType: cusparseIndexType_t,
    bsrColIndType: cusparseIndexType_t,
    idxBase: cusparseIndexBase_t,
    valueType: cudaDataType,
    order: cusparseOrder_t,
) -> cusparseStatus_t
Expand description

This function initializes the sparse matrix descriptor spMatDescr for the Block Compressed Row (BSR) format.

cusparseCreateBsr has the following constraints:

  • bsrRowOffsets, bsrColInd, and bsrValues must be aligned to the size of the datatypes specified by bsrRowOffsetsType, bsrColIndType, and valueType, respectively. See cudaDataType_t for the description of the datatypes.

ยงParameters

  • spMatDescr: Sparse matrix descriptor.
  • brows: Number of block rows of the sparse matrix.
  • bcols: Number of block columns of the sparse matrix.
  • bnnz: Number of blocks of the sparse matrix.
  • rowBlockSize: Number of rows of each block.
  • colBlockSize: Number of columns of each block.
  • bsrRowOffsets: Block row offsets of the sparse matrix. Array of size brows + 1.
  • bsrColInd: Block column indices of the sparse matrix. Array of size bnnz.
  • bsrValues: Values of the sparse matrix. Array of size bnnz * rowBlockSize * colBlockSize.
  • bsrRowOffsetsType: Data type of bsrRowOffsets.
  • bsrColIndType: Data type of bsrColInd.
  • idxBase: Base index of bsrRowOffsets and bsrColInd.
  • valueType: Datatype of bsrValues.
  • order: Enumerator specifying the memory layout of values in each block.