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

Reduces the range along with the initial value init over op. More...

Functions

template<detail::simd_execution_policy ExecutionPolicy, detail::simd_execution_iterator It, typename F>
constexpr int vir::count_if (ExecutionPolicy pol, It first, It last, F &&pred)
 Count the elements in the input range matching pred (iterator overload)
 
template<detail::simd_execution_policy ExecutionPolicy, detail::simd_execution_range R, typename F>
constexpr int vir::count_if (ExecutionPolicy pol, R &&rg, F &&pred)
 Count the elements in the input range matching pred (range overload)
 
template<vir::detail::simd_execution_policy ExecutionPolicy, vir::detail::simd_execution_iterator It, typename F>
constexpr int std::count_if (ExecutionPolicy pol, It first, It last, F &&fun)
 Overloads std::count_if for vir::execution::simd.
 

Detailed Description

Reduces the range along with the initial value init over op.

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.
rgInput ranges modelling vir::detail::simd_execution_range.
predCallable that is invoked with multiple input elements in a simd object, returning a simd_mask indicating the elements to be counted.
Returns
The number of true values in all simd_mask objects returned from invocations of pred.