AOCL-Sparse Types - AOCL-Sparse Types - 5.0 English - 63865

AOCL Sparse Library (63865)

Document ID
63865
Release Date
2024-10-09
Version
5.0 English

AOCL-Sparse Types#

Numerical types#

typedef int32_t aoclsparse_int#

Specifies the size in bits of integer type to be used.

Typedef used to define the integer type this can be either 32-bit or 64-bit interger type.

This is determined at compile-time and can be specified using the CMake option

-DBUILD_ILP64=On|Off

Setting to On will use use 64-bit integer data type.
struct aoclsparse_float_complex#

Default complex float type.

User can redefine to accomodate custom complex float type definition.

Note

The library expects that complex numbers real and imaginary parts are contiguous in memory.

Public Members

float real#

Real part.

float imag#

Imaginary part.

struct aoclsparse_double_complex#

Default complex double type.

User can redefine to accomodate custom complex double type definition.

Note

The library expects that complex numbers real and imaginary parts are contiguous in memory.

Public Members

double real#

Real part.

double imag#

Imaginary part.

Matrix object and descriptor#

typedef struct _aoclsparse_matrix *aoclsparse_matrix#

Matrix object.

This structure holds the matrix data. It is initialized using e.g. aoclsparse_create_scsr (or other variants, see table bellow). The returned matrix object needs be passed to all subsequent library calls that involve the matrix. It should be destroyed at the end using aoclsparse_destroy.

Initialization of matrix objects.#

Storage

Precision P

Initialization function

Compressed Sparse Rows (CSR)

s, d, c, z

aoclsparse_create_Pcsr

Compressed Sparse Columns (CSC)

s, d, c, z

aoclsparse_create_Pcsc

Coordinate storage (COO)

s, d, c, z

aoclsparse_create_Pcoo

Triangular Compressed Sparse Rows (TCSR)

s, d, c, z

aoclsparse_create_Ptcsr

typedef struct _aoclsparse_mat_descr *aoclsparse_mat_descr#

Matrix object descriptor.

This structure holds properties describing a matrix and how to access its data. It must be initialized using aoclsparse_create_mat_descr and the returned descriptor object is passed to all subsequent library calls that involve the matrix. It is destroyed by using aoclsparse_destroy_mat_descr.

Enums#

Function return status#

enum aoclsparse_status#

Values returned by the library API to indicate success or failure.

This table provides a brief explanation on the reason why a function call failed. It is strongly encouraged during the development cycle of applications or services to check the exit status of any call.

Values:

enumerator aoclsparse_status_success#

success.

enumerator aoclsparse_status_not_implemented#

functionality is not implemented.

enumerator aoclsparse_status_invalid_pointer#

invalid pointer parameter.

enumerator aoclsparse_status_invalid_size#

invalid size parameter.

enumerator aoclsparse_status_internal_error#

internal library failure.

enumerator aoclsparse_status_invalid_value#

invalid parameter value.

enumerator aoclsparse_status_invalid_index_value#

invalid index value.

enumerator aoclsparse_status_maxit#

function stopped after reaching number of iteration limit.

enumerator aoclsparse_status_user_stop#

user requested termination.

enumerator aoclsparse_status_wrong_type#

function called on the wrong type (double/float).

enumerator aoclsparse_status_memory_error#

memory allocation failure.

enumerator aoclsparse_status_numerical_error#

numerical error, e.g., matrix is not positive definite, divide-by-zero error

enumerator aoclsparse_status_invalid_operation#

cannot proceed with the request at this point.

enumerator aoclsparse_status_unsorted_input#

the input matrices are not sorted

enumerator aoclsparse_status_invalid_kid#

user requested kernel id was not available.

Associated with aoclsparse_matrix#

enum aoclsparse_matrix_data_type#

Specify the matrix data type.

Values:

enumerator aoclsparse_dmat#

double precision data.

enumerator aoclsparse_smat#

single precision data.

enumerator aoclsparse_cmat#

single precision complex data.

enumerator aoclsparse_zmat#

double precision complex data.

See also:

Associated with matrix descriptor (aoclsparse_mat_descr)#

enum aoclsparse_matrix_type#

Specify the matrix type.

Specifies the type of a matrix. A matrix object descriptor describes how to interpret the type of the matrix. The data in the matrix object need not match the type in the matrix object descriptor. It can be set using aoclsparse_set_mat_type and retrieved using aoclsparse_get_mat_type.

Values:

enumerator aoclsparse_matrix_type_general#

general matrix, no special pattern.

enumerator aoclsparse_matrix_type_symmetric#

symmetric matrix, \( A=A^T\). It stores only a single triangle specified using aoclsparse_fill_mode.

enumerator aoclsparse_matrix_type_hermitian#

hermitian matrix, \( A=A^H\). Same storage comment as for the symmetric case.

enumerator aoclsparse_matrix_type_triangular#

triangular matrix, \( A=\text{tril}(A) \) or \( A=\text{triu}(A). \) Here too, aoclsparse_fill_mode specifies which triangle is available.

enum aoclsparse_index_base#

Specify the matrix index base.

Indicate the base used on the matrix indices, either 0-base (C, C++) or 1-base (Fortran). The base is set using aoclsparse_set_mat_index_base. The current of a matrix object can be obtained by calling aoclsparse_get_mat_index_base.

Note

The base-indexing information is stored in two distinc locations: the matrix object aoclsparse_matrix and the matrix object descriptior aoclsparse_mat_descr, these must coincide, either be both zero or both one. Any function accepting both objects will fail if these do not match.

Values:

enumerator aoclsparse_index_base_zero#

zero based indexing, C/C++ indexing.

enumerator aoclsparse_index_base_one#

one based indexing, Fortran indexing.

enum aoclsparse_diag_type#

Indicates how to interpret the diagonal entries of a matrix.

Used to indicate how to use the diagonal elements of a matrix. The purpose of this is to optimize certain operations inside the kernels. If the diagonal elements are not stored but should be interpreted has being all ones, then this can accelerate the operation by avoiding unnecessary memory accesses. For a given aoclsparse_mat_descr, the diagonal type can be set using aoclsparse_set_mat_diag_type and can be retrieved by calling aoclsparse_get_mat_diag_type.

Values:

enumerator aoclsparse_diag_type_non_unit#

diagonal entries are present and arbitrary.

enumerator aoclsparse_diag_type_unit#

diagonal entries are to be considered all ones. Kernels will not access the diagonal elements in the matrix data.

enumerator aoclsparse_diag_type_zero#

ignore diagonal entries: for specifying strict lower or upper triangular matrices.

enum aoclsparse_fill_mode#

Specify the matrix fill mode.

Indicates if the lower or the upper part of a triangular or symmetric matrix is stored. The fill mode can be set using aoclsparse_set_mat_fill_mode, and can be retrieved by calling aoclsparse_get_mat_fill_mode.

Values:

enumerator aoclsparse_fill_mode_lower#

lower triangular part is stored.

enumerator aoclsparse_fill_mode_upper#

upper triangular part is stored.

enum aoclsparse_order#

Specify the memory layout (order) used to store a dense matrix.

Values:

enumerator aoclsparse_order_row#

Row major, (C/C++ storage).

enumerator aoclsparse_order_column#

Column major, (Fortran storage).

Miscellaneous#

enum aoclsparse_operation#

Indicate the operation type performed on a matrix.

Values:

enumerator aoclsparse_operation_none#

No operation is performed on the matrix.

enumerator aoclsparse_operation_transpose#

Operate with transpose.

enumerator aoclsparse_operation_conjugate_transpose#

Operate with conjugate transpose.

typedef struct _aoclsparse_itsol_handle *aoclsparse_itsol_handle#

Optimization handle.

This type of handle is a container box for storing problem data and optional parameter values. it must be initialized using aoclsparse_itsol_s_init, and should be destroyed after using it with aoclsparse_itsol_destroy. For double precision data types use aoclsparse_itsol_d_init.

For more details, refer to Solver chapter introduction Iterative Solver Suite (itsol).

enum aoclsparse_ilu_type#

Specify the type of Incomplete LU (ILU) factorization.

Indicates the type of factorization to perform.

Values:

enumerator aoclsparse_ilu0#

Incomplete LU with zero fill-in, ILU(0).

enumerator aoclsparse_ilup#

Incomplete LU with thresholding, ILU(p). Not implemented in this release.

enum aoclsparse_request#

Request stages for API that perform sparse matrix products.

This list describes the possible request types used by matrix product kernels such as aoclsparse_csr2m.

Values:

enumerator aoclsparse_stage_nnz_count#

Perform only first stage of analysis and computation. No result is returned but it is useful when optimizing for multiple calls.

enumerator aoclsparse_stage_finalize#

Perform computation. After this stage the product result is returned. Needs to follow after a call with aoclsparse_stage_nnz_count request.

enumerator aoclsparse_stage_full_computation#

Indicates to perform the entire computation in a single call.

enum aoclsparse_sor_type#

List of successive over-relaxation types.

This is a list of supported SOR types that are supported by aoclsparse_dsorv (or other variants function).

Values:

enumerator aoclsparse_sor_forward#

Forward sweep.

enumerator aoclsparse_sor_backward#

Backward sweep.

enumerator aoclsparse_sor_symmetric#

Symmetric preconditioner.

enum aoclsparse_memory_usage#

List of memory utilization policy.

This is a list of supported aoclsparse_memory_usage() types that are used by optimization routine.

Values:

enumerator aoclsparse_memory_usage_minimal#

Allocate memory only for auxiliary structures.

enumerator aoclsparse_memory_usage_unrestricted#

Allocate memory upto matrix size for appropriate sparse format conversion. Default value.