GrPPI  0.2
Generic and Reusable Parallel Pattern Interface
Functions
TBB parallel stream reduce pattern

TBB parallel implementation of the Stream reduction pattern. More...

Collaboration diagram for TBB parallel stream reduce pattern:

Functions

template<typename Identity , typename Generator , typename Combiner , typename Consumer >
void grppi::stream_reduce (parallel_execution_tbb &ex, int window_size, int offset, Identity identity, Generator &&generate_op, Combiner &&combine_op, Consumer consume_op)
 Invoke Stream reduction pattern on a stream with TBB parallel execution. More...
 

Detailed Description

TBB parallel implementation of the Stream reduction pattern.

Function Documentation

template<typename Identity , typename Generator , typename Combiner , typename Consumer >
void grppi::stream_reduce ( parallel_execution_tbb ex,
int  window_size,
int  offset,
Identity  identity,
Generator &&  generate_op,
Combiner &&  combine_op,
Consumer  consume_op 
)

Invoke Stream reduction pattern on a stream with TBB parallel execution.

Template Parameters
IdentityType of the identity value used by the combiner.
GeneratorCallable type used for generating data items.
CombinerCallable type used for data items combination.
ConsumerCallable type used for consuming data items.
Parameters
exTBB parallel execution policy object.
window_sizeNumber of consecutive items to be reduced.
offsetNumber of items after of which a new reduction is started.
identityIdentity value for the combination.
generate_opGeneration operation.
combine_opCombination operation.
consume_opConsume operation.