AOCL-Sparse - 5.1 English - 68552

AOCL API Guide (68552)

Document ID
68552
Release Date
2025-05-02
Version
5.1 English

4. AOCL-Sparse#

4.1. Introduction#

The AMD Optimized CPU Library AOCL-Sparse is a library that contains Basic Linear Algebra Subroutines for sparse matrices and vectors (Sparse BLAS) and is optimized for AMD EPYC and RYZEN family of CPU processors. It implements numerical algorithms in C++ while providing a public-facing C interface so it is can be used with C, C++ and compatible languages.

The current functionality of AOCL-Sparse is organized in the following categories:

  • Sparse level 1 functions perform vector operations such as dot product, vector additions on sparse vectors, gather, scatter, and other similar operations.

  • Sparse level 2 functions describe the operations between a matrix in a sparse format and a vector in the dense format, including matrix-vector product (SpMV), triangular solve (TRSV) and similar.

  • Sparse level 3 functions describe the operations between a matrix in a sparse format and one or more dense/sparse matrices. The operations comprise of matrix additions (SpADD), matrix-matrix product (SpMM, Sp2M), and triangular solver with multiple right-hand sides (TRSM).

  • Iterative sparse solvers based on Krylov subspace methods (CGM, GMRES) and preconditioners (such as, SymGS, ILU0).

  • Sparse format conversion functions for translating matrices in a variety of sparse storage formats.

  • Auxiliary functions to allow basic operations, including create, copy, destroy and modify matrix handles and descriptors.

Additional highlights:

  • Supported data types: single, double, and the complex variants

  • 0-based and 1-based indexing of sparse formats

  • Hint and optimize framework to accelerate supported functions by a prior matrix analysis based on users’ hints of expected operations.

4.2. Naming convention#

API’s in the library are formed by three sections: aoclsparse prefix, P data type precision, followed by an abbreviated form of the functionality. Data type precion P is a single letter indicating: s single, d double, c complex single, and z complex double floating point. Some illustrative examples follow.

Table 4.1 API naming convention examples#

API

Precision P

Functionality

aoclsparse_strsv()

s

TRSV single precision linear system of equations TRiangular SolVer,

aoclsparse_daxpyi()

d

AXPY perform a variant of the operation \(a\,x+y\) in double precision,

aoclsparse_cmv()

c

SPMV sparse matrix-vector product using complex single precision,

aoclsparse_ztrsm()

z

TRSM complex double precision linear system of equations TRiangular Solver with Multiple right-hand sides.

Throughout this document and where not ambiguous, if an API supports two or more data types described above, then it will be indicated by ? (question mark) in place of the data type single-letter abbreviation. As an example, aoclsparse_?trsv() references all supported data types for the TRSV solver, that is, aoclsparse_strsv(), aoclsparse_dtrsv(), aoclsparse_ctrsv(), and aoclsparse_ztrsv(); while aoclsparse_?dotci() references only aoclsparse_cdotci(), and aoclsparse_zdotci().

Functionality API