batmat develop
Batched linear algebra routines
Loading...
Searching...
No Matches
batmat::linalg::micro_kernels::syomv Namespace Reference

Classes

struct  KernelConfig

Functions

template<class T, class Abi, KernelConfig Conf, index_t RowsReg, StorageOrder OA, StorageOrder OB, StorageOrder OD>
void syomv_microkernel (const uview< const T, Abi, OA > A, const uview< const T, Abi, OB > B, const uview< T, Abi, OD > D, const index_t l0, const index_t k) noexcept
 Symmetric off-diagonal block multiply. Single register block.
template<class T, class Abi, KernelConfig Conf, StorageOrder OA, StorageOrder OB, StorageOrder OD>
void syomv_register (const view< const T, Abi, OA > A, const view< const T, Abi, OB > B, const view< T, Abi, OD > D) noexcept
 Generalized matrix multiplication D = C ± A⁽ᵀ⁾ B⁽ᵀ⁾. Using register blocking.

Variables

template<class T, class Abi, KernelConfig Conf, StorageOrder OA, StorageOrder OB, StorageOrder OD>
const constinit auto syomv_lut
template<class T, class Abi>
constexpr index_t RowsReg
 Register block size of the matrix-matrix multiplication micro-kernels.

Class Documentation

◆ batmat::linalg::micro_kernels::syomv::KernelConfig

struct batmat::linalg::micro_kernels::syomv::KernelConfig
Class Members
bool negate = false
MatrixStructure struc_A = MatrixStructure::LowerTriangular

Function Documentation

◆ syomv_microkernel()

template<class T, class Abi, KernelConfig Conf, index_t RowsReg, StorageOrder OA, StorageOrder OB, StorageOrder OD>
void batmat::linalg::micro_kernels::syomv::syomv_microkernel ( uview< const T, Abi, OA > A,
uview< const T, Abi, OB > B,
uview< T, Abi, OD > D,
index_t l0,
index_t k )
noexcept

Symmetric off-diagonal block multiply. Single register block.

Definition at line 24 of file syomv.tpp.

◆ syomv_register()

template<class T, class Abi, KernelConfig Conf, StorageOrder OA, StorageOrder OB, StorageOrder OD>
void batmat::linalg::micro_kernels::syomv::syomv_register ( view< const T, Abi, OA > A,
view< const T, Abi, OB > B,
view< T, Abi, OD > D )
noexcept

Generalized matrix multiplication D = C ± A⁽ᵀ⁾ B⁽ᵀ⁾. Using register blocking.

Definition at line 63 of file syomv.tpp.

Variable Documentation

◆ syomv_lut

template<class T, class Abi, KernelConfig Conf, StorageOrder OA, StorageOrder OB, StorageOrder OD>
const constinit auto batmat::linalg::micro_kernels::syomv::syomv_lut
inlineconstinit
Initial value:
=
})
consteval auto make_1d_lut(F f)
Returns an array of the form:
Definition lut.hpp:39
void syomv_microkernel(uview< const T, Abi, OA > A, uview< const T, Abi, OB > B, uview< T, Abi, OD > D, index_t l0, index_t k) noexcept
Symmetric off-diagonal block multiply. Single register block.
Definition syomv.tpp:24
std::integral_constant< index_t, I > index_constant
Definition lut.hpp:10

Definition at line 15 of file syomv.tpp.

◆ RowsReg

template<class T, class Abi>
index_t batmat::linalg::micro_kernels::gemm::RowsReg
inlineconstexpr

Register block size of the matrix-matrix multiplication micro-kernels.

AVX-512 has 32 vector registers, we use 25 registers for a 5×5 accumulator block of matrix C (leaving some registers for loading A and B):

AVX2 has 16 vector registers, we use 9 registers for a 3×3 accumulator block of matrix C (leaving some registers for loading A and B):

Note
A block size of 4×4 is slightly faster than 3×3 for large matrices, because the even block size results in full cache lines being consumed. For small matrices, 3×3 is faster because it does not spill any registers in the micro-kernels. 2×2 is slower than 3×3 for both small and large matrices (tested using GCC 15.1 on an i7-10750H).

Assumes that the platform has at least 16 vector registers, we use 9 registers for a 3×3 accumulator block of matrix C (leaving some registers for loading A and B):

NEON has 32 vector registers, we use 16 registers for a 4×4 accumulator block of matrix C (leaving plenty of registers for loading A and B):

Definition at line 13 of file avx-512.hpp.