Module backend

Module backend 

Source
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 via faer (default)
  • linalg-lapack: LAPACK + CBLAS backend with provider selection (provider-src or provider-inject)

Enabling both or neither is a compile error.

§Device backends

§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§

CpuTensorLinalgBackend
Marker type for the CPU tensor linalg backend.
CudaTensorLinalgBackend
Marker type for the CUDA tensor linalg backend.
EigTensorResult
Result of a tensor-level general eigendecomposition.
EigenTensorResult
Result of a tensor-level Hermitian eigendecomposition.
FaerBackend
Pure-Rust linear algebra backend powered by faer.
HipTensorLinalgBackend
Marker type for the HIP tensor linalg backend.
LuTensorResult
Result of a tensor-level LU factorization.
QrTensorResult
Result of a tensor-level QR decomposition.
SvdTensorResult
Result of a tensor-level thin SVD.

Enums§

LinalgCapabilityOp
Backend-facing tensor linalg protocol.

Traits§

LinalgBackend
Slice-level backend interface for matrix linear algebra operations.
TensorLinalgBackend
TensorLinalgContextFor
Maps a context type to its tensor-level linalg backend.