Template Function poet::dynamic_for(T1, T2, T3, Func&&)
Defined in File dynamic_for.hpp
Function Documentation
-
template<std::size_t Unroll, typename T1, typename T2, typename T3, typename Func, std::enable_if_t<detail::is_df_callable_v<std::remove_reference_t<Func>, std::common_type_t<T1, T2, T3>>, int> = 0>
void poet::dynamic_for(T1 begin, T2 end, T3 step, Func &&func) Executes a runtime-sized loop using compile-time unrolling.
Iterates over
[begin, end)with the givenstep, emitting blocks ofUnrolliterations.step == 1selects the compile-time-stride path.- Template Parameters:
Unroll – Iterations per unrolled block, exactly: the compiler does not unroll the main loop further, and a range of exactly
Unrollis one block and no loop. No default: choose per call site.2small codegen,4balanced,8profiled hot loops,1a loop that stays rolled.- Parameters:
begin – Inclusive start bound.
end – Exclusive end bound.
step – Increment per iteration. May be negative.
func – Callable invoked per iteration, in either form:
func(std::integral_constant<std::size_t, lane>{}, index): lane as typefunc(index): index only