Expand description
Backend abstraction for linear algebra operations.
This module provides both the slice-level LinalgBackend trait (used
internally by the CPU provider) and the tensor-level
TensorLinalgBackend trait (the public backend boundary).
§CPU provider selection
Exactly one of the following features must be enabled:
linalg-faer: Pure-Rust viafaer(default)linalg-lapack: LAPACK + CBLAS backend with provider selection (provider-srcorprovider-inject)
Enabling both or neither is a compile error.
§Device backends
- CPU:
CpuTensorLinalgBackendwithtenferro_prims::CpuContext - CUDA:
CudaTensorLinalgBackendwithtenferro_prims::CudaContext(stub) - HIP:
HipTensorLinalgBackendwithtenferro_prims::RocmContext(stub)
§Examples
ⓘ
use tenferro_linalg::backend::{TensorLinalgBackend, CpuTensorLinalgBackend};
use tenferro_tensor::Tensor;
let mut ctx = tenferro_prims::CpuContext::new(1);
let a: Tensor<f64> = todo!();
let b: Tensor<f64> = todo!();
let _x = <CpuTensorLinalgBackend as TensorLinalgBackend<f64>>::solve(&mut ctx, &a, &b).unwrap();Modules§
- tensor_
api - Tensor-level backend trait and result types for linalg decompositions.
- tensor_
context - Context-to-backend bridge trait for tensor linalg operations.
Structs§
- CpuTensor
Linalg Backend - Marker type for the CPU tensor linalg backend.
- Cuda
Tensor Linalg Backend - Marker type for the CUDA tensor linalg backend.
- EigTensor
Result - Result of a tensor-level general eigendecomposition.
- Eigen
Tensor Result - Result of a tensor-level Hermitian eigendecomposition.
- Faer
Backend - Pure-Rust linear algebra backend powered by faer.
- HipTensor
Linalg Backend - Marker type for the HIP tensor linalg backend.
- LuTensor
Result - Result of a tensor-level LU factorization.
- QrTensor
Result - Result of a tensor-level QR decomposition.
- SvdTensor
Result - Result of a tensor-level thin SVD.
Enums§
- Linalg
Capability Op - Backend-facing tensor linalg protocol.
Traits§
- Linalg
Backend - Slice-level backend interface for matrix linear algebra operations.
- Tensor
Linalg Backend - Tensor
Linalg Context For - Maps a context type to its tensor-level linalg backend.