Enumerations and scalar concepts

Overview

Transpose, Uplo, Side, Diag, Backend and the scalar concepts that constrain every template.

String conversions and other helpers: Enumerations: helpers.

Types

◆ float_t

template<typename T>
using batchlas::float_t = typename base_type<T>::type

Shorthand for base_type<T>::type: the precision of T (tolerances, norms, eigenvalues).

Definition at line 41 of file enums.hh.

Enumerations

◆ MatrixFormat

enum class batchlas::MatrixFormat
strong

Storage format of a Matrix / MatrixView, used as a template argument.

Only Dense and CSR have storage implementations; the other enumerators name formats and are not instantiated by the library.

See also
Matrix model
Enumerator
Dense 

Column-major dense storage with leading dimension and batch stride.

CSR 

Compressed Sparse Row.

CSC 

Compressed Sparse Column.

COO 

Coordinate.

SELL 

Sliced ELLPACK.

BSR 

Blocked Sparse Row.

BLOCKED_ELL 

Blocked ELLPACK.

Definition at line 72 of file enums.hh.

◆ Backend

enum class batchlas::Backend
strong

Library family an entry point dispatches to, used as a template argument.

Callers normally do not spell it: the queue-taking entry points take the backend from the batchlas::Queue (Queue::backend(), Queue::set_backend()). Only the backends compiled into the build (BATCHLAS_HAS_*_BACKEND) are available; Queue::backend_available() reports which.

Enumerator
AUTO 

A request, not a backend: the Queue resolves it from its device on first query.

CUDA 

NVIDIA GPU: cuBLAS / cuSOLVER / cuSPARSE and the native SYCL kernels.

ROCM 

AMD GPU: rocBLAS / rocSOLVER / rocSPARSE and the native SYCL kernels.

MKL 

Reserved; no dispatch target, never available.

MAGMA 

Reserved; no dispatch target, never available.

SYCL 

Native SYCL kernels on a GPU with no vendor library (AdaptiveCpp Metal); float and complex<float> only unless the build has device fp64 (BATCHLAS_HAS_DEVICE_FP64).

NETLIB 

Host CBLAS / LAPACKE; the fallback for any device.

Definition at line 111 of file enums.hh.

◆ BackendLibrary

enum class batchlas::BackendLibrary
strong

A vendor library inside a Backend; selects library-specific type and handle mappings.

Enumerator
CUBLAS 

Backend::CUDA.

CUSPARSE 

Backend::CUDA.

CUSOLVER 

Backend::CUDA.

ROCBLAS 

Backend::ROCM.

ROCSPARSE 

Backend::ROCM.

ROCSOLVER 

Backend::ROCM.

MAGMA 

Backend::MAGMA.

MKL 

Backend::MKL.

CBLAS 

Backend::NETLIB.

LAPACKE 

Backend::NETLIB.

Definition at line 139 of file enums.hh.

◆ Transpose

enum class batchlas::Transpose
strong

The operator op() applied to an operand: op(A) = A, A^T or A^H.

Enumerator
NoTrans 

op(A) = A.

Trans 

op(A) = A^T.

ConjTrans 

op(A) = A^H (the same as Trans for real scalars).

Definition at line 171 of file enums.hh.

◆ JobType

enum class batchlas::JobType
strong

Whether an eigensolver computes eigenvectors (LAPACK jobz).

Enumerator
EigenVectors 

Eigenvalues and eigenvectors (jobz = 'V').

NoEigenVectors 

Eigenvalues only (jobz = 'N').

Definition at line 189 of file enums.hh.

◆ SvdVectors

enum class batchlas::SvdVectors
strong

Which singular vectors gesvd computes for one factor (LAPACK jobu / jobvt).

For an m x n input with k = min(m, n):

Value LAPACK U V^H
None 'N' not computed; its MatrixView is not touched same
All 'A' m x m n x n
Thin 'S' m x k, the first k left vectors k x n, the first k right vectors, conjugated

Thin and All differ on at most one side: for m <= n a thin U is the full U, for m >= n a thin V^H is the full V^H, and for square input they coincide on both. Entry points canonicalise with canonical_jobu() / canonical_jobvh(). LAPACK's 'O' (overwrite A) is not offered.

See also
gesvd design
Enumerator
None 

Do not compute this factor.

All 

Full square factor (LAPACK 'A').

Thin 

Economy factor with k = min(m, n) vectors (LAPACK 'S').

Definition at line 220 of file enums.hh.

◆ Uplo

enum class batchlas::Uplo
strong

Which triangle of a symmetric, Hermitian or triangular operand is referenced.

Trap
In an option struct write PotrfOptions{}, never a bare {}: {} can select the positional overload, whose Uplo{} is Upper.
Enumerator
Upper 

The upper triangle (i <= j).

Lower 

The lower triangle (i >= j).

Definition at line 287 of file enums.hh.

◆ Diag

enum class batchlas::Diag
strong

Whether a triangular operand's diagonal is read or assumed to be one.

Enumerator
NonUnit 

The stored diagonal is used.

Unit 

The diagonal is taken as 1 and not read.

Definition at line 303 of file enums.hh.

◆ Side

enum class batchlas::Side
strong

Side on which a special operand multiplies: op(A) * B or B * op(A).

Enumerator
Left 

The special operand is on the left.

Right 

The special operand is on the right.

Definition at line 319 of file enums.hh.

◆ SortOrder

enum class batchlas::SortOrder
strong

Order in which eigenvalues (and their vectors) are returned.

Enumerator
Ascending 

Smallest first.

Descending 

Largest first.

Definition at line 335 of file enums.hh.

◆ ApplyOrder

enum class batchlas::ApplyOrder
strong

Order in which a sequence of plane rotations is applied (steqr sweeps).

Enumerator
Forward 

First rotation first (a QR sweep).

Backward 

Last rotation first (a QL sweep).

Definition at line 351 of file enums.hh.

◆ SyevxAlgorithm

enum class batchlas::SyevxAlgorithm
strong

Algorithm family of the partial symmetric/Hermitian eigensolver syevx.

Auto picks on matrix format, n, batch size and jobz; the number of requested eigenpairs enters no threshold (syevx_select_algorithm). Set per call through SyevxParams::method, or process-wide through BATCHLAS_SYEVX_ALGORITHM (auto|direct|direct_subset|filtered|lobpcg). The environment variable wins over SyevxParams::method, as a BATCHLAS_<OP>_ROUTE kernel pin does for the other ops, so a whole application can be forced onto one algorithm for diagnosis.

A choice the input cannot use degrades instead of failing: DirectSubset on complex or sparse input runs Direct (dense) or LOBPCG (CSR), and Direct or DirectSubset on CSR runs LOBPCG. A non-extremal SyevxSelect range is never degraded to a different part of the spectrum: on CSR input, or with an explicit LOBPCG or Filtered, it throws batchlas::invalid_argument (under the environment override the dense case runs Direct instead). syevx and syevx_buffer_size resolve the choice identically.

See also
SYEVX for the routing thresholds, syevx: design of the partial symmetric eigensolver for the tiers.
Enumerator
Auto 

Heuristic selection on format, n, batch size and jobz (the default).

Direct 

Full syev on a copy of A, then select the requested eigenpairs.

DirectSubset 

Two-stage reduction, bisection + inverse iteration on the subset (real, dense).

Filtered 

Chebyshev-filtered subspace iteration (dense and CSR); only when asked for.

LOBPCG 

Locally Optimal Block Preconditioned Conjugate Gradient; the CSR default.

Definition at line 383 of file enums.hh.

◆ SyevxSelect

enum class batchlas::SyevxSelect
strong

Which part of the spectrum syevx returns.

Extremal (the default) returns neigs eigenpairs from one end, chosen by SyevxParams::find_largest: descending for the largest, ascending for the smallest. It is the Index range [n-neigs, n-1] or [0, neigs-1] and is normalised to one internally.

Note
Deliberately not EigenRangeType, whose natural default All means "every eigenvalue"; that type stays the tridiagonal-layer vocabulary.
See also
syevx range selection: design record
Enumerator
Extremal 

neigs eigenpairs from one end; SyevxParams::find_largest picks the end.

Index 

SyevxParams::il .. iu inclusive, 0-based in the ascending spectrum.

Value 

Every eigenvalue in the half-open interval (vl, vu].

Definition at line 414 of file enums.hh.

◆ OrthoAlgorithm

enum class batchlas::OrthoAlgorithm
strong

Algorithm used by ortho to orthonormalise the columns of a batch of blocks.

Enumerator
Chol2 

CholeskyQR applied twice; the default.

Cholesky 

One CholeskyQR pass; rarely accurate enough on its own.

ShiftChol3 

Shifted CholeskyQR3; more robust than Chol2 on ill-conditioned blocks.

Householder 

Householder QR.

CGS2 

Classical Gram-Schmidt with one reorthogonalisation pass.

SVQB 

SVQB (orthonormalisation through the Gram matrix's eigendecomposition).

SVQB2 

SVQB applied twice.

NUM_ALGORITHMS 

Count of the enumerators above, not an algorithm.

Definition at line 471 of file enums.hh.

◆ ComputePrecision

enum class batchlas::ComputePrecision
strong

Internal compute precision of a GEMM (the cuBLAS cublasComputeType_t).

Anything but Default is served only by the vendor library: the native GEMM kernels do not support it. On cuBLAS, a single-precision scalar accepts F32, F16, BF16 and TF32, a double-precision scalar only F64; any other combination throws batchlas::unsupported.

Enumerator
Default 

The precision of the scalar type.

F32 

32-bit float accumulation.

F64 

64-bit float accumulation.

F16 

Half-precision inputs, 32-bit accumulation (CUBLAS_COMPUTE_32F_FAST_16F).

BF16 

bfloat16 inputs, 32-bit accumulation (CUBLAS_COMPUTE_32F_FAST_16BF).

TF32 

TensorFloat-32 inputs, 32-bit accumulation (CUBLAS_COMPUTE_32F_FAST_TF32).

Definition at line 505 of file enums.hh.

◆ VectorOrientation

enum class batchlas::VectorOrientation
strong

How a VectorView is reinterpreted as a MatrixView: 1 x n or n x 1.

Enumerator
Row 

A 1 x n matrix; ld is the vector's inc.

Column 

An n x 1 matrix; requires inc == 1.

Definition at line 529 of file enums.hh.

◆ NormType

enum class batchlas::NormType
strong

Matrix norm computed by norm and used by the condition estimators.

Enumerator
Frobenius 

sqrt(sum |a_ij|^2).

One 

Maximum absolute column sum.

Inf 

Maximum absolute row sum.

Max 

Maximum absolute entry (not a consistent norm).

Spectral 

Largest singular value; symmetric/Hermitian input only.

Definition at line 545 of file enums.hh.

◆ Layout

enum class batchlas::Layout
strong

Storage order argument of the host CBLAS / LAPACKE calls.

BatchLAS matrices are always column-major; this only labels host-library calls.

See also
Matrix model
Enumerator
RowMajor 

Row-major (CblasRowMajor).

ColMajor 

Column-major (CblasColMajor).

Definition at line 570 of file enums.hh.

Variables

◆ is_std_complex_v

template<typename T>
bool batchlas::is_std_complex_v = is_std_complex<T>::value
inlineconstexpr

Value of is_std_complex<T>.

Definition at line 53 of file enums.hh.

Topics

 Enumerations: helpers
 String conversions and shape helpers for the enumerations.

Concepts

concept  batchlas::RealScalar
 A real floating-point scalar (float, double).
concept  batchlas::ComplexScalar
 A std::complex scalar (std::complex<float>, std::complex<double>).
concept  batchlas::FloatingOrComplexScalar
 Any scalar the numerical entry points accept: real or complex floating point.
concept  batchlas::DenseMatrixFormat
 Constrains a member or overload to dense storage.
concept  batchlas::CsrMatrixFormat
 Constrains a member or overload to CSR storage.

Classes

struct  batchlas::base_type< T >
 Real type underlying a scalar: T itself for a real T, R for std::complex<R>. More...
struct  batchlas::base_type< std::complex< T > >
 Specialisation that strips std::complex. More...
struct  batchlas::is_std_complex< T >
 True for std::complex<R>, false otherwise. More...
struct  batchlas::is_std_complex< std::complex< T > >
 Specialisation for std::complex<R>. More...