How a call reaches a backend: the Queue's backend, owning arguments, and the backend::*_vendor declarations the vendor families call.
Which kernel runs for a shape is decided by flat kernel selection (developer docs: Kernel selection (developer); design: Flat kernel selection; per-op families and tables: Kernel selection tables). Measurements behind each op's choices: Routing and performance evidence.
Every entry point has two spellings. f<Backend::CUDA>(ctx, ...) fixes the backend at compile time; f(ctx, ...) takes it from ctx.backend() through with_backend(). The deducing overload of a positional entry point is generated by BATCHLAS_DISPATCH_ON_QUEUE(f), and the option-struct overloads in blas/options.hh deduce the same way. Library code templated on Backend must call the f<B> spelling, never the deducing one.
Every entry point also accepts owning arguments. A Matrix is a MatrixView and a Vector is a VectorView (public inheritance), so an owning argument binds to a view parameter directly and deduces T and MatrixFormat through derived-to-base deduction, in any position and with any template arguments named.
Pointer checks. The deducing spellings check that every non-empty pointer argument is reachable from the queue's device and throw std::invalid_argument naming the argument otherwise; the f<Backend> spellings do not check. BATCHLAS_SKIP_POINTER_CHECKS turns the check off (latched once per process).
The generating macros are omitted from this reference; see API conventions for their design and traps.
| Event batchlas::backend::gemm_vendor | ( | 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 ) |
Vendor-library implementation of gemm (cuBLAS, rocBLAS, host BLAS).
Not an entry point: batchlas::gemm calls it when it selects the vendor kernel family. Same arguments and semantics as batchlas::gemm.
| Event batchlas::backend::gemv_vendor | ( | Queue & | ctx, |
| const MatrixView< T, MatrixFormat::Dense > & | A, | ||
| const VectorView< T > & | X, | ||
| const VectorView< T > & | Y, | ||
| T | alpha, | ||
| T | beta, | ||
| Transpose | transA ) |
Vendor-library implementation of gemv (cuBLAS, rocBLAS, host BLAS).
Not an entry point: batchlas::gemv calls it when it selects the vendor kernel family. Same arguments and semantics as batchlas::gemv.
| Event batchlas::backend::geqrf_vendor | ( | Queue & | ctx, |
| const MatrixView< T, MatrixFormat::Dense > & | A, | ||
| Span< T > | tau, | ||
| Span< std::byte > | work_space ) |
| size_t batchlas::backend::geqrf_vendor_buffer_size | ( | Queue & | ctx, |
| const MatrixView< T, MatrixFormat::Dense > & | A, | ||
| Span< T > | tau ) |
Workspace query of the vendor arm of geqrf().
| Event batchlas::backend::gesvd_vendor | ( | Queue & | ctx, |
| const MatrixView< T, MatrixFormat::Dense > & | A, | ||
| Span< typename base_type< T >::type > | singular_values, | ||
| const MatrixView< T, MatrixFormat::Dense > & | U, | ||
| const MatrixView< T, MatrixFormat::Dense > & | Vh, | ||
| SvdVectors | jobu, | ||
| SvdVectors | jobvh, | ||
| Span< std::byte > | workspace, | ||
| Span< int32_t > | info_out = Span< int32_t >() ) |
The vendor solver's SVD (cuSOLVER gesvdjBatched or a LAPACKE loop), as gesvd()'s vendor kernel family calls it; same contract as the general gesvd().
| batchlas::unsupported | on CUDA for max(m, n) > 32, a non-packed batch stride or Thin vectors (gesvdjBatched has no econ flag); on ROCm always |
| batchlas::convergence_error | on NETLIB for a non-converged item when info_out is empty |
| size_t batchlas::backend::gesvd_vendor_buffer_size | ( | Queue & | ctx, |
| const MatrixView< T, MatrixFormat::Dense > & | A, | ||
| Span< typename base_type< T >::type > | singular_values, | ||
| const MatrixView< T, MatrixFormat::Dense > & | U, | ||
| const MatrixView< T, MatrixFormat::Dense > & | Vh, | ||
| SvdVectors | jobu, | ||
| SvdVectors | jobvh ) |
Workspace, in bytes, for backend::gesvd_vendor().
| Event batchlas::backend::getrf_vendor | ( | Queue & | ctx, |
| const MatrixView< T, MatrixFormat::Dense > & | A, | ||
| Span< int64_t > | pivots, | ||
| Span< std::byte > | work_space, | ||
| Span< int32_t > | info_out ) |
| size_t batchlas::backend::getrf_vendor_buffer_size | ( | Queue & | ctx, |
| const MatrixView< T, MatrixFormat::Dense > & | A ) |
Workspace query of the vendor arm of getrf().
| Event batchlas::backend::getri_vendor | ( | Queue & | ctx, |
| const MatrixView< T, MatrixFormat::Dense > & | A, | ||
| const MatrixView< T, MatrixFormat::Dense > & | C, | ||
| Span< int64_t > | pivots, | ||
| Span< std::byte > | work_space, | ||
| Span< int32_t > | info_out ) |
| size_t batchlas::backend::getri_vendor_buffer_size | ( | Queue & | ctx, |
| const MatrixView< T, MatrixFormat::Dense > & | A ) |
Workspace query of the vendor arm of getri().
| Event batchlas::backend::getrs_vendor | ( | Queue & | ctx, |
| const MatrixView< T, MatrixFormat::Dense > & | A, | ||
| const MatrixView< T, MatrixFormat::Dense > & | B, | ||
| Transpose | transA, | ||
| Span< int64_t > | pivots, | ||
| Span< std::byte > | work_space ) |
| size_t batchlas::backend::getrs_vendor_buffer_size | ( | Queue & | ctx, |
| const MatrixView< T, MatrixFormat::Dense > & | A, | ||
| const MatrixView< T, MatrixFormat::Dense > & | B, | ||
| Transpose | transA ) |
Workspace query of the vendor arm of getrs().
| Event batchlas::backend::hemm_vendor | ( | Queue & | ctx, |
| const MatrixView< T, MatrixFormat::Dense > & | A, | ||
| const MatrixView< T, MatrixFormat::Dense > & | B, | ||
| const MatrixView< T, MatrixFormat::Dense > & | C, | ||
| T | alpha, | ||
| T | beta, | ||
| Side | side, | ||
| Uplo | uplo ) |
Vendor-library implementation of hemm (cuBLAS, host BLAS).
Not an entry point: batchlas::hemm calls it. Same arguments and semantics.
| Event batchlas::backend::her2k_vendor | ( | Queue & | ctx, |
| const MatrixView< T, MatrixFormat::Dense > & | A, | ||
| const MatrixView< T, MatrixFormat::Dense > & | B, | ||
| const MatrixView< T, MatrixFormat::Dense > & | C, | ||
| T | alpha, | ||
| float_t< T > | beta, | ||
| Uplo | uplo, | ||
| Transpose | transA ) |
Vendor-library implementation of her2k (cuBLAS, host BLAS).
Not an entry point: batchlas::her2k calls it. Same arguments and semantics.
| Event batchlas::backend::herk_vendor | ( | Queue & | ctx, |
| const MatrixView< T, MatrixFormat::Dense > & | A, | ||
| const MatrixView< T, MatrixFormat::Dense > & | C, | ||
| float_t< T > | alpha, | ||
| float_t< T > | beta, | ||
| Uplo | uplo, | ||
| Transpose | transA ) |
Vendor-library implementation of herk (cuBLAS, host BLAS).
Not an entry point: batchlas::herk calls it. Same arguments and semantics.
| Event batchlas::backend::orgqr_vendor | ( | Queue & | ctx, |
| const MatrixView< T, MatrixFormat::Dense > & | A, | ||
| Span< T > | tau, | ||
| Span< std::byte > | workspace ) |
| size_t batchlas::backend::orgqr_vendor_buffer_size | ( | Queue & | ctx, |
| const MatrixView< T, MatrixFormat::Dense > & | A, | ||
| Span< T > | tau ) |
Workspace query of the vendor arm of orgqr().
| Event batchlas::backend::ormqr_vendor | ( | Queue & | ctx, |
| const MatrixView< T, MatrixFormat::Dense > & | A, | ||
| const MatrixView< T, MatrixFormat::Dense > & | C, | ||
| Side | side, | ||
| Transpose | trans, | ||
| Span< T > | tau, | ||
| Span< std::byte > | workspace ) |
| size_t batchlas::backend::ormqr_vendor_buffer_size | ( | Queue & | ctx, |
| const MatrixView< T, MatrixFormat::Dense > & | A, | ||
| const MatrixView< T, MatrixFormat::Dense > & | C, | ||
| Side | side, | ||
| Transpose | trans, | ||
| Span< T > | tau ) |
Workspace query of the vendor arm of ormqr().
| Event batchlas::backend::potrf_vendor | ( | Queue & | ctx, |
| const MatrixView< T, MatrixFormat::Dense > & | descrA, | ||
| Uplo | uplo, | ||
| Span< std::byte > | workspace, | ||
| Span< int32_t > | info_out ) |
| size_t batchlas::backend::potrf_vendor_buffer_size | ( | Queue & | ctx, |
| const MatrixView< T, MatrixFormat::Dense > & | A, | ||
| Uplo | uplo ) |
Workspace query of the vendor arm of potrf().
| Event batchlas::backend::spmm_vendor | ( | Queue & | ctx, |
| const MatrixView< T, MFormat > & | A, | ||
| const MatrixView< T, MatrixFormat::Dense > & | B_mat, | ||
| const MatrixView< T, MatrixFormat::Dense > & | C, | ||
| T | alpha, | ||
| T | beta, | ||
| Transpose | transA, | ||
| Transpose | transB, | ||
| Span< std::byte > | workspace ) |
Vendor-library implementation of spmm (cuSPARSE, rocSPARSE, host).
Not an entry point: batchlas::spmm calls it. Same arguments and semantics.
| size_t batchlas::backend::spmm_vendor_buffer_size | ( | Queue & | ctx, |
| const MatrixView< T, MFormat > & | A, | ||
| const MatrixView< T, MatrixFormat::Dense > & | B_mat, | ||
| const MatrixView< T, MatrixFormat::Dense > & | C, | ||
| T | alpha, | ||
| T | beta, | ||
| Transpose | transA, | ||
| Transpose | transB ) |
Workspace bytes spmm_vendor needs; called by batchlas::spmm_buffer_size.
| size_t batchlas::backend::syev_vendor_buffer_size | ( | Queue & | ctx, |
| const MatrixView< T, MatrixFormat::Dense > & | descrA, | ||
| Span< typename base_type< T >::type > | eigenvalues, | ||
| JobType | jobtype, | ||
| Uplo | uplo ) |
Workspace, in bytes, for backend::syev_vendor().
| Event batchlas::backend::symm_vendor | ( | Queue & | ctx, |
| const MatrixView< T, MatrixFormat::Dense > & | A, | ||
| const MatrixView< T, MatrixFormat::Dense > & | B, | ||
| const MatrixView< T, MatrixFormat::Dense > & | C, | ||
| T | alpha, | ||
| T | beta, | ||
| Side | side, | ||
| Uplo | uplo ) |
Vendor-library implementation of symm (cuBLAS, host BLAS).
Not an entry point: batchlas::symm calls it. Same arguments and semantics.
| Event batchlas::backend::syr2k_vendor | ( | Queue & | ctx, |
| const MatrixView< T, MatrixFormat::Dense > & | A, | ||
| const MatrixView< T, MatrixFormat::Dense > & | B, | ||
| const MatrixView< T, MatrixFormat::Dense > & | C, | ||
| T | alpha, | ||
| T | beta, | ||
| Uplo | uplo, | ||
| Transpose | transA ) |
Vendor-library implementation of syr2k (cuBLAS, rocBLAS, host BLAS).
Not an entry point: batchlas::syr2k calls it. Same arguments and semantics.
| Event batchlas::backend::syrk_vendor | ( | Queue & | ctx, |
| const MatrixView< T, MatrixFormat::Dense > & | A, | ||
| const MatrixView< T, MatrixFormat::Dense > & | C, | ||
| T | alpha, | ||
| T | beta, | ||
| Uplo | uplo, | ||
| Transpose | transA ) |
Vendor-library implementation of syrk (cuBLAS, rocBLAS, host BLAS).
Not an entry point: batchlas::syrk calls it. Same arguments and semantics.
| Event batchlas::backend::trmm_vendor | ( | Queue & | ctx, |
| const MatrixView< T, MatrixFormat::Dense > & | A, | ||
| const MatrixView< T, MatrixFormat::Dense > & | B, | ||
| const MatrixView< T, MatrixFormat::Dense > & | C, | ||
| T | alpha, | ||
| Side | side, | ||
| Uplo | uplo, | ||
| Transpose | transA, | ||
| Diag | diag ) |
Vendor-library implementation of trmm (cuBLAS, rocBLAS, host BLAS).
Not an entry point: batchlas::trmm calls it. Same arguments and semantics.
| Event batchlas::backend::trsm_vendor | ( | Queue & | ctx, |
| const MatrixView< T, MatrixFormat::Dense > & | A, | ||
| const MatrixView< T, MatrixFormat::Dense > & | B, | ||
| Side | side, | ||
| Uplo | uplo, | ||
| Transpose | transA, | ||
| Diag | diag, | ||
| T | alpha ) |
Vendor-library implementation of trsm (cuBLAS, rocBLAS, host BLAS).
Not an entry point: batchlas::trsm calls it after validation, when kernel selection picks the Vendor family. Same semantics as batchlas::trsm, but alpha is the last argument.
|
inline |
Call f with the queue's backend as a compile-time constant.
Converts ctx.backend() into std::integral_constant<Backend, B> and invokes f with it, so the body can name B.value as a template argument:
This is a switch over existing instantiations, not a virtual call.
| F | callable taking std::integral_constant<Backend, B> |
| ctx | queue whose backend is dispatched on |
| f | callable; every branch must return the same type |
f returns | batchlas::unsupported | if ctx.backend() has no implementation in this build (always the case for Backend::MAGMA) |
f must not name them for Backend::SYCL. The entry points' deducing overloads check this and throw batchlas::unsupported instead. Definition at line 163 of file queue-dispatch.hh.
|
inline |
with_backend() for a call on element type T: throws batchlas::unsupported before dispatch when T is double or complex<double> and the queue's backend is Backend::SYCL in a build without device fp64.
Definition at line 171 of file queue-dispatch.hh.
Files | |
| file | include/batchlas/blas/queue-dispatch.hh |
| Backend deduction from the Queue and the USM pointer check. | |
Namespaces | |
| namespace | batchlas::detail |