21 #ifndef GRPPI_POLY_REDUCE_H 22 #define GRPPI_POLY_REDUCE_H 25 #include "../common/support.h" 29 template <
typename InputIt,
typename Identity,
typename Combiner>
31 InputIt first, InputIt last,
33 Combiner &&combine_op) -> decltype(combine_op(*first,*first))
40 template <
typename E,
typename ... O,
41 typename InputIt,
typename Identity,
typename Combiner,
44 InputIt first, InputIt last,
46 Combiner && combine_op)
48 return reduce_multi_impl<O...>(ex, first, last, identity, std::forward<Combiner>(combine_op));
53 template <
typename E,
typename ... O,
54 typename InputIt,
typename Identity,
typename Combiner,
57 InputIt first, InputIt last,
59 Combiner &&combine_op)
61 if (
typeid(E) == ex.
type()) {
63 first, last, identity, std::forward<Combiner>(combine_op));
66 return reduce_multi_impl<O...>(ex, first, last, identity, std::forward<Combiner>(combine_op));
91 template <
typename InputIt,
typename Identity,
typename Combiner>
93 InputIt first, InputIt last,
95 Combiner &&combine_op)
102 >(e, first, last, identity, std::forward<Combiner>(combine_op));
Definition: callable_traits.h:24
auto reduce_multi_impl(polymorphic_execution &ex, InputIt first, InputIt last, Identity identity, Combiner &&combine_op) -> decltype(combine_op(*first,*first))
Definition: poly/reduce.h:30
Native parallel execution policy. This policy uses ISO C++ threads as implementation building block a...
Definition: parallel_execution_native.h:136
const std::type_info & type() const noexcept
Definition: polymorphic_execution.h:77
std::enable_if_t< is_supported< E >(), int > requires_execution_supported
Definition: support.h:32
OpenMP parallel execution policy.
Definition: parallel_execution_omp.h:40
TBB parallel execution policy.
Definition: parallel_execution_tbb.h:37
E * execution_ptr()
Get the execution pointer for a given type.
Definition: polymorphic_execution.h:91
Sequential execution policy.
Definition: sequential_execution.h:31
Definition: polymorphic_execution.h:63
std::enable_if_t<!is_supported< E >(), int > requires_execution_not_supported
Definition: support.h:36
auto reduce(parallel_execution_native &ex, InputIt first, InputIt last, Identity identity, Combiner &&combine_op)
Invoke Reduce pattern with identity value on a data sequence with parallel native execution...
Definition: native/reduce.h:51