numerics 0.1.0
Loading...
Searching...
No Matches
policy.hpp File Reference

Backend enum for linear algebra operations. More...

Go to the source code of this file.

Namespaces

namespace  num
 

Enumerations

enum class  num::Backend {
  num::seq , num::blocked , num::simd , num::blas ,
  num::omp , num::gpu , num::lapack
}
 Selects which backend handles a linalg operation. More...
 

Variables

constexpr Backend num::seq = Backend::seq
 
constexpr Backend num::blocked = Backend::blocked
 
constexpr Backend num::simd = Backend::simd
 
constexpr Backend num::blas = Backend::blas
 
constexpr Backend num::omp = Backend::omp
 
constexpr Backend num::gpu = Backend::gpu
 
constexpr Backend num::lapack = Backend::lapack
 
constexpr bool num::has_blas
 True when a BLAS/cblas library was found at configure time.
 
constexpr bool num::has_lapack
 True when LAPACKE was found at configure time.
 
constexpr bool num::has_omp
 True when OpenMP was found at configure time.
 
constexpr bool num::has_simd
 True when a SIMD ISA was detected (AVX2 on x86-64, NEON on AArch64).
 
constexpr Backend num::default_backend
 
constexpr Backend num::best_backend = default_backend
 
constexpr Backend num::lapack_backend
 

Detailed Description

Backend enum for linear algebra operations.

Each module defines its own backend enum for the choices relevant to it. This enum covers linalg (vector, matrix, solvers, factorization, eigen, svd). Other modules define their own – e.g. spectral/ uses FFTBackend.

num::seq – naive serial C++ (always available) num::blocked – cache-blocked, no intrinsics (compiler auto-vectorizes) num::simd – hand-written SIMD (AVX2 on x86, NEON on AArch64) num::blas – cblas / LAPACKE (optional, NUMERICS_HAS_BLAS) num::omp – OpenMP parallel (optional, NUMERICS_HAS_OMP) num::gpu – CUDA (optional, NUMERICS_HAS_CUDA)

Definition in file policy.hpp.