21 #ifndef GRPPI_POLY_STREAM_REDUCE_H 22 #define GRPPI_POLY_STREAM_REDUCE_H 25 #include "../common/support.h" 29 template <
typename Identity,
typename Combiner,
typename Consumer,
typename Generator>
31 Identity identity, Generator && generate_op,
32 Combiner && combine_op, Consumer && consume_op)
36 template <
typename E,
typename ... O,
typename Identity,
37 typename Generator,
typename Combiner,
typename Consumer,
40 Identity identity, Generator && gen,
41 Combiner && comb, Consumer && cons)
44 windowsize, offset, identity,
45 std::forward<Generator>(gen),
46 std::forward<Combiner>(comb),
47 std::forward<Consumer>(cons)
51 template <
typename E,
typename ... O,
typename Identity,
52 typename Generator,
typename Combiner,
typename Consumer,
55 Identity identity, Generator && gen,
56 Combiner && comb, Consumer && cons)
58 if (
typeid(E) == ex.
type()) {
60 windowsize, offset, identity,
61 std::forward<Generator>(gen),
62 std::forward<Combiner>(comb),
63 std::forward<Consumer>(cons)
68 windowsize, offset, identity,
69 std::forward<Generator>(gen),
70 std::forward<Combiner>(comb),
71 std::forward<Consumer>(cons)
99 template <
typename Identity,
typename Generator,
typename Combiner,
typename Consumer>
101 int windowsize,
int offset, Identity identity,
102 Generator && gen, Combiner && comb, Consumer && cons)
109 >(ex, windowsize, offset, identity,
110 std::forward<Generator>(gen),
111 std::forward<Combiner>(comb),
112 std::forward<Consumer>(cons)
Definition: callable_traits.h:24
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
void stream_reduce(parallel_execution_native &ex, int window_size, int offset, Identity identity, Generator &&generate_op, Combiner &&combine_op, Consumer &&consume_op)
Invoke Stream reduction pattern on a stream with native parallel execution.
Definition: native/stream_reduce.h:56
void stream_reduce_multi_impl(polymorphic_execution &ex, int window_size, int offset, Identity identity, Generator &&generate_op, Combiner &&combine_op, Consumer &&consume_op)
Definition: poly/stream_reduce.h:30