Defines the number of computations an algorithm handles per loop step.
Variables | |
| template<int N> | |
| constexpr auto | eve::algo::unroll = (unroll_key = eve::index<N>) |
|
inlineconstexpr |
#include <eve/module/algo.hpp>| N | Registers handled per step, one or more. |
Sets the number of SIMD registers a loop step handles: N registers are processed before the loop condition is tested again, which spreads the loop overhead over more work and lets independent operations overlap. Simple algorithms are unrolled by default. A larger N is better when the body is short and its iterations are independent, and worse when the body is expensive or an iteration reads what the previous iteration wrote.
unroll<1> is no unrolling, a single register a step, and eve::algo::no_unrolling is its shorthand.