Skip to main content

Crate aocl_sparse

Crate aocl_sparse 

Source
Expand description

Safe wrappers for AOCL-Sparse.

Modules§

complex
Complex-precision sparse operations (Complex32 / Complex64).

Structs§

Complex32
Single-precision complex number, ABI-compatible with the C struct { float real; float imag; } used by BLIS’s scomplex, LAPACK’s lapack_complex_float, and FFTW’s fftwf_complex.
Complex64
Double-precision complex number, ABI-compatible with the C struct { double real; double imag; } used by BLIS’s dcomplex, LAPACK’s lapack_complex_double, and FFTW’s fftw_complex.
IterSolver
RAII handle for the AOCL-Sparse iterative-solver suite.
MatDescr
RAII wrapper for aoclsparse_mat_descr.
SparseMatrix
RAII wrapper around an aoclsparse_matrix handle holding a CSR matrix.

Enums§

DiagType
Whether the diagonal of a triangular matrix is implicitly unit (Unit) or explicitly stored (NonUnit).
Error
Errors that can be returned by safe AOCL wrappers.
FillMode
Which triangle of a symmetric / triangular matrix is stored.
IndexBase
Index base for sparse-format index arrays.
MatType
Storage type of a sparse matrix’s nonzero pattern.
MemoryUsage
Memory-usage hint to give the analysis pass.
Order
Storage order used when converting from CSR to a dense matrix.
SorType
Sweep direction for sorv.
Stage
Stage of a multi-pass sparse-sparse matrix product (see csr2m).
Trans
How to interpret a matrix operand: as-is, transposed, or conjugate-transposed.

Traits§

Scalar
Scalar element type usable with the wrapped sparse routines.

Functions§

add
Compute C := α · op(A) + B returning a fresh sparse CSR matrix.
axpyi
Sparse y[indx] := α·x + y[indx] (sparse vector AXPY).
blkcsrmv_f64
Block-CSR mat-vec with a per-block bitmask. masks[i] is a u8 bit pattern indicating which rows of block i participate. n_rows_blk is the block height. (f64)
bsrmv
Compute y := α · op(A) · x + β · y for a BSR-format A.
copy_mat_descr
Make a deep copy of a MatDescr with the same options.
create_csc_f32
f32 CSC creator. See create_csc_f64.
create_csc_f64
Build a CSC matrix handle. Column-major analogue of CSR. (f64)
create_tcsr_f32
f32 TCSR creator. See create_tcsr_f64.
create_tcsr_f64
Build a TCSR matrix handle from two CSR sub-arrays describing the strict-lower (*_L) and strict-upper (*_U) parts. (f64)
csr2bsr_f32
f32 CSR → BSR. See csr2bsr_f64.
csr2bsr_f64
Convert CSR → BSR. Run csr2bsr_nnz first to size the output. (f64)
csr2bsr_nnz
Compute the number of nonzero blocks (bsr_nnz) and bsr_row_ptr for a CSR → BSR conversion with the given block_dim.
csr2dia_f32
f32 CSR → DIA. See csr2dia_f64.
csr2dia_f64
Convert CSR → DIA (diagonal storage). dia_offset and dia_val must be pre-allocated; dia_num_diag is the number of distinct diagonals. (f64)
csr2ell_f32
f32 CSR → ELLPACK. See csr2ell_f64.
csr2ell_f64
Convert CSR → ELLPACK. ell_width is the chosen padded row length; caller must allocate ell_col_ind and ell_val of size m * ell_width. (f64)
csr2m
Compute C := op_A(A) · op_B(B) between two CSR matrices, returning a freshly allocated CSR result. Both inputs must have matching scalar precision; complex precisions are not yet exposed by these wrappers.
csr_to_csc
Convert a CSR matrix to CSC. Output arrays must be pre-sized.
csr_to_dense
Convert a CSR sparse matrix to a dense m × n matrix in out.
csrmm
Compute C := α · op(A) · B + β · C where A is sparse (CSR via the matrix handle) and B, C are dense matrices laid out per order.
csrmv
Compute y := α · A · x + β · y for a CSR matrix A.
csrsv
Solve op(A) · y = α · x where A is sparse triangular in CSR format. The triangle is determined by the descr’s fill mode (set via the aoclsparse_set_mat_* C-API; defaults to upper, non-unit).
doti_f32
f32 sparse dot. See doti_f64.
doti_f64
Sparse vector dot product: Σᵢ x[i] · y[indx[i]]. x and indx must have the same length (the nnz count).
dotmv_f32
f32 fused dot + mat-vec. See dotmv_f64.
dotmv_f64
Fused dot product and mat-vec: y := α · op(A) · x + β · y and d := xᵀ · y (or d := xᴴ · y for complex). Saves one pass over the matrix versus calling mv then dot separately. (f64)
ellmv
Compute y := α · op(A) · x + β · y for an ELLPACK-format A.
gthr
Sparse gather: x[i] := y[indx[i]] for i ∈ [0, nnz).
gthrs_f32
f32 strided gather. See gthrs_f64.
gthrs_f64
Strided sparse gather: x[i] := y[i · stride] for i ∈ [0, nnz). (f64)
gthrz_f32
f32 gather-and-zero. See gthrz_f64.
gthrz_f64
Gather-and-zero: copy y[indx[i]] into x[i] and zero the source. (f64)
ilu_smoother
Apply one ILU(0) smoothing step in-place to x, with right-hand side b.
mv_f32
f32 mat-vec via the matrix-handle interface. See mv_f64.
mv_f64
Real high-level mat-vec y := α · op(A) · x + β · y against a SparseMatrix<f64> handle (per-precision; complex variants live in the complex submodule).
optimize
Run AOCL-Sparse’s analysis / optimization step on a matrix handle. Use this after declaring hints (e.g. set_mv_hint) to let the library choose specialised kernels for repeated operations.
roti_f32
f32 sparse rotation. See roti_f64.
roti_f64
Sparse rotation: simultaneously rotate (x, y) at indices indx by (c, s). x is sparse with indx indices into the dense y. (f64)
sctr
Sparse scatter: y[indx[i]] := x[i] for i ∈ [0, nnz).
sctrs_f32
f32 strided scatter. See sctrs_f64.
sctrs_f64
Strided sparse scatter: y[i · stride] := x[i]. (f64)
set_memory_hint
Tell the library how much extra memory it may consume on this matrix. Pair with optimize.
set_value_f32
f32 set_value. See set_value_f64.
set_value_f64
Set a single value at (row_idx, col_idx) in a CSR matrix handle. Element must already exist in the sparsity pattern. (f64)
sorv
One step of (S)SOR / forward / backward Gauss-Seidel relaxation: x_new := (1 − ω) x + ω · A⁻¹ (α · b). Useful as a smoother inside iterative-solver loops.
sorv_f32
f32 SOR / forward / backward Gauss-Seidel sweep. The existing generic sorv dispatches to this via the Scalar trait; this is a per-precision direct alias.
sp2md
Compute C := α · op_A(A) · op_B(B) + β · C where both A and B are sparse and C is dense.
spmmd
Compute C := op(A) · B where both A and B are sparse and C is a dense matrix. ldc is the leading dimension of C per layout.
symgs_f32
f32 symmetric Gauss-Seidel. See symgs_f64.
symgs_f64
Symmetric Gauss-Seidel sweep x := x + α · D⁻¹ (b − A·x) against a symmetric matrix handle. (f64)
symgs_mv_f32
f32 fused symmetric Gauss-Seidel + mat-vec. See symgs_mv_f64.
symgs_mv_f64
Fused Gauss-Seidel + matrix-vector: produces both the updated x and y := A·x in one pass. (f64)
syprd_f32
f32 symmetric triple product. See syprd_f64.
syprd_f64
Symmetric triple product from a sparse A and dense B: C := α · op(A) · B · op(A)ᵀ + β · C. (f64)
syrkd_f32
f32 symmetric rank-k update from sparse A. See syrkd_f64.
syrkd_f64
Symmetric rank-k update from a sparse matrix: C := α · op(A) · op(A)ᵀ + β · C (real) / C := α · op(A) · op(A)ᴴ + β · C (complex). C is dense. (f64)
trsm_f32
f32 multi-RHS triangular solve. See trsm_f64.
trsm_f64
Multi-RHS triangular solve: op(A) · X = α · B for n_rhs right-hand sides, B/X dense m × n_rhs.
trsv_f32
f32 triangular solve. See trsv_f64.
trsv_f64
Solve op(A) · x = α · b for sparse triangular A against a SparseMatrix<f64> handle. The fill mode and unit/non-unit diag must be set on descr first.
update_values_f32
f32 update_values. See update_values_f64.
update_values_f64
Update the values array of a CSR handle without rebuilding. len = nnz; the new values must respect the existing sparsity pattern. (f64)
version
AOCL-Sparse library version string (e.g. "AOCL-Sparse 5.1.0").

Type Aliases§

Result
Crate result alias — used by every aocl-* safe wrapper crate.