Games Task Scheduler (GTS)
A multi-processor scheduling framework for games engines
|
A MacroScheduler builds ISchedules for a set of ComputeResources from a DAG of Node. More...
#include <MacroScheduler.h>
Inherited by gts::CentralQueue_MacroScheduler, and gts::CriticalNode_MacroScheduler.
Public Member Functions | |
virtual | ~MacroScheduler () |
virtual bool | init (MacroSchedulerDesc const &desc)=0 |
ComputeResource * | findComputeResource (ComputeResourceId id) |
Vector< ComputeResource * > const & | computeResources () const |
Vector< ComputeResource * > & | computeResources () |
Node * | allocateNode () |
void | destroyNode (Node *pNode) |
virtual void | freeSchedule (Schedule *pSchedule)=0 |
virtual Schedule * | buildSchedule (Node *pStart, Node *pEnd)=0 |
virtual void | executeSchedule (Schedule *pSchedule, ComputeResourceId id)=0 |
Protected Member Functions | |
void * | _allocateWorkload (size_t size) |
void | _freeWorkload (void *ptr) |
Protected Attributes | |
Vector< ComputeResource * > | m_computeResources |
Friends | |
class | Node |
A MacroScheduler builds ISchedules for a set of ComputeResources from a DAG of Node.
|
virtual |
For polymorphic destruction.
Node* gts::MacroScheduler::allocateNode | ( | ) |
Builds a schedule from the specified DAG that begins at 'pStart' and ends at 'pEnd'.
Implemented in gts::CentralQueue_MacroScheduler, and gts::CriticalNode_MacroScheduler.
Vector<ComputeResource*>& gts::MacroScheduler::computeResources | ( | ) |
Vector<ComputeResource*> const& gts::MacroScheduler::computeResources | ( | ) | const |
void gts::MacroScheduler::destroyNode | ( | Node * | pNode | ) |
Free pNode from memory.
|
pure virtual |
Executes the specified 'pSchedule' and uses the specified ComputeResource 'id' for the calling thread. Setting 'id' to UNKNOWN_COMP_RESOURCE will not use the calling thread.
Implemented in gts::CriticalNode_MacroScheduler, and gts::CentralQueue_MacroScheduler.
ComputeResource* gts::MacroScheduler::findComputeResource | ( | ComputeResourceId | id | ) |
|
pure virtual |
Free an existing Schedule from memory.
Implemented in gts::CentralQueue_MacroScheduler, and gts::CriticalNode_MacroScheduler.
|
pure virtual |
Initializes the IMacroScheduler object based on 'desc'.
Implemented in gts::CentralQueue_MacroScheduler, and gts::CriticalNode_MacroScheduler.