gemm_kernels.hh
Go to the documentation of this file.
1#pragma once
2
3#include <src/util/internal-api.hh>
7
9
10// Trace identities only (BATCHLAS_KERNEL_TRACE names). Which kernel runs is decided by
11// src/ops/gemm/gemm.cc; each launcher below names the instantiation it took.
47
48// One launcher per gemm family (src/ops/gemm/choice.hh). Each serves exactly what its family's
49// can_run admits and throws batchlas::unsupported otherwise -- never a silent fallback to another
50// kernel. The transpose instantiation and the aligned/predicated leg are derived here.
51template <typename T>
52BATCHLAS_INTERNAL_API Event gemm_direct(Queue& ctx, const MatrixView<T, MatrixFormat::Dense>& A,
54 const MatrixView<T, MatrixFormat::Dense>& C, T alpha, T beta,
55 Transpose transA, Transpose transB);
56
57template <typename T>
58BATCHLAS_INTERNAL_API Event gemm_tiled(Queue& ctx, const MatrixView<T, MatrixFormat::Dense>& A,
60 const MatrixView<T, MatrixFormat::Dense>& C, T alpha, T beta,
61 Transpose transA, Transpose transB);
62
63// Real scalars, max(m, n, k) <= 64.
64template <typename T>
65BATCHLAS_INTERNAL_API Event gemm_small(Queue& ctx, const MatrixView<T, MatrixFormat::Dense>& A,
67 const MatrixView<T, MatrixFormat::Dense>& C, T alpha, T beta,
68 Transpose transA, Transpose transB);
69
70// float only; (tm, tn, tk, u) must be a row of ops::gemm::reg_configs instantiated for the form.
71BATCHLAS_INTERNAL_API Event gemm_reg(Queue& ctx, int tm, int tn, int tk, int u,
74 const MatrixView<float, MatrixFormat::Dense>& C, float alpha, float beta,
75 Transpose transA, Transpose transB);
76
77// (tm, tn, tk) must be a row of ops::gemm::wide_configs instantiated for the form.
78template <typename T>
79BATCHLAS_INTERNAL_API Event gemm_wide(Queue& ctx, int tm, int tn, int tk, const MatrixView<T, MatrixFormat::Dense>& A,
81 const MatrixView<T, MatrixFormat::Dense>& C, T alpha, T beta,
82 Transpose transA, Transpose transB);
83
84} // namespace batchlas::sycl_gemm
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
@ Direct
Full syev on a copy of A, then select the requested eigenpairs.
Definition enums.hh:385
The batched containers: Matrix (owning), MatrixView (non-owning), KernelMatrixView (device-side),...
BATCHLAS_INTERNAL_API Event gemm_direct(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)
BATCHLAS_INTERNAL_API Event gemm_reg(Queue &ctx, int tm, int tn, int tk, int u, const MatrixView< float, MatrixFormat::Dense > &A, const MatrixView< float, MatrixFormat::Dense > &B, const MatrixView< float, MatrixFormat::Dense > &C, float alpha, float beta, Transpose transA, Transpose transB)
BATCHLAS_INTERNAL_API Event gemm_wide(Queue &ctx, int tm, int tn, int tk, 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)
BATCHLAS_INTERNAL_API Event gemm_small(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)
BATCHLAS_INTERNAL_API Event gemm_tiled(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)
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.
batchlas::Device, batchlas::Event and batchlas::Queue: where work runs and how it is ordered.