vir-simd 0.4.189
Parallelism TS 2 extensions and simd fallback implementation
Loading...
Searching...
No Matches
Algorithm: for-each

Iterate over the given range (iterator overload). More...

Functions

template<detail::simd_execution_policy ExecutionPolicy, detail::simd_execution_iterator It, typename F>
constexpr void vir::for_each (ExecutionPolicy pol, It first, It last, F &&fun)
 Iterate over the given range (iterator overload).
 
template<detail::simd_execution_policy ExecutionPolicy, detail::simd_execution_range R, typename F>
constexpr void vir::for_each (ExecutionPolicy pol, R &&rng, F &&fun)
 Iterate over the given range (range overload).
 
template<vir::detail::simd_execution_policy ExecutionPolicy, vir::detail::simd_execution_iterator It, typename F>
constexpr void std::for_each (ExecutionPolicy pol, It first, It last, F &&fun)
 Overloads std::for_each for vir::execution::simd.
 

Detailed Description

Iterate over the given range (iterator overload).

std::for_each except that fun is called with multiple values out of the input range via simd arguments.

Parameters
polNeeds to be vir::execution::simd or one of the derived types returned from its modifiers. (vir::detail::simd_execution_policy)
first,lastIterator pair modelling vir::detail::simd_execution_iterator.
rngInput ranges modelling vir::detail::simd_execution_range.
funCallable to be invoked per chunk of input elements. If the function parameter of fun is declared as an lvalue reference, the for_each implementation assumes it needs to write back the argument after fun returns.