ormqr_blocked.hh
Go to the documentation of this file.
1#pragma once
2
3/// @file
4/// @brief Blocked (WY) application of Q from geqrf reflectors. Kernel helper, not API.
5///
6/// Installed only because `batchlas/blas/functions/ormqr.hh` includes it; not a
7/// stable interface.
8/// @ingroup api_internal_helpers
9
10#include <batchlas/export.hh>
16
17namespace batchlas {
18
19/// @brief Blocked native arm of ormqr(): applies Q with the compact WY form.
20///
21/// Groups the geqrf() reflectors (forward, columnwise, unit-lower V) into panels
22/// of @p block_size and applies each as \f$ I - V T V^H \f$ (LAPACK
23/// `larft`/`larfb`) with level-3 GEMMs. Same result as ormqr(); batched through
24/// strided-batch views. Meant for medium sizes, where the CTA kernels do not apply.
25/// @pre @p ctx is in-order (the pack / larft / GEMM steps are not separately ordered)
26/// @pre @p workspace holds at least ormqr_blocked_buffer_size() bytes (V, T and W)
27/// @throws batchlas::invalid_argument on mismatched batch or order, a short @p tau,
28/// or an out-of-order @p ctx
29/// @throws batchlas::unsupported for `Transpose::Trans` with complex T (use `ConjTrans`)
30/// @ingroup api_internal_helpers
31template <Backend B, typename T>
32BATCHLAS_API Event ormqr_blocked(Queue& ctx,
35 Side side,
36 Transpose trans,
37 Span<T> tau,
38 Span<std::byte> workspace,
39 int32_t block_size = tuning::ORMQR_BLOCK_SIZE_MEDIUM);
40
41/// @brief Workspace, in bytes, that ormqr_blocked() needs for this @p block_size.
42/// @ingroup api_internal_helpers
43template <Backend B, typename T>
44BATCHLAS_API size_t ormqr_blocked_buffer_size(Queue& ctx,
47 Side side,
48 Transpose trans,
49 Span<T> tau,
50 int32_t block_size = tuning::ORMQR_BLOCK_SIZE_MEDIUM);
51
52} // namespace batchlas
Non-owning view of a batch of matrices: the argument type of every entry point.
Definition matrix.hh:485
Enumerations, scalar traits and scalar concepts shared by every public header.
Transpose
The operator op() applied to an operand: op(A) = A, A^T or A^H.
Definition enums.hh:171
Side
Side on which a special operand multiplies: op(A) * B or B * op(A).
Definition enums.hh:319
Event ormqr_blocked(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, int32_t block_size=tuning::ORMQR_BLOCK_SIZE_MEDIUM)
Blocked native arm of ormqr(): applies Q with the compact WY form.
size_t ormqr_blocked_buffer_size(Queue &ctx, const MatrixView< T, MatrixFormat::Dense > &a, const MatrixView< T, MatrixFormat::Dense > &c, Side side, Transpose trans, Span< T > tau, int32_t block_size=tuning::ORMQR_BLOCK_SIZE_MEDIUM)
Workspace, in bytes, that ormqr_blocked() needs for this block_size.
The batched containers: Matrix (owning), MatrixView (non-owning), KernelMatrixView (device-side),...
constexpr int32_t ORMQR_BLOCK_SIZE_MEDIUM
Completion handle of enqueued work, returned by every entry point.
Where BatchLAS work runs: a device, a backend, an ordered SYCL queue and a workspace arena.
Non-owning view of size() contiguous elements of type T.
Definition sycl-span.hh:39
batchlas::Device, batchlas::Event and batchlas::Queue: where work runs and how it is ordered.
batchlas::Span, the non-owning pointer + length every entry point takes for 1-D data.
Tuning constants, bucketed by problem order n, with runtime BATCHLAS_TUNE_* overrides.