Games Task Scheduler (GTS)
A multi-processor scheduling framework for games engines
|
A Node represents a task in a generalized task DAG. It contains Workloads that are scheduled onto a ComputeResource by a MacroScheduler. More...
#include <Node.h>
Public Types | |
enum | { NODE_NAME_MAX = 64 } |
Public Member Functions | |
Node (MacroScheduler *pMyScheduler) | |
Workload * | findWorkload (WorkloadType::Enum type) const |
Atomic< uint32_t > const & | currPredecessorCount () const |
uint32_t | initPredecessorCount () const |
GTS_INLINE Vector< Node * > const & | predecessors () const |
GTS_INLINE Vector< Node * > const & | successors () const |
bool | isChild (Node *pChild) const |
GTS_INLINE MacroScheduler * | myScheduler () |
GTS_INLINE Schedule * | currentSchedule () |
GTS_INLINE ComputeResourceId | affinity () const |
GTS_INLINE const char * | name () const |
GTS_INLINE Atomic< uint64_t > const & | upRank () const |
GTS_INLINE Atomic< uint64_t > const & | downRank () const |
GTS_INLINE uint64_t | executionCost () const |
GTS_INLINE Vector< Node * > & | predecessors () |
GTS_INLINE Vector< Node * > & | successors () |
template<typename TWorkload , typename... TArgs> | |
GTS_INLINE TWorkload * | addWorkload (TArgs &&... args) |
Allocates a new Workload object of type TWorkload. More... | |
template<typename TLambdaWorkload , typename TFunc , typename... TArgs> | |
GTS_INLINE TLambdaWorkload * | addWorkload (TFunc &&func, TArgs &&... args) |
Allocates a new Workload object of type TLambdaWorkload. More... | |
void | removeWorkload (WorkloadType::Enum type) |
Removed a workload by its WorkloadType. More... | |
void | reset () |
Reset the state of this Node for another execution. | |
void | addSuccessor (Node *pNode) |
Add the sucessor Node 'pNode'. More... | |
void | removeSuccessor (Node *pNode) |
Remove the sucessor Node 'pNode'. More... | |
void | setName (const char *format,...) |
Set the name of this Node. | |
GTS_INLINE Atomic< uint64_t > & | upRank () |
GTS_INLINE Atomic< uint64_t > & | downRank () |
GTS_INLINE void | setAffinity (ComputeResourceId affinity) |
Sets the ID of the ComputeResource that must execute this Node. More... | |
GTS_INLINE bool | _removePredecessorRefAndReturnReady () |
Specifies the ComputeResource that must execute this Workload. More... | |
GTS_INLINE void | _markPredecessorComplete () |
Mark one predecessor as complete. More... | |
GTS_INLINE void | _waitUntilComplete () const |
Waits for all predecessors to tally their completion. More... | |
GTS_INLINE void | _setCurrentSchedule (Schedule *pSchedule) |
Sets this Node's current Schedule. More... | |
GTS_INLINE void | _setExecutionCost (uint64_t exeCost) |
Sets the execution cost of this Node. More... | |
Static Public Member Functions | |
static void | resetGraph (Node *pSource) |
Resets all Nodes in the graph. More... | |
Friends | |
class | CriticiallyAware_Schedule |
A Node represents a task in a generalized task DAG. It contains Workloads that are scheduled onto a ComputeResource by a MacroScheduler.
|
inline |
Mark one predecessor as complete.
|
inline |
Specifies the ComputeResource that must execute this Workload.
Remove a predecessor reference and check if the Node is ready to run.
|
inline |
|
inline |
Sets the execution cost of this Node.
|
inline |
Waits for all predecessors to tally their completion.
void gts::Node::addSuccessor | ( | Node * | pNode | ) |
|
inline |
Allocates a new Workload object of type TWorkload.
args | The arguments for the TWorkload constructor. |
|
inline |
Allocates a new Workload object of type TLambdaWorkload.
args | The arguments for the TLambdaWorkload constructor. |
|
inline |
|
inline |
Atomic<uint32_t> const& gts::Node::currPredecessorCount | ( | ) | const |
|
inline |
|
inline |
Workload* gts::Node::findWorkload | ( | WorkloadType::Enum | type | ) | const |
uint32_t gts::Node::initPredecessorCount | ( | ) | const |
|
inline |
|
inline |
void gts::Node::removeSuccessor | ( | Node * | pNode | ) |
void gts::Node::removeWorkload | ( | WorkloadType::Enum | type | ) |
Removed a workload by its WorkloadType.
|
static |
Resets all Nodes in the graph.
|
inline |
Sets the ID of the ComputeResource that must execute this Node.