#include <iparallelforinterface.h>
Provides an abstract base interface for an object that can treat computational jobs in parallel.
This class cannot be used as-is; you must use an instance of a class that derives from IParallelForInterface and that implements its virtual methods. Gameware Navigation provides a default implementation, KyGlue::TbbParallelForInterface, which uses the Threaded Building Blocks (TBB) libraries from Intel to manage the parallel execution of its computational jobs. You can also create your own implementation of IParallelForInterface if you need to support a different parallel computing system. For an example implementation, see the code for the KyGlue::TbbParallelForInterface class, available in the integration directory.
Inherits Kaim::RefCountBaseV< C, Stat >.
Inherited by KyGlue::TbbParallelForInterface.
Public Member Functions | |
virtual KyResult | Init ()=0 |
virtual KyResult | ParallelFor (void **elements, KyUInt32 elementsCount, Kaim::IParallelElementFunctor *functor)=0 |
virtual KyResult | Terminate ()=0 |
|
pure virtual |
This method is expected to perform whatever steps are needed to initialize the parallelization mechanism.
Called once by the Generator at the beginning of the data generation process.
Implemented in KyGlue::TbbParallelForInterface.
|
pure virtual |
This is the main method of the IParallelForInterface: it is called by Gameware Navigation to manage the parallel execution of an array of computational jobs.
An implementation of this method should call the IParallelElementFunctor::Do() method for each element in the elements array.
elements | An array of void pointers, each of which points to a computational job that needs to be carried out. |
elementsCount | The number of elements in theelements array. |
functor | A pointer to the object that should be responsible for actually treating each element in the elements array. |
Implemented in KyGlue::TbbParallelForInterface.
|
pure virtual |
This method is expected to perform whatever steps are needed to shut down the parallelization mechanism.
Called once by the Generator at the end of the data generation process.
Implemented in KyGlue::TbbParallelForInterface.