|
MTL5 -- Matrix Template Library C++ API
mtl:: -- C++20 header-only linear algebra for mixed-precision algorithm design
|
Configuration 2 – fused multiply-add accumulator. More...
#include <accumulator_traits.hpp>
Public Attributes | |
| T | sum = math::zero<T>() |
Configuration 2 – fused multiply-add accumulator.
A distinguished accumulator type that selects the FMA reduction: pass it as the Acc template argument to any accumulator-aware operation to fuse each m*v into the running sum, so the intermediate product is never rounded (one rounding per term instead of two). T is the accumulation precision held in registers; it need not equal the element precision Value.
T is intentionally unconstrained so this stays usable by custom arithmetic types: the fused step is using std::fma; fma(...), which selects std::fma for the built-in floating types and, via ADL, a type-specific fused multiply- add for a custom number type (e.g. a posit fma). A type that has no fused operation simply does not satisfy the call and is not a valid T.
| T mtl::math::fma_accumulator< T >::sum = math::zero<T>() |