Expand description
Matrix multiplication utilities with pluggable BLAS backend
This module provides thin wrappers around matrix multiplication operations, with support for runtime selection of BLAS implementations.
§Design
- Default: Pure Rust Faer backend (no external dependencies)
- Optional: External BLAS via function pointer injection
- Thread-safe: Global dispatcher protected by RwLock
§Example
ⓘ
use sparse_ir::gemm::{matmul_par, set_blas_backend};
// Use default Faer backend
let c = matmul_par(&a, &b);
// Or inject custom BLAS (from C-API)
unsafe {
set_blas_backend(my_dgemm_ptr, my_zgemm_ptr);
}
let c = matmul_par(&a, &b); // Now uses custom BLASStructs§
- External
Blas64 Backend - External BLAS backend (ILP64: 64-bit integers)
- External
Blas Backend - Conversion rules for row-major data to column-major BLAS:
- Gemm
Backend Handle - Thread-safe handle to a GEMM backend
Traits§
- Gemm
Backend - GEMM backend trait for runtime dispatch
Functions§
- clear_
blas_ backend - Clear BLAS backend (reset to default Faer)
- get_
backend_ info - Get current BLAS backend information
- matmul_
par - Parallel matrix multiplication: C = A * B
- matmul_
par_ overwrite - Parallel matrix multiplication with overwrite: C = A * B (writes to existing buffer)
- matmul_
par_ overwrite_ view - Parallel matrix multiplication with overwrite accepting DView (assumes contiguous memory)
- matmul_
par_ to_ viewmut - Parallel matrix multiplication with overwrite to mutable view: C = A * B
- matmul_
par_ view - Parallel matrix multiplication accepting DView (assumes contiguous memory)
- set_
blas_ ⚠backend - Set BLAS backend (LP64: 32-bit integers)
- set_
ilp64_ ⚠backend - Set ILP64 BLAS backend (64-bit integers)
Type Aliases§
- Dgemm64
FnPtr - BLAS dgemm function pointer type (ILP64: 64-bit integers)
- Dgemm
FnPtr - BLAS dgemm function pointer type (LP64: 32-bit integers)
- Zgemm64
FnPtr - BLAS zgemm function pointer type (ILP64: 64-bit integers)
- Zgemm
FnPtr - BLAS zgemm function pointer type (LP64: 32-bit integers)