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

Detailed Description

Options that tune how an algorithm runs.

An option tunes the way an algorithm runs: the width of its loop step, the type it computes in, what it may assume of its ranges. Every algorithm carries a default set, tuned for the common case, and takes options between brackets, before its arguments, one pair per option; those a call passes override the defaults, and those it leaves out keep their default value:

find_if[unroll<8>][expensive_callable](data, [](auto x) { return x > 0.f; });
constexpr auto expensive_callable
Definition traits.hpp:538
constexpr auto unroll
Definition traits.hpp:172
constexpr auto find_if
SIMD version of std::find_if.
Definition find.hpp:130

The options come in three kinds, listed below: the lanes and the types an algorithm computes on, the shape of its loop, and the preconditions a call asserts on its ranges.

Note
eve::algo::traits, the set of options several calls share, the two sets the library predefines, and the reading of options from within an algorithm are the developer's side, Algorithm Traits.

Contents

 Lanes and types
 Options that choose the lanes an algorithm computes on, and the types it computes in.
 Loop
 Options that shape the loop: its step, its alignment, what it fuses, how it searches.
 Range preconditions
 Preconditions on the ranges, which an algorithm turns into a shorter loop.