MTL5 -- Matrix Template Library C++ API
mtl:: -- C++20 header-only linear algebra for mixed-precision algorithm design
Loading...
Searching...
No Matches
mtl::simd::detail Namespace Reference

Blocking parameters for T using the compiled SIMD width and the target hardware traits. More...

Classes

struct  block_accumulator
 The 32-bit accumulator of a widening operand pair: the 16-bit pairs widen pairwise, the 8-bit pairs by four. More...
struct  block_accumulator< NA, NB, true >
struct  batch_access
 The lane operations the vector math functions are built on (#654), kept out of the public batch API: round to nearest, 2^k from integral lanes, and selects on a comparison. More...
struct  exp_constants
struct  exp_constants< float >
struct  exp_constants< double >

Functions

bool env_block_size (const char *name, std::size_t &out)
 A blocking override from environment variable name: a whole positive decimal that fits in std::size_t (digits only, no sign, space or trailing characters); false otherwise, and the derived value stays.
constexpr std::size_t ceil_div (std::size_t a, std::size_t b)
constexpr std::size_t round_up (std::size_t n, std::size_t m)
constexpr std::size_t round_down (std::size_t n, std::size_t m)
constexpr std::size_t isqrt_ceil (std::size_t n)
template<typename T>
constexpr blocking_params default_blocking_for_target ()

Detailed Description

Blocking parameters for T using the compiled SIMD width and the target hardware traits.

Compile-time, and the source of the mr x nr register tile (a micro-kernel template argument) everywhere.

MTL5_GEMM_MR_OVERRIDE=<n> is a DIAGNOSTIC (#643): it sets mr and nothing else, so a tile sweep can put 6x4, 8x4, 10x4 and 12x4 side by side from one source. The model cannot express those directly – vec_registers moves mr in steps of 3/4 of the file over NRVEC – and #351 had to sweep by editing fma_latency/fma_units, which also moves nr. A macro rather than the environment because mr is a template argument; the bench sidecar records it as mr_override, so a run cannot be mistaken for the shipped tile.

Function Documentation

◆ ceil_div()

std::size_t mtl::simd::detail::ceil_div ( std::size_t a,
std::size_t b )
constexpr

◆ default_blocking_for_target()

template<typename T>
blocking_params mtl::simd::detail::default_blocking_for_target ( )
constexpr

◆ env_block_size()

bool mtl::simd::detail::env_block_size ( const char * name,
std::size_t & out )
inline

A blocking override from environment variable name: a whole positive decimal that fits in std::size_t (digits only, no sign, space or trailing characters); false otherwise, and the derived value stays.

It was std::atol into a long, 32 bits on Windows against the std::size_t rule for sizes, which also read "96x" as 96 and an out-of-range value as whatever atol returned (issue 878).

◆ isqrt_ceil()

std::size_t mtl::simd::detail::isqrt_ceil ( std::size_t n)
constexpr

◆ round_down()

std::size_t mtl::simd::detail::round_down ( std::size_t n,
std::size_t m )
constexpr

◆ round_up()

std::size_t mtl::simd::detail::round_up ( std::size_t n,
std::size_t m )
constexpr