GrPPI  1.0
Generic and Reusable Parallel Pattern Interface
divideconquer.h
Go to the documentation of this file.
1 /*
2  * Copyright 2018 Universidad Carlos III de Madrid
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #ifndef GRPPI_DIVIDECONQUER_H
17 #define GRPPI_DIVIDECONQUER_H
18 
19 #include <utility>
20 
22 
23 namespace grppi {
24 
46 template <typename Execution, typename Input,
47  typename Divider, typename Solver, typename Combiner>
48 [[deprecated("Use newer divide_conquer with predicate arguemnt")]]
50  const Execution & ex,
51  Input && input,
52  Divider && divider_op,
53  Solver && solver_op,
54  Combiner && combiner_op)
55 {
56  static_assert(supports_divide_conquer<Execution>(),
57  "divide/conquer pattern not supported for execution type");
58  return ex.divide_conquer(std::forward<Input>(input),
59  std::forward<Divider>(divider_op), std::forward<Solver>(solver_op),
60  std::forward<Combiner>(combiner_op));
61 }
62 
78 template <typename Execution, typename Input,
79  typename Divider,typename Predicate, typename Solver, typename Combiner>
81  const Execution & ex,
82  Input && input,
83  Divider && divider_op,
84  Predicate && predicate_op,
85  Solver && solver_op,
86  Combiner && combiner_op)
87 {
88  static_assert(supports_divide_conquer<Execution>(),
89  "divide/conquer pattern not supported for execution type");
90  return ex.divide_conquer(std::forward<Input>(input),
91  std::forward<Divider>(divider_op),
92  std::forward<Predicate>(predicate_op),
93  std::forward<Solver>(solver_op),
94  std::forward<Combiner>(combiner_op));
95 }
96 
102 }
103 
104 #endif
auto divide_conquer(const Execution &ex, Input &&input, Divider &&divider_op, Solver &&solver_op, Combiner &&combiner_op)
Invoke md_divide-conquer. \parapm Execution Execution type.
Definition: divideconquer.h:49
Definition: callable_traits.h:21