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

Can two partial accumulators of a reduction be combined? More...

#include <accumulator_traits.hpp>

Concept definition

template<typename Acc, typename Value>
concept mtl::math::mergeable_accumulator = requires(Acc& a, const Acc& b) {
}
Can two partial accumulators of a reduction be combined?
Definition accumulator_traits.hpp:339
static void merge(Acc &a, const Acc &b)
a += b : combine two partial accumulators of the same reduction, e.g.
Definition accumulator_traits.hpp:142

Detailed Description

Can two partial accumulators of a reduction be combined?

True for configurations 1 and 2, and for an ADL accumulator that provides accumulator_merge; false for a specialization without a merge. The reductions in dot.hpp and norms.hpp split across the thread pool only when this holds (#582), and otherwise run serially as before.