21 #ifndef GRPPI_POLY_DIVIDECONQUER_H 22 #define GRPPI_POLY_DIVIDECONQUER_H 25 #include "../common/support.h" 29 template <
typename Input,
typename Div
ider,
typename Solver,
typename Combiner>
30 typename std::result_of<Solver(Input)>::type
33 Divider && divide_op, Solver && solve_op,
34 Combiner && combine_op)
39 template <
typename E,
typename ... O,
40 typename Input,
typename Divider,
typename Solver,
typename Combiner,
42 typename std::result_of<Solver(Input)>::type
45 Divider && divide_op, Solver && solve_op,
46 Combiner && combine_op)
49 std::forward<Divider>(divide_op), std::forward<Solver>(solve_op),
50 std::forward<Combiner>(combine_op) );
53 template <
typename E,
typename ... O,
54 typename Input,
typename Divider,
typename Solver,
typename Combiner,
56 typename std::result_of<Solver(Input)>::type
59 Divider && divide_op, Solver && solve_op,
60 Combiner && combine_op)
62 if (
typeid(E) == ex.
type()) {
65 std::forward<Divider>(divide_op), std::forward<Solver>(solve_op),
66 std::forward<Combiner>(combine_op));
70 std::forward<Divider>(divide_op), std::forward<Solver>(solve_op),
71 std::forward<Combiner>(combine_op));
97 template <
typename Input,
typename Div
ider,
typename Solver,
typename Combiner>
98 typename std::result_of<Solver(Input)>::type
101 Divider && divide_op, Solver && solve_op,
102 Combiner && combine_op)
110 std::forward<Divider>(divide_op), std::forward<Solver>(solve_op),
111 std::forward<Combiner>(combine_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::result_of< Solver(Input)>::type divide_conquer(parallel_execution_native &ex, Input &problem, Divider &÷_op, Solver &&solve_op, Combiner &&combine_op)
Invoke Divide/conquer pattern with native parallel execution.
Definition: native/divideconquer.h:124
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
std::result_of< Solver(Input)>::type divide_conquer_multi_impl(polymorphic_execution &ex, Input &input, Divider &÷_op, Solver &&solve_op, Combiner &&combine_op)
Definition: poly/divideconquer.h:31
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