Option structs

Overview

Designated-initialiser option structs accepted by the entry points.

Each entry point here takes its non-matrix arguments as one designated-initialiser struct, so a call names only what differs from the defaults:

gemm(ctx, A, B, C, {.alpha = 2.0f, .transA = Transpose::Trans});
syev(ctx, A, W, {.jobz = JobType::NoEigenVectors});
Event gemm(Queue &ctx, const MatrixView< T, MatrixFormat::Dense > &A, const MatrixView< T, MatrixFormat::Dense > &B, const MatrixView< T, MatrixFormat::Dense > &C, T alpha, T beta, Transpose transA, Transpose transB, ComputePrecision precision=ComputePrecision::Default)
Batched general matrix-matrix multiply.
Event syev(Queue &ctx, const MatrixView< T, MatrixFormat::Dense > &descrA, Span< typename base_type< T >::type > eigenvalues, JobType jobtype, Uplo uplo, Span< std::byte > workspace, Span< int32_t > info)
Eigenvalues, and optionally eigenvectors, of a batch of symmetric/Hermitian matrices (LAPACK ?...
@ NoEigenVectors
Eigenvalues only (jobz = 'N').
Definition enums.hh:191
@ Trans
op(A) = A^T.
Definition enums.hh:173

Every overload comes twice: f(ctx, ...) takes the backend from the Queue and checks that pointer arguments are device-accessible; f<Backend>(ctx, ...) fixes it at compile time. T is always deduced from the matrix arguments, never from the option struct. Matrix arguments may be Matrix or MatrixView.

The LAPACK-style calls (potrf, getrf, getrs, getri, geqrf, orgqr, syev, ormqr, gesvd) come with and without a Span<std::byte> ws argument. Without it, scratch is leased from the Queue's arena, sized by the matching *_buffer_size; on an out-of-order queue releasing the lease drains the queue, so pass your own span there to stay asynchronous. Every option overload, both spellings, with and without ws, checks shapes (squareness, matching rows and batch sizes, minimum span lengths) and throws batchlas::invalid_argument on a violation; only the deducing spelling also checks pointers. The ordinary spelling with non-const lvalue arguments can resolve to the queue-dispatch overload, which lands on the f<Backend> form, so that form must check too.

Every uplo defaults to Uplo::Lower. With an explicit workspace, write PotrfOptions{}, never a bare {}.

The *Params structs of blas/extensions.hh are ordinary trailing arguments, not option structs; see docs/cpp-api.md. Design notes: API conventions.

Functions

◆ gemm() [1/2]

template<Backend Back, detail::DenseMatrixLike MA, detail::DenseMatrixLike MB, detail::DenseMatrixLike MC, typename T = detail::dense_scalar_t<MA>>
Event batchlas::gemm ( Queue & ctx,
const MA & A,
const MB & B,
const MC & C,
const GemmOptions< T > & opts )
inline

gemm with a compile-time backend; same contract as the Queue-deducing overload, without the pointer check.

Template Parameters
Backbackend to run on

Definition at line 278 of file options.hh.

◆ gemm() [2/2]

template<detail::DenseMatrixLike MA, detail::DenseMatrixLike MB, detail::DenseMatrixLike MC, typename T = detail::dense_scalar_t<MA>>
Event batchlas::gemm ( Queue & ctx,
const MA & A,
const MB & B,
const MC & C,
const GemmOptions< T > & opts )
inline

Batched matrix product \(C_i := \alpha\,\mathrm{op}(A_i)\,\mathrm{op}(B_i) + \beta C_i\).

A batch whose items carry differing active extents is handled natively.

Template Parameters
MA,MB,MCMatrix or MatrixView, dense; T is deduced from A
Parameters
ctxqueue; supplies the backend
Aop(A) is m x k per item
Bop(B) is k x n per item
Cm x n per item; read when beta != 0, overwritten
optsalpha, beta, transA, transB, precision
Returns
event of the last enqueued kernel
Precondition
all operands have the same batch size
Exceptions
std::invalid_argumentif a pointer is not reachable from the queue's device

Definition at line 298 of file options.hh.

◆ gemv() [1/2]

template<Backend Back, detail::DenseMatrixLike MA, typename T = detail::dense_scalar_t<MA>>
Event batchlas::gemv ( Queue & ctx,
const MA & A,
const VectorView< T > & x,
const VectorView< T > & y,
const GemvOptions< T > & opts )
inline

gemv with a compile-time backend; same contract as the Queue-deducing overload, without the pointer check.

Template Parameters
Backbackend to run on

Definition at line 308 of file options.hh.

◆ gemv() [2/2]

template<detail::DenseMatrixLike MA, typename T = detail::dense_scalar_t<MA>>
Event batchlas::gemv ( Queue & ctx,
const MA & A,
const VectorView< T > & x,
const VectorView< T > & y,
const GemvOptions< T > & opts )
inline

Batched matrix-vector product \(y_i := \alpha\,\mathrm{op}(A_i)\,x_i + \beta y_i\).

Parameters
ctxqueue; supplies the backend
Aop(A) is m x n per item
xlength n per item
ylength m per item; overwritten
optsalpha, beta, transA
Returns
event of the last enqueued kernel
Exceptions
std::invalid_argumentif a pointer is not reachable from the queue's device

Definition at line 323 of file options.hh.

◆ symm() [1/2]

template<Backend Back, detail::DenseMatrixLike MA, detail::DenseMatrixLike MB, detail::DenseMatrixLike MC, typename T = detail::dense_scalar_t<MA>>
Event batchlas::symm ( Queue & ctx,
const MA & A,
const MB & B,
const MC & C,
const SymmOptions< T > & opts )
inline

symm with a compile-time backend; same contract as the Queue-deducing overload, without the pointer check.

Template Parameters
Backbackend to run on

Definition at line 335 of file options.hh.

◆ symm() [2/2]

template<detail::DenseMatrixLike MA, detail::DenseMatrixLike MB, detail::DenseMatrixLike MC, typename T = detail::dense_scalar_t<MA>>
Event batchlas::symm ( Queue & ctx,
const MA & A,
const MB & B,
const MC & C,
const SymmOptions< T > & opts )
inline

Batched symmetric product \(C := \alpha AB + \beta C\) (Left) or \(\alpha BA + \beta C\) (Right).

Parameters
Asymmetric, m x m (Left) or n x n (Right); only the uplo triangle is read
Bm x n per item
Cm x n per item; overwritten
optsalpha, beta, side, uplo
Returns
event of the last enqueued kernel
Note
Real T only; use hemm() for complex.
Exceptions
std::invalid_argumentif a pointer is not reachable from the queue's device

Definition at line 350 of file options.hh.

◆ hemm() [1/2]

template<Backend Back, detail::DenseMatrixLike MA, detail::DenseMatrixLike MB, detail::DenseMatrixLike MC, typename T = detail::dense_scalar_t<MA>>
requires ComplexScalar<T>
Event batchlas::hemm ( Queue & ctx,
const MA & A,
const MB & B,
const MC & C,
const HemmOptions< T > & opts )
inline

hemm with a compile-time backend; same contract as the Queue-deducing overload, without the pointer check.

Template Parameters
Backbackend to run on

Definition at line 362 of file options.hh.

◆ hemm() [2/2]

template<detail::DenseMatrixLike MA, detail::DenseMatrixLike MB, detail::DenseMatrixLike MC, typename T = detail::dense_scalar_t<MA>>
requires ComplexScalar<T>
Event batchlas::hemm ( Queue & ctx,
const MA & A,
const MB & B,
const MC & C,
const HemmOptions< T > & opts )
inline

Batched Hermitian product; as symm() with A Hermitian.

The unread triangle is taken as the conjugate transpose of the uplo one and the diagonal's imaginary part as zero, whatever is stored there.

Parameters
optsalpha, beta, side, uplo
Returns
event of the last enqueued kernel
Note
Complex T only.
Exceptions
std::invalid_argumentif a pointer is not reachable from the queue's device

Definition at line 378 of file options.hh.

◆ herk() [1/2]

template<Backend Back, detail::DenseMatrixLike MA, detail::DenseMatrixLike MC, typename T = detail::dense_scalar_t<MA>>
requires ComplexScalar<T>
Event batchlas::herk ( Queue & ctx,
const MA & A,
const MC & C,
const HerkOptions< T > & opts )
inline

herk with a compile-time backend; same contract as the Queue-deducing overload, without the pointer check.

Template Parameters
Backbackend to run on

Definition at line 390 of file options.hh.

◆ herk() [2/2]

template<detail::DenseMatrixLike MA, detail::DenseMatrixLike MC, typename T = detail::dense_scalar_t<MA>>
requires ComplexScalar<T>
Event batchlas::herk ( Queue & ctx,
const MA & A,
const MC & C,
const HerkOptions< T > & opts )
inline

Batched Hermitian rank-k update \(C := \alpha AA^H + \beta C\) (NoTrans) or \(\alpha A^HA + \beta C\) (ConjTrans).

Parameters
An x k (NoTrans) or k x n (ConjTrans) per item
Cn x n per item; only the uplo triangle is written, the other is left exactly as it was (mirror it with hermitize if needed)
optsreal alpha and beta, uplo, trans
Returns
event of the last enqueued kernel
Note
Complex T only.
Exceptions
std::invalid_argumentif a pointer is not reachable from the queue's device

Definition at line 406 of file options.hh.

◆ her2k() [1/2]

template<Backend Back, detail::DenseMatrixLike MA, detail::DenseMatrixLike MB, detail::DenseMatrixLike MC, typename T = detail::dense_scalar_t<MA>>
requires ComplexScalar<T>
Event batchlas::her2k ( Queue & ctx,
const MA & A,
const MB & B,
const MC & C,
const Her2kOptions< T > & opts )
inline

her2k with a compile-time backend; same contract as the Queue-deducing overload, without the pointer check.

Template Parameters
Backbackend to run on

Definition at line 418 of file options.hh.

◆ her2k() [2/2]

template<detail::DenseMatrixLike MA, detail::DenseMatrixLike MB, detail::DenseMatrixLike MC, typename T = detail::dense_scalar_t<MA>>
requires ComplexScalar<T>
Event batchlas::her2k ( Queue & ctx,
const MA & A,
const MB & B,
const MC & C,
const Her2kOptions< T > & opts )
inline

Batched Hermitian rank-2k update \(C := \alpha\,\mathrm{op}(A)\,\mathrm{op}(B)^H + \bar\alpha\,\mathrm{op}(B)\,\mathrm{op}(A)^H + \beta C\).

Parameters
A,Bn x k (NoTrans) or k x n (ConjTrans) per item
Cn x n per item; only the uplo triangle is written, real diagonal
optscomplex alpha, real beta, uplo, trans
Returns
event of the last enqueued kernel
Note
Complex T only.
Exceptions
std::invalid_argumentif a pointer is not reachable from the queue's device

Definition at line 434 of file options.hh.

◆ syrk() [1/2]

template<Backend Back, detail::DenseMatrixLike MA, detail::DenseMatrixLike MC, typename T = detail::dense_scalar_t<MA>>
Event batchlas::syrk ( Queue & ctx,
const MA & A,
const MC & C,
const SyrkOptions< T > & opts )
inline

syrk with a compile-time backend; same contract as the Queue-deducing overload, without the pointer check.

Template Parameters
Backbackend to run on

Definition at line 446 of file options.hh.

◆ syrk() [2/2]

template<detail::DenseMatrixLike MA, detail::DenseMatrixLike MC, typename T = detail::dense_scalar_t<MA>>
Event batchlas::syrk ( Queue & ctx,
const MA & A,
const MC & C,
const SyrkOptions< T > & opts )
inline

Batched symmetric rank-k update \(C := \alpha AA^T + \beta C\) (NoTrans) or \(\alpha A^TA + \beta C\) (Trans).

Parameters
An x k (NoTrans) or k x n (Trans) per item
Cn x n per item; only the uplo triangle is written, the other is left exactly as it was (mirror it with symmetrize if needed)
optsalpha, beta, uplo, trans
Returns
event of the last enqueued kernel
Note
Real T only; use herk() for complex.
Exceptions
std::invalid_argumentif a pointer is not reachable from the queue's device

Definition at line 461 of file options.hh.

◆ syr2k() [1/2]

template<Backend Back, detail::DenseMatrixLike MA, detail::DenseMatrixLike MB, detail::DenseMatrixLike MC, typename T = detail::dense_scalar_t<MA>>
Event batchlas::syr2k ( Queue & ctx,
const MA & A,
const MB & B,
const MC & C,
const Syr2kOptions< T > & opts )
inline

syr2k with a compile-time backend; same contract as the Queue-deducing overload, without the pointer check.

Template Parameters
Backbackend to run on

Definition at line 472 of file options.hh.

◆ syr2k() [2/2]

template<detail::DenseMatrixLike MA, detail::DenseMatrixLike MB, detail::DenseMatrixLike MC, typename T = detail::dense_scalar_t<MA>>
Event batchlas::syr2k ( Queue & ctx,
const MA & A,
const MB & B,
const MC & C,
const Syr2kOptions< T > & opts )
inline

Batched symmetric rank-2k update \(C := \alpha(\mathrm{op}(A)\,\mathrm{op}(B)^T + \mathrm{op}(B)\,\mathrm{op}(A)^T) + \beta C\).

Parameters
A,Bn x k (NoTrans) or k x n (Trans) per item, k > 0
Cn x n per item; only the uplo triangle is written
optsalpha, beta, uplo, trans
Returns
event of the last enqueued kernel
Note
Real T only; use her2k() for complex.
Exceptions
std::invalid_argumentif a pointer is not reachable from the queue's device

Definition at line 487 of file options.hh.

◆ trmm() [1/2]

template<Backend Back, detail::DenseMatrixLike MA, detail::DenseMatrixLike MB, detail::DenseMatrixLike MC, typename T = detail::dense_scalar_t<MA>>
Event batchlas::trmm ( Queue & ctx,
const MA & A,
const MB & B,
const MC & C,
const TrmmOptions< T > & opts )
inline

trmm with a compile-time backend; same contract as the Queue-deducing overload, without the pointer check.

Template Parameters
Backbackend to run on

Definition at line 499 of file options.hh.

◆ trmm() [2/2]

template<detail::DenseMatrixLike MA, detail::DenseMatrixLike MB, detail::DenseMatrixLike MC, typename T = detail::dense_scalar_t<MA>>
Event batchlas::trmm ( Queue & ctx,
const MA & A,
const MB & B,
const MC & C,
const TrmmOptions< T > & opts )
inline

Batched triangular product, out of place: \(C := \alpha\,\mathrm{op}(A)\,B\) (Left) or \(\alpha B\,\mathrm{op}(A)\) (Right).

Unlike reference BLAS ?trmm, the result goes to C; B is not modified.

Parameters
Atriangular, m x m (Left) or n x n (Right); uplo and diag describe it
Bm x n per item; read only
Cm x n per item; overwritten
optsalpha, side, uplo, trans, diag
Returns
event of the last enqueued kernel
Exceptions
std::invalid_argumentif a pointer is not reachable from the queue's device

Definition at line 516 of file options.hh.

◆ trsm() [1/2]

template<Backend Back, detail::DenseMatrixLike MA, detail::DenseMatrixLike MB, typename T = detail::dense_scalar_t<MA>>
Event batchlas::trsm ( Queue & ctx,
const MA & A,
const MB & B,
const TrsmOptions< T > & opts )
inline

trsm with a compile-time backend; same contract as the Queue-deducing overload, without the pointer check.

Template Parameters
Backbackend to run on

Definition at line 527 of file options.hh.

◆ trsm() [2/2]

template<detail::DenseMatrixLike MA, detail::DenseMatrixLike MB, typename T = detail::dense_scalar_t<MA>>
Event batchlas::trsm ( Queue & ctx,
const MA & A,
const MB & B,
const TrsmOptions< T > & opts )
inline

Batched triangular solve \(\mathrm{op}(A)X = \alpha B\) (Left) or \(X\,\mathrm{op}(A) = \alpha B\) (Right), in place.

Parameters
Atriangular, m x m (Left) or n x n (Right); uplo and diag describe it
Bm x n per item; overwritten with X
optsalpha, side, uplo, trans, diag
Returns
event of the last enqueued kernel
Exceptions
std::invalid_argumentif a pointer is not reachable from the queue's device

Definition at line 540 of file options.hh.

◆ potrf() [1/6]

template<Backend B, detail::DenseMatrixLike MA, typename T = detail::dense_scalar_t<MA>>
Event batchlas::potrf ( Queue & ctx,
const MA & A,
const PotrfOptions & opts,
Span< std::byte > ws )
inline

potrf with a compile-time backend and a caller workspace.

Template Parameters
Bbackend to run on
Parameters
wsat least potrf_buffer_size<B, T>(ctx, A, opts.uplo) bytes
Exceptions
batchlas::invalid_argumentas the Queue-deducing overload

Definition at line 573 of file options.hh.

◆ potrf() [2/6]

template<Backend B, detail::DenseMatrixLike MA, typename T = detail::dense_scalar_t<MA>>
Event batchlas::potrf ( Queue & ctx,
const MA & A,
const PotrfOptions & opts )
inline

potrf with a compile-time backend; workspace leased from the arena.

Template Parameters
Bbackend to run on
Exceptions
batchlas::invalid_argumentif A is not square or opts.info is non-empty and short

Definition at line 584 of file options.hh.

◆ potrf() [3/6]

template<detail::DenseMatrixLike MA, typename T = detail::dense_scalar_t<MA>>
Event batchlas::potrf ( Queue & ctx,
const MA & A,
const PotrfOptions & opts,
Span< std::byte > ws )
inline

Batched Cholesky factorisation with a caller-owned workspace.

Same contract as the arena overload; the call stays asynchronous on any queue.

Parameters
wsdevice-accessible scratch of at least potrf_buffer_size bytes; must outlive the kernels
Warning
With an empty option struct, write PotrfOptions{}: a bare {} is rejected as ambiguous (it would otherwise mean Uplo::Upper).

Definition at line 600 of file options.hh.

◆ potrf() [4/6]

template<detail::DenseMatrixLike MA, typename T = detail::dense_scalar_t<MA>>
Event batchlas::potrf ( Queue & ctx,
const MA & A,
const PotrfOptions & opts = {} )
inline

Batched Cholesky factorisation \(A_i = L_iL_i^H\) (Lower) or \(U_i^HU_i\) (Upper), in place.

Workspace is leased from the queue's arena (blocking on an out-of-order queue).

Parameters
ctxqueue; supplies the backend and the arena
An x n per item; the uplo triangle is read and overwritten with the factor, the other triangle is not referenced
optsuplo (default Lower) and an optional per-item info span
Returns
event of the last enqueued kernel
Note
A matrix that is not positive definite yields a non-zero info entry and an undefined factor for that item; no exception.
Exceptions
batchlas::invalid_argumentif A is not square or opts.info is non-empty and shorter than the batch
std::invalid_argumentif a pointer is not reachable from the queue's device

Definition at line 622 of file options.hh.

◆ potrf() [5/6]

template<Backend B, detail::DenseMatrixLike MA, typename T = detail::dense_scalar_t<MA>>
Event batchlas::potrf ( Queue & ,
const MA & ,
detail::EmptyBracesAreAmbiguous ,
Span< std::byte >  )
delete

Deleted: makes potrf<B>(ctx, A, {}, ws) ambiguous. Write PotrfOptions{}.

◆ potrf() [6/6]

template<detail::DenseMatrixLike MA, typename T = detail::dense_scalar_t<MA>>
Event batchlas::potrf ( Queue & ,
const MA & ,
detail::EmptyBracesAreAmbiguous ,
Span< std::byte >  )
delete

Deleted: makes potrf(ctx, A, {}, ws) ambiguous. Write PotrfOptions{}.

◆ getrf() [1/2]

template<Backend B, detail::DenseMatrixLike MA, typename T = detail::dense_scalar_t<MA>>
Event batchlas::getrf ( Queue & ctx,
const MA & A,
Span< int64_t > pivots,
Span< int32_t > info = {} )
inline

getrf with a compile-time backend; workspace leased from the arena.

Template Parameters
Bbackend to run on
Exceptions
batchlas::invalid_argumentas the Queue-deducing overload

Definition at line 656 of file options.hh.

◆ getrf() [2/2]

template<detail::DenseMatrixLike MA, typename T = detail::dense_scalar_t<MA>>
Event batchlas::getrf ( Queue & ctx,
const MA & A,
Span< int64_t > pivots,
Span< int32_t > info = {} )
inline

Batched LU factorisation with partial pivoting, \(A_i = P_iL_iU_i\), in place.

Workspace is leased from the queue's arena. L (unit diagonal, implicit) and U overwrite A.

Parameters
ctxqueue; supplies the backend and the arena
An x n per item
pivotsat least n * batch_size entries; pass it unchanged to getrs() or getri() (see the pivot format note on the positional getrf)
infooptional per-item status: 0 = success, > 0 = index of the first exactly-zero pivot; empty reports nothing
Returns
event of the last enqueued kernel
Exceptions
batchlas::invalid_argumentif A is not square or a span is too short
std::invalid_argumentif a pointer is not reachable from the queue's device

Definition at line 680 of file options.hh.

◆ getrs() [1/4]

template<Backend B, detail::DenseMatrixLike MA, detail::DenseMatrixLike MB, typename T = detail::dense_scalar_t<MA>>
Event batchlas::getrs ( Queue & ctx,
const MA & A,
const MB & B_,
Span< int64_t > pivots,
const GetrsOptions & opts,
Span< std::byte > ws )
inline

getrs with a compile-time backend and a caller workspace.

Template Parameters
Bbackend to run on
Exceptions
batchlas::invalid_argumentas the Queue-deducing overload

Definition at line 695 of file options.hh.

◆ getrs() [2/4]

template<Backend B, detail::DenseMatrixLike MA, detail::DenseMatrixLike MB, typename T = detail::dense_scalar_t<MA>>
Event batchlas::getrs ( Queue & ctx,
const MA & A,
const MB & B_,
Span< int64_t > pivots,
const GetrsOptions & opts )
inline

getrs with a compile-time backend; workspace leased from the arena.

Template Parameters
Bbackend to run on
Exceptions
batchlas::invalid_argumentas the Queue-deducing overload

Definition at line 711 of file options.hh.

◆ getrs() [3/4]

template<detail::DenseMatrixLike MA, detail::DenseMatrixLike MB, typename T = detail::dense_scalar_t<MA>>
Event batchlas::getrs ( Queue & ctx,
const MA & A,
const MB & B_,
Span< int64_t > pivots,
const GetrsOptions & opts,
Span< std::byte > ws )
inline

Batched LU solve with a caller-owned workspace; otherwise as the arena overload.

Parameters
wsdevice-accessible scratch of at least getrs_buffer_size bytes

Definition at line 727 of file options.hh.

◆ getrs() [4/4]

template<detail::DenseMatrixLike MA, detail::DenseMatrixLike MB, typename T = detail::dense_scalar_t<MA>>
Event batchlas::getrs ( Queue & ctx,
const MA & A,
const MB & B_,
Span< int64_t > pivots,
const GetrsOptions & opts = {} )
inline

Batched LU solve \(\mathrm{op}(A_i)X_i = B_i\) from getrf()'s factors, in place.

Workspace is leased from the queue's arena. No status is reported: a singular factor produces non-finite or meaningless X without an exception.

Parameters
An x n per item, already factorised by getrf()
B_n x nrhs per item; overwritten with X
pivotsgetrf()'s pivots, at least n * batch_size entries
optstrans
Returns
event of the last enqueued kernel
Exceptions
batchlas::invalid_argumentif A is not square, A and B_ differ in rows or batch size, or pivots is too short
std::invalid_argumentif a pointer is not reachable from the queue's device

Definition at line 753 of file options.hh.

◆ getri() [1/2]

template<Backend B, detail::DenseMatrixLike MA, detail::DenseMatrixLike MB, typename T = detail::dense_scalar_t<MA>>
Event batchlas::getri ( Queue & ctx,
const MA & A,
const MB & Ainv,
Span< int64_t > pivots,
Span< int32_t > info = {} )
inline

getri with a compile-time backend; workspace leased from the arena.

Template Parameters
Bbackend to run on
Exceptions
batchlas::invalid_argumentas the Queue-deducing overload

Definition at line 770 of file options.hh.

◆ getri() [2/2]

template<detail::DenseMatrixLike MA, detail::DenseMatrixLike MB, typename T = detail::dense_scalar_t<MA>>
Event batchlas::getri ( Queue & ctx,
const MA & A,
const MB & Ainv,
Span< int64_t > pivots,
Span< int32_t > info = {} )
inline

Batched inverse \(A_{\mathrm{inv},i} := A_i^{-1}\) from getrf()'s factors.

Workspace is leased from the queue's arena. A is read only.

Parameters
An x n per item, already factorised by getrf()
Ainvn x n per item; overwritten with the inverse
pivotsgetrf()'s pivots, at least n * batch_size entries
infooptional per-item status (0 = success); empty reports nothing
Returns
event of the last enqueued kernel
Exceptions
batchlas::invalid_argumenton a non-square or mismatched operand or a short span
std::invalid_argumentif a pointer is not reachable from the queue's device

Definition at line 796 of file options.hh.

◆ geqrf() [1/2]

template<Backend B, detail::DenseMatrixLike MA, typename T = detail::dense_scalar_t<MA>>
Event batchlas::geqrf ( Queue & ctx,
const MA & A,
Span< T > tau )
inline

geqrf with a compile-time backend; workspace leased from the arena.

Template Parameters
Bbackend to run on

Definition at line 813 of file options.hh.

◆ geqrf() [2/2]

template<detail::DenseMatrixLike MA, typename T = detail::dense_scalar_t<MA>>
Event batchlas::geqrf ( Queue & ctx,
const MA & A,
Span< T > tau )
inline

Batched Householder QR, \(A_i = Q_iR_i\), in place.

R overwrites the upper triangle of A, the Householder vectors are stored below it, and their scalars go to tau. Workspace is leased from the arena.

Parameters
Am x n per item (rectangular allowed)
tauat least min(m, n) * batch_size entries; item i's scalars start at i * min(m, n)
Returns
event of the last enqueued kernel
Exceptions
batchlas::invalid_argumentif tau is too short
std::invalid_argumentif a pointer is not reachable from the queue's device

Definition at line 832 of file options.hh.

◆ orgqr() [1/2]

template<Backend B, detail::DenseMatrixLike MA, typename T = detail::dense_scalar_t<MA>>
Event batchlas::orgqr ( Queue & ctx,
const MA & A,
Span< T > tau )
inline

orgqr with a compile-time backend; workspace leased from the arena.

Template Parameters
Bbackend to run on

Definition at line 844 of file options.hh.

◆ orgqr() [2/2]

template<detail::DenseMatrixLike MA, typename T = detail::dense_scalar_t<MA>>
Event batchlas::orgqr ( Queue & ctx,
const MA & A,
Span< T > tau )
inline

Form the explicit Q of geqrf() in place.

Overwrites A (holding geqrf()'s reflectors) with the first min(m, n) columns of Q. Workspace is leased from the arena.

Parameters
Am x n per item, as left by geqrf()
taugeqrf()'s scalars, at least min(m, n) * batch_size entries
Returns
event of the last enqueued kernel
Exceptions
batchlas::invalid_argumentif tau is too short
std::invalid_argumentif a pointer is not reachable from the queue's device

Definition at line 862 of file options.hh.

◆ syev() [1/4]

template<Backend B, detail::DenseMatrixLike MA, typename T = detail::dense_scalar_t<MA>>
Event batchlas::syev ( Queue & ctx,
const MA & A,
Span< typename base_type< T >::type > W,
const SyevOptions & opts,
Span< std::byte > ws )
inline

syev with a compile-time backend and a caller workspace.

Template Parameters
Bbackend to run on
Exceptions
batchlas::invalid_argumentas the Queue-deducing overload

Definition at line 874 of file options.hh.

◆ syev() [2/4]

template<Backend B, detail::DenseMatrixLike MA, typename T = detail::dense_scalar_t<MA>>
Event batchlas::syev ( Queue & ctx,
const MA & A,
Span< typename base_type< T >::type > W,
const SyevOptions & opts )
inline

syev with a compile-time backend; workspace leased from the arena.

Template Parameters
Bbackend to run on
Exceptions
batchlas::invalid_argumentas the Queue-deducing overload

Definition at line 887 of file options.hh.

◆ syev() [3/4]

template<detail::DenseMatrixLike MA, typename T = detail::dense_scalar_t<MA>>
Event batchlas::syev ( Queue & ctx,
const MA & A,
Span< typename base_type< T >::type > W,
const SyevOptions & opts,
Span< std::byte > ws )
inline

Batched symmetric/Hermitian eigensolver with a caller-owned workspace; otherwise as the arena overload.

Parameters
wsdevice-accessible scratch of at least syev_buffer_size bytes

Definition at line 901 of file options.hh.

◆ syev() [4/4]

template<detail::DenseMatrixLike MA, typename T = detail::dense_scalar_t<MA>>
Event batchlas::syev ( Queue & ctx,
const MA & A,
Span< typename base_type< T >::type > W,
const SyevOptions & opts = {} )
inline

Batched symmetric/Hermitian eigendecomposition \(A_i = V_i\Lambda_iV_i^H\).

Workspace is leased from the queue's arena. This spelling reports no per-item convergence status; use the positional syev() with an info span for that.

Parameters
An x n per item; the uplo triangle is read. Overwritten with the eigenvectors (columns) when opts.jobz == JobType::EigenVectors, left unspecified otherwise
Wreal, at least n * batch_size entries; eigenvalues ascending per item
optsjobz, uplo
Returns
event of the last enqueued kernel
Exceptions
batchlas::invalid_argumentif A is not square or W is too short
std::invalid_argumentif a pointer is not reachable from the queue's device

Definition at line 924 of file options.hh.

◆ ormqr() [1/4]

template<Backend B, detail::DenseMatrixLike MA, detail::DenseMatrixLike MC, typename T = detail::dense_scalar_t<MA>>
Event batchlas::ormqr ( Queue & ctx,
const MA & A,
const MC & C,
Span< T > tau,
const OrmqrOptions & opts,
Span< std::byte > ws )
inline

ormqr with a compile-time backend and a caller workspace.

Template Parameters
Bbackend to run on
Exceptions
batchlas::invalid_argumentas the Queue-deducing overload

Definition at line 949 of file options.hh.

◆ ormqr() [2/4]

template<Backend B, detail::DenseMatrixLike MA, detail::DenseMatrixLike MC, typename T = detail::dense_scalar_t<MA>>
Event batchlas::ormqr ( Queue & ctx,
const MA & A,
const MC & C,
Span< T > tau,
const OrmqrOptions & opts )
inline

ormqr with a compile-time backend; workspace leased from the arena.

Template Parameters
Bbackend to run on
Exceptions
batchlas::invalid_argumentas the Queue-deducing overload

Definition at line 963 of file options.hh.

◆ ormqr() [3/4]

template<detail::DenseMatrixLike MA, detail::DenseMatrixLike MC, typename T = detail::dense_scalar_t<MA>>
Event batchlas::ormqr ( Queue & ctx,
const MA & A,
const MC & C,
Span< T > tau,
const OrmqrOptions & opts,
Span< std::byte > ws )
inline

Apply Q from geqrf() with a caller-owned workspace; otherwise as the arena overload.

Parameters
wsdevice-accessible scratch of at least ormqr_buffer_size bytes, sized with the same block_size_hint

Definition at line 981 of file options.hh.

◆ ormqr() [4/4]

template<detail::DenseMatrixLike MA, detail::DenseMatrixLike MC, typename T = detail::dense_scalar_t<MA>>
Event batchlas::ormqr ( Queue & ctx,
const MA & A,
const MC & C,
Span< T > tau,
const OrmqrOptions & opts = {} )
inline

Apply the Q of geqrf() to C: \(C_i := \mathrm{op}(Q_i)C_i\) (Left) or \(C_i\,\mathrm{op}(Q_i)\) (Right).

Workspace is leased from the queue's arena.

Parameters
Ageqrf()'s output (reflectors below the diagonal), m x k per item
Coverwritten with the product
taugeqrf()'s scalars, at least min(A.rows(), A.cols()) * batch_size
optsside, trans, block_size_hint
Returns
event of the last enqueued kernel
Exceptions
batchlas::invalid_argumentif A and C differ in batch size or tau is too short
std::invalid_argumentif a pointer is not reachable from the queue's device

Definition at line 1003 of file options.hh.

◆ gesvd() [1/4]

template<Backend B, detail::DenseMatrixLike MA, detail::DenseMatrixLike MU, detail::DenseMatrixLike MV, typename T = detail::dense_scalar_t<MA>>
Event batchlas::gesvd ( Queue & ctx,
const MA & A,
Span< typename base_type< T >::type > singular_values,
const MU & U,
const MV & Vh,
const GesvdOptions & opts,
Span< std::byte > ws )
inline

gesvd with a compile-time backend and a caller workspace.

Template Parameters
Bbackend to run on
Exceptions
batchlas::invalid_argumentas the Queue-deducing overload

Definition at line 1028 of file options.hh.

◆ gesvd() [2/4]

template<Backend B, detail::DenseMatrixLike MA, detail::DenseMatrixLike MU, detail::DenseMatrixLike MV, typename T = detail::dense_scalar_t<MA>>
Event batchlas::gesvd ( Queue & ctx,
const MA & A,
Span< typename base_type< T >::type > singular_values,
const MU & U,
const MV & Vh,
const GesvdOptions & opts )
inline

gesvd with a compile-time backend; workspace leased from the arena.

Template Parameters
Bbackend to run on
Exceptions
batchlas::invalid_argumentas the Queue-deducing overload

Definition at line 1045 of file options.hh.

◆ gesvd() [3/4]

template<detail::DenseMatrixLike MA, detail::DenseMatrixLike MU, detail::DenseMatrixLike MV, typename T = detail::dense_scalar_t<MA>>
Event batchlas::gesvd ( Queue & ctx,
const MA & A,
Span< typename base_type< T >::type > singular_values,
const MU & U,
const MV & Vh,
const GesvdOptions & opts,
Span< std::byte > ws )
inline

Batched SVD with a caller-owned workspace; otherwise as the arena overload.

Parameters
wsdevice-accessible scratch of at least gesvd_buffer_size bytes, sized for the same hermitian_uplo branch

Definition at line 1071 of file options.hh.

◆ gesvd() [4/4]

template<detail::DenseMatrixLike MA, detail::DenseMatrixLike MU, detail::DenseMatrixLike MV, typename T = detail::dense_scalar_t<MA>>
Event batchlas::gesvd ( Queue & ctx,
const MA & A,
Span< typename base_type< T >::type > singular_values,
const MU & U,
const MV & Vh,
const GesvdOptions & opts = {} )
inline

Batched singular value decomposition \(A_i = U_i\Sigma_iV_i^H\).

Workspace is leased from the queue's arena. A is overwritten. This spelling reports no per-item convergence status; use the positional gesvd() with an info span for that.

Parameters
Am x n per item (square when hermitian_uplo is engaged)
singular_valuesreal, at least min(m, n) * batch_size; descending per item
Um x m (All) or m x k (Thin); default-constructed for None
Vhn x n (All) or k x n (Thin); default-constructed for None
optsjobu, jobvh, hermitian_uplo
Returns
event of the last enqueued kernel
Exceptions
batchlas::invalid_argumentif singular_values is too short, or A is not square with hermitian_uplo engaged
std::invalid_argumentif a pointer is not reachable from the queue's device

Definition at line 1097 of file options.hh.

Files

file  include/batchlas/blas/options.hh
 Option-struct spellings of the dense BLAS and LAPACK-style entry points.

Classes

struct  batchlas::GemmOptions< T >
 Options for gemm(): \(C := \alpha\,\mathrm{op}(A)\,\mathrm{op}(B) + \beta C\). More...
struct  batchlas::GemvOptions< T >
 Options for gemv(): \(y := \alpha\,\mathrm{op}(A)\,x + \beta y\). More...
struct  batchlas::SymmOptions< T >
 Options for symm(): \(C := \alpha A B + \beta C\) (Left) or \(\alpha B A + \beta C\) (Right), A symmetric. More...
struct  batchlas::HemmOptions< T >
 Options for hemm(): as SymmOptions, with A Hermitian. More...
struct  batchlas::HerkOptions< T >
 Options for herk(): \(C := \alpha\,\mathrm{op}(A)\,\mathrm{op}(A)^H + \beta C\). More...
struct  batchlas::Her2kOptions< T >
 Options for her2k(): \(C := \alpha\,\mathrm{op}(A)\,\mathrm{op}(B)^H + \bar\alpha\,\mathrm{op}(B)\,\mathrm{op}(A)^H + \beta C\). More...
struct  batchlas::SyrkOptions< T >
 Options for syrk(): \(C := \alpha\,\mathrm{op}(A)\,\mathrm{op}(A)^T + \beta C\). More...
struct  batchlas::Syr2kOptions< T >
 Options for syr2k(): \(C := \alpha(\mathrm{op}(A)\,\mathrm{op}(B)^T + \mathrm{op}(B)\,\mathrm{op}(A)^T) + \beta C\). More...
struct  batchlas::TrmmOptions< T >
 Options for trmm(): \(C := \alpha\,\mathrm{op}(A)\,B\) (Left) or \(\alpha B\,\mathrm{op}(A)\) (Right). No beta. More...
struct  batchlas::TrsmOptions< T >
 Options for trsm(): solve \(\mathrm{op}(A)X = \alpha B\) (Left) or \(X\,\mathrm{op}(A) = \alpha B\) (Right). More...
struct  batchlas::PotrfOptions
 Options for potrf(): Cholesky \(A = LL^H\) (Lower) or \(U^HU\) (Upper). More...
struct  batchlas::GetrsOptions
 Options for getrs(): solve \(\mathrm{op}(A)X = B\) with getrf's factors. More...
struct  batchlas::SyevOptions
 Options for syev(): symmetric/Hermitian eigendecomposition. More...
struct  batchlas::OrmqrOptions
 Options for ormqr(): apply geqrf()'s Q, \(C := \mathrm{op}(Q)C\) (Left) or \(C\,\mathrm{op}(Q)\) (Right). More...
struct  batchlas::GesvdOptions
 Options for gesvd(): \(A = U\Sigma V^H\). More...