E.V.E
v2023.02.15
Loading...
Searching...
No Matches
fuse_operations

Detailed Description

Lets an algorithm run its operations as one.

Variables

constexpr auto eve::algo::fuse_operations = ::rbr::flag( fuse_operations_tag{} )

Variable Documentation

◆ fuse_operations

auto eve::algo::fuse_operations = ::rbr::flag( fuse_operations_tag{} )
inlineconstexpr
Header file #include <eve/module/algo.hpp>
namespace eve::algo
{
inline constexpr auto fuse_operations = eve_implementation_defined;
}
constexpr auto fuse_operations
Definition traits.hpp:616

Fuses the transformation and the accumulation of eve::algo::transform_reduce into a single call: the callable is given the running sum as a second argument and returns the new sum, a multiply and an add being a single eve::fma for example. By default the two are separate operations, the transformation then the addition. The addition and its zero are still used, to initialise the partial sums and to reduce them at the end.

std::vector<float> a(1024), b(1024);
// The callable takes the running sum too: one eve::fma replaces the multiply and the add.
auto dot = transform_reduce[fuse_operations](views::zip(a, b), [](auto p, auto sum) {
auto [x, y] = p;
return eve::fma(x, y, sum);
}, 0.f);
constexpr auto transform_reduce
SIMD version of std::transform_reduce for a single range.
Definition transform_reduce.hpp:177
constexpr auto dot
elementwise_callable object computing the elementwise dot product of the vector of the first half par...
Definition dot.hpp:92
constexpr auto fma
strict_elementwise_callable computing the fused multiply add of its three parameters.
Definition fma.hpp:100
constexpr auto zip
Given relaxed_iterors and relaxed ranges, zips them together (creates a single object)....
Definition zip.hpp:144
See also
expensive_callable