Factorizations: lower-level API

Overview

Workspace queries and argument validation behind potrf, getrf, getrs, getri, gesv and posv.

Functions

◆ gesv_validate_params()

template<typename T>
void batchlas::gesv_validate_params ( const MatrixView< T, MatrixFormat::Dense > & A,
const MatrixView< T, MatrixFormat::Dense > & B )
inline

Validates the arguments of gesv() and gesv_buffer_size().

Checks non-negative extents, a square A, B.rows() == A.rows() and equal batch sizes.

Exceptions
batchlas::invalid_argumentif any check fails

Definition at line 48 of file gesv.hh.

◆ gesv_buffer_size()

template<Backend Back, typename T>
size_t batchlas::gesv_buffer_size ( Queue & ctx,
const MatrixView< T, MatrixFormat::Dense > & A,
const MatrixView< T, MatrixFormat::Dense > & B )

Workspace, in bytes, that gesv() needs for these operands on this queue.

Takes the same operands as the call, so both resolve the same route.

Exceptions
batchlas::invalid_argumentif gesv_validate_params() rejects the operands

◆ getrf_validate_params()

template<typename T>
void batchlas::getrf_validate_params ( const MatrixView< T, MatrixFormat::Dense > & A)
inline

Validates the arguments of the positional getrf() entry point.

Checks only non-negative extents. Squareness and the pivot span's length are checked by the option overloads, not here: every native kernel's can_run refuses a non-square view, which sends it to the vendor rather than rejecting it (in a vendor-free build: batchlas::NoRouteError).

Exceptions
batchlas::invalid_argumenton negative extents

Definition at line 59 of file getrf.hh.

◆ getrf_buffer_size()

template<Backend B, typename T>
size_t batchlas::getrf_buffer_size ( Queue & ctx,
const MatrixView< T, MatrixFormat::Dense > & A )

Workspace, in bytes, that getrf() needs for this shape on this queue.

Parameters
ctxqueue the factorization will run on (kernel selection reads its device)
Abatch of n x n matrices to be factorized
Returns
bytes to pass as the work_space span of getrf()

◆ getri_validate_params() [1/2]

template<typename T>
void batchlas::getri_validate_params ( const MatrixView< T, MatrixFormat::Dense > & A)
inline

Validates A for getri_buffer_size(): non-negative extents only.

Exceptions
batchlas::invalid_argumenton negative extents

Definition at line 57 of file getri.hh.

◆ getri_validate_params() [2/2]

template<typename T>
void batchlas::getri_validate_params ( const MatrixView< T, MatrixFormat::Dense > & A,
const MatrixView< T, MatrixFormat::Dense > & C )
inline

Validates A and C for the positional getri(): non-negative extents, C not aliasing A.

Exceptions
batchlas::invalid_argumenton negative extents of A or C, or if a non-empty C starts at A's storage (getri is out of place on every backend)

Definition at line 70 of file getri.hh.

◆ getri_buffer_size()

template<Backend B, typename T>
size_t batchlas::getri_buffer_size ( Queue & ctx,
const MatrixView< T, MatrixFormat::Dense > & A )

Workspace, in bytes, that getri() needs for A on this queue.

Takes A alone: the kernel choice, and therefore the size, depends only on A.

◆ getrs_validate_params()

template<typename T>
void batchlas::getrs_validate_params ( const MatrixView< T, MatrixFormat::Dense > & A,
const MatrixView< T, MatrixFormat::Dense > & B )
inline

Validates the arguments of the positional getrs() entry point.

Checks only non-negative extents. Squareness of A, A.rows() == B.rows(), equal batch sizes and the pivot span's length are checked by the option overloads; on this path a non-conforming pair fails every native can_run and goes to the vendor.

Exceptions
batchlas::invalid_argumenton negative extents

Definition at line 63 of file getrs.hh.

◆ getrs_buffer_size()

template<Backend Back, typename T>
size_t batchlas::getrs_buffer_size ( Queue & ctx,
const MatrixView< T, MatrixFormat::Dense > & A,
const MatrixView< T, MatrixFormat::Dense > & B,
Transpose transA )

Workspace, in bytes, that getrs() needs for these operands on this queue.

◆ posv_validate_params()

template<typename T>
void batchlas::posv_validate_params ( const MatrixView< T, MatrixFormat::Dense > & A,
const MatrixView< T, MatrixFormat::Dense > & B,
Uplo uplo )
inline

Validates the arguments of posv() and posv_buffer_size().

Checks non-negative extents, a square A, B.rows() == A.rows(), equal batch sizes and a valid uplo.

Exceptions
batchlas::invalid_argumentif any check fails

Definition at line 49 of file posv.hh.

◆ posv_buffer_size()

template<Backend Back, typename T>
size_t batchlas::posv_buffer_size ( Queue & ctx,
const MatrixView< T, MatrixFormat::Dense > & A,
const MatrixView< T, MatrixFormat::Dense > & B,
Uplo uplo )

Workspace, in bytes, that posv() needs for these operands on this queue.

Takes the same operands as the call, so both resolve the same route.

Exceptions
batchlas::invalid_argumentif posv_validate_params() rejects the operands

◆ potrf_validate_params()

template<typename T>
void batchlas::potrf_validate_params ( const MatrixView< T, MatrixFormat::Dense > & A,
Uplo uplo )
inline

Validates the arguments of the positional potrf() entry point.

Checks only what no kernel can serve: non-negative extents, a square A and a valid uplo. It does not check the length of a non-empty info span. Called by the public potrf() before the selection key is built.

Exceptions
batchlas::invalid_argumenton negative extents, a non-square A or an invalid uplo.

Definition at line 57 of file potrf.hh.

◆ potrf_buffer_size()

template<Backend B, typename T>
size_t batchlas::potrf_buffer_size ( Queue & ctx,
const MatrixView< T, MatrixFormat::Dense > & A,
Uplo uplo )

Workspace, in bytes, that potrf() needs for this shape on this queue.

The size does not depend on whether a caller passes an info span, so the same value serves both potrf() overloads.

Template Parameters
Bbackend; the backend-deducing overload takes it from ctx.backend()
Tscalar type (float, double, std::complex<float>, std::complex<double>)
Parameters
ctxqueue the factorization will run on (kernel selection reads its device)
Abatch of n x n matrices to be factorized
uplotriangle that will be factorized
Returns
bytes to pass as the workspace span of potrf()