NVPL Sparse Generic APIs#

  • The Generic APIs provide the standard interface layer of NVPL Sparse. They 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 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 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 NVPL Sparse generic type references are described in this section.

nvpl_sparse_format_t#

This type indicates the format of the sparse matrix. See NVPL Sparse Storage Format for their description.

Value

Meaning

NVPL_SPARSE_FORMAT_COO

The matrix is stored in Coordinate (COO) format organized in Structure of Arrays (SoA) layout

NVPL_SPARSE_FORMAT_CSR

The matrix is stored in Compressed Sparse Row (CSR) format

NVPL_SPARSE_FORMAT_CSC

The matrix is stored in Compressed Sparse Column (CSC) format

NVPL_SPARSE_FORMAT_SLICED_ELL

The matrix is stored in Sliced-Ellpack (Sliced-ELL) format


nvpl_sparse_order_t#

This type indicates the memory layout of a dense matrix.

Value

Meaning

NVPL_SPARSE_ORDER_ROW

The matrix is stored in row-major

NVPL_SPARSE_ORDER_COL

The matrix is stored in column-major


nvpl_sparse_index_type_t#

This type indicates the index type for representing the sparse matrix indices.

Value

Meaning

NVPL_SPARSE_INDEX_32I

32-bit signed integer [1, 2^31 - 1]

NVPL_SPARSE_INDEX_64I

64-bit signed integer [1, 2^63 - 1]