NVPL Sparse Types Reference

nvpl_sparse_data_type_t

The section describes the types used in NVPL Sparse. The nvpl_sparse_data_type_t type is an enumerator to specify the data precision. It is used when the data reference does not carry the type itself (e.g. void*). For example, it is used in the routine nvpl_sparse_spmv().

Value

Meaning

Data Type

Header

NVPL_SPARSE_R_32F

The data type is 32-bit IEEE-754 floating-point

float

NVPL_SPARSE_C_32F

The data type is 32-bit complex IEEE-754 floating-point

float _Complex

complex.h

NVPL_SPARSE_R_64F

The data type is 64-bit IEEE-754 floating-point

double

NVPL_SPARSE_C_64F

The data type is 64-bit complex IEEE-754 floating-point

double _Complex

complex.h

NVPL_SPARSE_R_8I

The data type is 8-bit integer

int8_t

stdint.h

NVPL_SPARSE_R_32I

The data type is 32-bit integer

int32_t

stdint.h

For C++ code, std::complex<float> and std::complex<double> in <complex> can be used.


nvpl_sparse_status_t

This data type represents the status returned by the library functions and it can have the following values:

Value

Description

NVPL_SPARSE_STATUS_SUCCESS

The operation completed successfully

NVPL_SPARSE_STATUS_NOT_INITIALIZED

The NVPL_SPARSE library was not initialized.

To correct: call nvpl_sparse_create() prior to the function call and the NVPL_SPARSE library are correctly installed

The error also applies to generic APIs ( Generic APIs reference) for indicating a matrix/vector descriptor not initialized

NVPL_SPARSE_STATUS_ALLOC_FAILED

Resource allocation failed inside the NVPL_SPARSE library. This is usually caused by a host memory allocation failure

To correct: prior to the function call, deallocate previously allocated memory as much as possible

NVPL_SPARSE_STATUS_INVALID_VALUE

An unsupported value or parameter was passed to the function (a negative vector size, for example)

To correct: ensure that all the parameters being passed have valid values

NVPL_SPARSE_STATUS_ARCH_MISMATCH

The function requires a feature absent from the processor architecture

To correct: compile and run the application on a processor with appropriate compute capability

NVPL_SPARSE_STATUS_EXECUTION_FAILED

The program failed to execute.

To correct: check that the hardware and the NVPL_SPARSE library are correctly installed

NVPL_SPARSE_STATUS_INTERNAL_ERROR

An internal NVPL_SPARSE operation failed

To correct: check that the hardware and the NVPL_SPARSE library are correctly installed. Also, check that the memory passed as a parameter to the routine is not being deallocated prior to the routine completion

NVPL_SPARSE_STATUS_MATRIX_TYPE_NOT_SUPPORTED

The matrix type is not supported by this function. This is usually caused by passing an invalid matrix descriptor to the function

To correct: check that the fields in nvpl_sparse_mat_descr_t descrA were set correctly

NVPL_SPARSE_STATUS_NOT_SUPPORTED

The operation or data type combination is currently not supported by the function

NVPL_SPARSE_STATUS_INSUFFICIENT_RESOURCES

The resources for the computation, such as memory, are not sufficient to complete the operation. The error can also indicate that the current computation mode (e.g., bit size of sparse matrix indices) does not allow to handle the given input


nvpl_sparse_handle_t

This is a pointer type to an opaque NVPL Sparse context, which the user must initialize by calling prior to calling nvpl_sparse_create() any other library function. The handle created and returned by nvpl_sparse_create() must be passed to every NVPL Sparse function.


nvpl_sparse_operation_t

This type indicates which operations is applied to the related input (e.g. sparse matrix, or vector).

Value

Meaning

NVPL_SPARSE_OPERATION_NON_TRANSPOSE

The non-transpose operation is selected.

NVPL_SPARSE_OPERATION_TRANSPOSE

The transpose operation is selected.

NVPL_SPARSE_OPERATION_CONJUGATE_TRANSPOSE

The conjugate transpose operation is selected.


nvpl_sparse_diag_type_t

This type indicates if the matrix diagonal entries are unity. The diagonal elements are always assumed to be present, but if NVPL_SPARSE_DIAG_TYPE_UNIT is passed to an API routine, then the routine assumes that all diagonal entries are unity and will not read or modify those entries. Note that in this case the routine assumes the diagonal entries are equal to one, regardless of what those entries are actually set to in memory.

Value

Meaning

NVPL_SPARSE_DIAG_TYPE_NON_UNIT

The matrix diagonal has non-unit elements.

NVPL_SPARSE_DIAG_TYPE_UNIT

The matrix diagonal has unit elements.


nvpl_sparse_fill_mode_t

This type indicates if the lower or upper part of a matrix is stored in sparse storage.

Value

Meaning

NVPL_SPARSE_FILL_MODE_LOWER

The lower triangular part is stored.

NVPL_SPARSE_FILL_MODE_UPPER

The upper triangular part is stored.


nvpl_sparse_index_base_t

This type indicates if the base of the matrix indices is zero or one.

Value

Meaning

NVPL_SPARSE_INDEX_BASE_ZERO

The base index is zero (C compatibility).

NVPL_SPARSE_INDEX_BASE_ONE

The base index is one (Fortran compatibility).