getri_native.hh
Go to the documentation of this file.
1#pragma once
2
3// Native batched GETRI declarations: the arm writes P straight into C, then two
4// routed trsm calls; zero workspace. evidence: docs/perf/lu.md#getri-window-evidence
5
6#include <src/util/internal-api.hh>
11
12#include <cstddef>
13#include <cstdint>
14#include <functional>
15
17
18template <typename T>
19BATCHLAS_INTERNAL_API bool getri_blocked_available();
20
21// Zero is the expected answer. Runs under BumpAllocator::measuring(): no workspace
22// access, no kernel launch, no A.data_ptr() dereference -- metadata only.
23template <typename T>
24BATCHLAS_INTERNAL_API std::size_t getri_blocked_buffer_size(Queue& ctx,
26
27// Must be the public trsm -- a native trsm entry point called from a driver TU
28// bypasses trsm's selection (src/ops/trsm). alpha comes THIRD, not last. Absent injection throws.
29template <typename T>
30using GetriSolveTrsm = std::function<Event(
31 Queue&,
34 T, Side, Uplo, Transpose, Diag)>;
35
36// Reachable without choose(), so it must re-check every clause of can_run(Blocked)
37// (src/ops/getri/getri.cc) and throw. A is read-only, A == C is
38// unsupported, and info is exact-zero semantics, not a tolerance. pivots keep getrf's
39// format: a 1-based interchange list, int32 packed into the int64 span on CUDA/ROCm.
40template <typename T>
41BATCHLAS_INTERNAL_API Event getri_blocked_dispatch(Queue& ctx,
44 Span<int64_t> pivots,
45 Span<std::byte> workspace,
46 Span<int32_t> info,
47 GetriSolveTrsm<T> solve_trsm = {});
48
49} // namespace batchlas::sycl_getri
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
Diag
Whether a triangular operand's diagonal is read or assumed to be one.
Definition enums.hh:303
Uplo
Which triangle of a symmetric, Hermitian or triangular operand is referenced.
Definition enums.hh:287
Side
Side on which a special operand multiplies: op(A) * B or B * op(A).
Definition enums.hh:319
The batched containers: Matrix (owning), MatrixView (non-owning), KernelMatrixView (device-side),...
std::function< Event( Queue &, const MatrixView< T, MatrixFormat::Dense > &, const MatrixView< T, MatrixFormat::Dense > &, T, Side, Uplo, Transpose, Diag)> GetriSolveTrsm
BATCHLAS_INTERNAL_API bool getri_blocked_available()
BATCHLAS_INTERNAL_API Event getri_blocked_dispatch(Queue &ctx, const MatrixView< T, MatrixFormat::Dense > &A, const MatrixView< T, MatrixFormat::Dense > &C, Span< int64_t > pivots, Span< std::byte > workspace, Span< int32_t > info, GetriSolveTrsm< T > solve_trsm={})
BATCHLAS_INTERNAL_API std::size_t getri_blocked_buffer_size(Queue &ctx, const MatrixView< T, MatrixFormat::Dense > &A)
Completion handle of enqueued work, returned by every entry point.
Event()
An empty Event, already complete.
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.