Parallel Reduction for rvalues#

Description#

oneAPI Threading Building Blocks (oneTBB) implementation extends the ParallelReduceFunc and ParallelReduceReduction to optimize operating with rvalues using functional form of tbb::parallel_reduce and tbb::parallel_deterministic_reduce algorithms.

API#

ParallelReduceFunc Requirements: Pseudo-Signature, Semantics#

Value Func::operator()(const Range &range, Value &&x) const#

or

Value Func::operator()(const Range &range, const Value &x) const#

Accumulates the result for a subrange, starting with initial value x. The Range type must meet the Range requirements <https://oneapi-spec.uxlfoundation.org/specifications/oneapi/latest/elements/onetbb/source/named_requirements/algorithms/range>_. The Value type must be the same as a corresponding template parameter for the parallel_reduce algorithm.

If both rvalue and lvalue forms are provided, the rvalue is preferred.

ParallelReduceReduction Requirements: Pseudo-Signature, Semantics#

Value Reduction::operator()(Value &&x, Value &&y) const#

or

Value Reduction::operator()(const Value &x, const Value &y) const#

Combines the x and y results. The Value type must be the same as a corresponding template parameter for the parallel_reduce algorithm.

If both rvalue and lvalue forms are provided, the rvalue is preferred.

Example#

See also