BatchLAS Documentation
BatchLAS
v0.1.0
src
ops
gemm
kernels
epilogue_linear.hh
Go to the documentation of this file.
1
#pragma once
2
3
namespace
batchlas::sycl_gemm
{
4
5
template
<
typename
T>
6
struct
LinearEpilogue
{
7
static
T
apply
(T alpha, T beta, T accum, T prior) {
8
return
alpha * accum + beta * prior;
9
}
10
11
// beta == 0 never reads C: 0 * NaN from a dirty workspace is NaN, and reference BLAS skips it.
12
// evidence: docs/design/known-defects.md#defect-11-native-gemm-reads-c-at-beta-zero
13
static
void
store
(T* dst, T alpha, T beta, T accum) {
14
*dst = beta == T(0) ? alpha * accum :
apply
(alpha, beta, accum, *dst);
15
}
16
};
17
18
}
// namespace batchlas::sycl_gemm
batchlas::sycl_gemm
Definition
gemm_kernels.hh:8
batchlas::sycl_gemm::LinearEpilogue
Definition
epilogue_linear.hh:6
batchlas::sycl_gemm::LinearEpilogue::apply
static T apply(T alpha, T beta, T accum, T prior)
Definition
epilogue_linear.hh:7
batchlas::sycl_gemm::LinearEpilogue::store
static void store(T *dst, T alpha, T beta, T accum)
Definition
epilogue_linear.hh:13
Generated by
1.18.0