cuSPARSE Generic APIs
The cuSPARSE Generic APIs allow computing the most common sparse linear algebra operations, such as sparse matrix-vector (SpMV) and sparse matrix-matrix multiplication (SpMM), in a flexible way. The new APIs have the following capabilities and features:
Set matrix data layouts, number of batches, and storage formats (for example, CSR, COO, and so on).
Set input/output/compute data types. This also allows mixed data-type computation.
Set types of sparse vector/matrix indices (e.g. 32-bit, 64-bit).
Choose the algorithm for the computation.
Guarantee external device memory for internal operations.
Provide extensive consistency checks across input matrices and vectors. This includes the validation of sizes, data types, layout, allowed operations, etc.
Provide constant descriptors for vector and matrix inputs to support const-safe interface and guarantee that the APIs do not modify their inputs.
Generic Types Reference
The cuSPARSE generic type references are described in this section.
cusparseFormat_t
This type indicates the format of the sparse matrix. See cuSPARSE Storage Format for their description.
Value |
Meaning |
---|---|
|
The matrix is stored in Coordinate (COO) format organized in Structure of Arrays (SoA) layout |
|
The matrix is stored in Compressed Sparse Row (CSR) format |
|
The matrix is stored in Compressed Sparse Column (CSC) format |
|
The matrix is stored in Blocked-Ellpack (Blocked-ELL) format |
|
The matrix is stored in Sliced-Ellpack (Sliced-ELL) format |
|
The matrix is stored in Block Sparse Row (BSR) format |
cusparseOrder_t
This type indicates the memory layout of a dense matrix.
Value |
Meaning |
---|---|
|
The matrix is stored in row-major |
|
The matrix is stored in column-major |
cusparseIndexType_t
This type indicates the index type for representing the sparse matrix indices.
Value |
Meaning |
---|---|
|
32-bit signed integer [1, 2^31 - 1] |
|
64-bit signed integer [1, 2^63 - 1] |