27 #ifndef EMBB_ALGORITHMS_REDUCE_H_ 28 #define EMBB_ALGORITHMS_REDUCE_H_ 30 #include <embb/mtapi/job.h> 31 #include <embb/mtapi/execution_policy.h> 32 #include <embb/algorithms/identity.h> 35 namespace algorithms {
86 template<
typename RAI,
typename ReturnType,
typename ReductionFunction,
87 typename TransformationFunction>
96 ReductionFunction reduction,
98 TransformationFunction transformation = Identity(),
103 size_t block_size = 0
117 template<
typename RAI,
typename ReturnType>
131 template<
typename RAI,
typename ReturnType,
typename ReductionFunction>
136 ReductionFunction reduction,
145 template<
typename RAI,
typename ReturnType,
typename TransformationFunction>
151 TransformationFunction transformation,
159 template<
typename RAI,
typename ReturnType,
typename ReductionFunction,
160 typename TransformationFunction>
165 ReductionFunction reduction,
166 TransformationFunction transformation,
174 template<
typename RAI,
typename ReturnType,
typename ReductionFunction>
179 ReductionFunction reduction
181 return Reduce(first, last, neutral, reduction, Identity(),
188 template<
typename RAI,
typename ReturnType,
typename ReductionFunction,
189 typename TransformationFunction>
194 ReductionFunction reduction,
195 TransformationFunction transformation
197 return Reduce(first, last, neutral, reduction, transformation,
204 template<
typename RAI,
typename ReturnType,
typename ReductionFunction,
205 typename TransformationFunction>
210 ReductionFunction reduction,
211 TransformationFunction transformation,
214 return Reduce(first, last, neutral, reduction, transformation, policy, 0);
217 #endif // else DOXYGEN 226 #include <embb/algorithms/internal/reduce-inl.h> 228 #endif // EMBB_ALGORITHMS_REDUCE_H_ Definition: lock_free_mpmc_queue.h:40
ReturnType Reduce(RAI first, RAI last, ReturnType neutral, ReductionFunction reduction, TransformationFunction transformation=Identity(), const embb::mtapi::ExecutionPolicy &policy=embb::mtapi::ExecutionPolicy(), size_t block_size=0)
Performs a parallel reduction operation on a range of elements.
Represents a collection of Actions.
Definition: job.h:41
Describes the execution policy of a parallel algorithm.
Definition: execution_policy.h:48