21 #ifndef GRPPI_POLY_STENCIL_H 22 #define GRPPI_POLY_STENCIL_H 25 #include "../common/support.h" 29 template <
typename InputIt,
typename OutputIt,
typename StencilTransformer,
typename Neighbourhood>
31 OutputIt first_out, StencilTransformer && op, Neighbourhood && neighbor)
35 template <
typename InputIt,
typename OutputIt,
typename StencilTransformer,
36 typename Neighbourhood,
typename ... OtherInputIts>
38 OutputIt first_out, StencilTransformer && op, Neighbourhood && neighbor,
39 OtherInputIts ... other_its)
45 template <
typename E,
typename ... O,
46 typename InputIt,
typename OutputIt,
typename StencilTransformer,
typename Neighbourhood,
49 OutputIt first_out, StencilTransformer && op, Neighbourhood && neighbor)
51 stencil_multi_impl<O...>(e, first, last, first_out, std::forward<StencilTransformer>(op),
52 std::forward<Neighbourhood>(neighbor));
55 template <
typename E,
typename ... O,
56 typename InputIt,
typename OutputIt,
typename StencilTransformer,
57 typename Neighbourhood,
typename ... OtherInputIts,
58 internal::requires_execution_not_supported<E> = 0>
60 OutputIt first_out, StencilTransformer && op, Neighbourhood && neighbor,
61 OtherInputIts ... other_its)
63 stencil_multi_impl<O...>(e, first, last, first_out, std::forward<StencilTransformer>(op),
64 std::forward<Neighbourhood>(neighbor), other_its...);
69 template <
typename E,
typename ... O,
70 typename InputIt,
typename OutputIt,
typename StencilTransformer,
typename Neighbourhood,
73 OutputIt first_out, StencilTransformer && op, Neighbourhood && neighbor)
75 if (
typeid(E) == e.
type()) {
77 first, last, first_out, std::forward<StencilTransformer>(op),
78 std::forward<Neighbourhood>(neighbor));
81 stencil_multi_impl<O...>(e, first, last, first_out, std::forward<StencilTransformer>(op),
82 std::forward<Neighbourhood>(neighbor));
86 template <
typename E,
typename ... O,
87 typename InputIt,
typename OutputIt,
typename StencilTransformer,
88 typename Neighbourhood,
typename ... OtherInputIts,
89 internal::requires_execution_supported<E> = 0>
91 OutputIt first_out, StencilTransformer && op, Neighbourhood && neighbor,
92 OtherInputIts ... other_its)
94 if (
typeid(E) == e.
type()) {
96 first, last, first_out, std::forward<StencilTransformer>(op), std::forward<Neighbourhood>(neighbor),
100 stencil_multi_impl<O...>(e, first, last, first_out, std::forward<StencilTransformer>(op),
101 std::forward<Neighbourhood>(neighbor), other_its...);
127 template <
typename InputIt,
typename OutputIt,
typename StencilTransformer,
128 typename Neighbourhood>
130 InputIt first, InputIt last, OutputIt first_out,
131 StencilTransformer && transform_op, Neighbourhood && neighbour_op)
138 >(ex, first, last, first_out,
139 std::forward<StencilTransformer>(transform_op),
140 std::forward<Neighbourhood>(neighbour_op));
159 template <
typename InputIt,
typename OutputIt,
typename StencilTransformer,
160 typename Neighbourhood,
typename ... OtherInputIts>
162 InputIt first, InputIt last, OutputIt first_out,
163 StencilTransformer && transform_op, Neighbourhood && neighbour_op,
164 OtherInputIts ... other_its)
171 >(ex, first, last, first_out,
172 std::forward<StencilTransformer>(transform_op),
173 std::forward<Neighbourhood>(neighbour_op),
Definition: callable_traits.h:24
void stencil(parallel_execution_native &ex, InputIt first, InputIt last, OutputIt first_out, StencilTransformer transform_op, Neighbourhood neighbour_op)
Invoke Stencil pattern on a data sequence with native parallel execution.
Definition: native/stencil.h:53
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
void stencil_multi_impl(polymorphic_execution &e, InputIt first, InputIt last, OutputIt first_out, StencilTransformer &&op, Neighbourhood &&neighbor)
Definition: poly/stencil.h:30
std::enable_if_t<!is_supported< E >(), int > requires_execution_not_supported
Definition: support.h:36