Skip to main content

cusparseCreateCsr

Function cusparseCreateCsr 

Source
pub unsafe extern "C" fn cusparseCreateCsr(
    spMatDescr: *mut cusparseSpMatDescr_t,
    rows: i64,
    cols: i64,
    nnz: i64,
    csrRowOffsets: *mut c_void,
    csrColInd: *mut c_void,
    csrValues: *mut c_void,
    csrRowOffsetsType: cusparseIndexType_t,
    csrColIndType: cusparseIndexType_t,
    idxBase: cusparseIndexBase_t,
    valueType: cudaDataType,
) -> cusparseStatus_t
Expand description

This function initializes the sparse matrix descriptor spMatDescr in the CSR format.

cusparseCreateCsr has the following constraints:

  • csrRowOffsets, csrColInd, and csrValues must be aligned to the size of the datatypes specified by csrRowOffsetsType, csrColIndType, and valueType, respectively. See cudaDataType_t for the description of the datatypes.

ยงParameters

  • spMatDescr: Sparse matrix descriptor.
  • rows: Number of rows of the sparse matrix.
  • cols: Number of columns of the sparse matrix.
  • nnz: Number of non-zero entries of the sparse matrix.
  • csrRowOffsets: Row offsets of the sparse matrix. Array with rows + 1 elements.
  • csrColInd: Column indices of the sparse matrix. Array with nnz elements.
  • csrValues: Values of the sparse matrix. Array with nnz elements.
  • csrRowOffsetsType: Data type of csrRowOffsets.
  • csrColIndType: Data type of csrColInd.
  • idxBase: Index base of csrRowOffsets and csrColInd.
  • valueType: Datatype of csrValues.