22 #ifndef GRPPI_POLY_FARM_H 23 #define GRPPI_POLY_FARM_H 26 #include "../common/support.h" 30 template <
typename Generator,
typename Consumer>
37 template <
typename Generator,
typename Transformer,
typename Consumer>
39 Transformer transform_op, Consumer consume_op)
43 template <
typename E,
typename ... O,
typename Generator,
typename Transformer,
46 Transformer && transform_op)
49 std::forward<Transformer>(transform_op));
52 template <
typename E,
typename ... O,
typename Generator,
typename Transformer,
54 internal::requires_execution_not_supported<E> = 0>
56 Transformer && transform_op, Consumer && consume_op)
59 std::forward<Transformer>(transform_op),
60 std::forward<Consumer>(consume_op));
65 template <
typename E,
typename ... O,
typename Generator,
typename Consumer,
68 Consumer && consume_op)
70 if (
typeid(E) == ex.
type()) {
72 std::forward<Consumer>(consume_op));
76 std::forward<Consumer>(consume_op));
81 template <
typename E,
typename ... O,
typename Generator,
typename Transformer,
typename Consumer,
82 internal::requires_execution_supported<E> = 0>
84 Transformer && transform_op, Consumer && consume_op)
86 if (
typeid(E) == ex.
type()) {
88 std::forward<Transformer>(transform_op),
89 std::forward<Consumer>(consume_op));
93 std::forward<Transformer>(transform_op),
94 std::forward<Consumer>(consume_op));
116 template <
typename Generator,
typename Consumer>
118 Consumer && consume_op)
125 >(ex, std::forward<Generator>(generate_op),
126 std::forward<Consumer>(consume_op));
140 template <
typename Generator,
typename Transformer,
typename Consumer>
142 Transformer && transform_op, Consumer && consume_op)
149 >(ex, std::forward<Generator>(generate_op),
150 std::forward<Transformer>(transform_op),
151 std::forward<Consumer>(consume_op));
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
auto farm(Execution &ex, Transformer &&transform_op)
Invoke Farm pattern on a data stream that can be composed in other streaming patterns.
Definition: farm.h:51
std::enable_if_t<!is_supported< E >(), int > requires_execution_not_supported
Definition: support.h:36
void farm_multi_impl(polymorphic_execution &ex, Generator generate_op, Consumer consume_op)
Definition: poly/farm.h:31