Games Task Scheduler (GTS)
A multi-processor scheduling framework for games engines
|
A construct that maps parallel-reduce behavior to a MicroScheduler. More...
#include <ParallelReduce.h>
Public Member Functions | |
GTS_INLINE | ParallelReduce (MicroScheduler &scheduler, uint32_t priority=0) |
template<typename TRange , typename TResultValue , typename TMapReduceFunc , typename TJoinFunc , typename TPartitioner = AdaptivePartitioner> | |
GTS_INLINE TResultValue | operator() (TRange const &range, TMapReduceFunc mapReduceFunc, TJoinFunc joinFunc, TResultValue identityValue, TPartitioner partitioner=AdaptivePartitioner(), void *userData=nullptr) |
A construct that maps parallel-reduce behavior to a MicroScheduler.
|
inline |
Creates a ParallelReduce object bound to the specified 'scheduler'. All parallel-reduce operations will be scheduled with the specified 'priority'.
|
inline |
Combines all the values in 'range' via 'reduceFunc'.
range | The divisible range to iterate over. |
mapReduceFunc | The function to execute on 'range'. Requires the signature: TResultValue mapReduceFunc(TRange range, void* userData, TaskContext const&). NOTE: This can be more that just a reduction operation. For instance one could fuse map-reduce here. |
joinFunc | The function that joins the results of mapReduceFunc to produce the final reduction value. Requires the signature: TResultValue joinFunc(TResultValue const& lhs, TResultValue const& rhs, void* userData, TaskContext const&). |
identityValue | An identity value for the join function. |
partitioner | The partitioner object that determines when work is subdivided during scheduling. |
userData | Optional data to be used in the passed in functions. |