![]() |
|
Used to make a VdfSchedule. More...
#include <scheduler.h>
Public Types | |
| typedef std::vector< std::pair< VdfPoolChainIndex, const VdfOutput * > > | PoolPriorityVector |
| using | NodeToRequestMap |
| A map from VdfNode * to VdfMaskedOutputVector. | |
Public Member Functions | |
| VDF_API | VdfScheduler (const std::atomic_bool *interruptionFlag) |
| Constructs a scheduler. | |
| VDF_API bool | CreateSchedule (const VdfRequest &request, VdfSchedule *schedule, bool topologicallySort) |
| Generates a schedule. | |
Static Public Member Functions | |
| static VDF_API void | Schedule (const VdfRequest &request, VdfSchedule *schedule, bool topologicallySort) |
| Generates a schedule. | |
| static VDF_API bool | UpdateAffectsMaskForOutput (VdfSchedule *schedule, const VdfOutput &output) |
Update schedule after the affects mask changed on output. | |
Protected Member Functions | |
| bool | _HasBeenInterrupted () const |
Returns true if the scheduler has been interrupted, if the scheduler supports interruption. | |
| VDF_API bool | _InitializeRequestMasks (const VdfRequest &request, VdfSchedule *schedule, PoolPriorityVector *poolOutputs) |
Initializes the request masks for all the outputs that will be computed as a result of request. | |
| VDF_API bool | _ScheduleBufferPasses (const VdfRequest &request, VdfSchedule *schedule) |
| Method to schedule the buffer passes and the "keep" masks for the scheduled nodes. | |
| VDF_API bool | _ScheduleForPassThroughs (const VdfRequest &request, VdfSchedule *schedule, const PoolPriorityVector &sortedPoolOutputs) |
| Schedule the outputs from which buffers should be passed. | |
| VDF_API void | _GenerateTasks (VdfSchedule *schedule, const PoolPriorityVector &sortedPoolOutputs) |
| Generate tasks for the scheduled task graph. | |
| VDF_API bool | _ScheduleTaskGraph (VdfSchedule *schedule, const PoolPriorityVector &sortedPoolOutputs) |
| Schedule the task graph for multi-threaded munging. | |
| VDF_API bool | _ApplyAffectsMasks (VdfSchedule *schedule) |
| Applies the affects mask to the schedule. | |
Static Protected Member Functions | |
| static VDF_API void | _SetScheduleValid (VdfSchedule *schedule, const VdfNetwork *network) |
Method to signal that a schedule is done being built and that it is now valid for the given network. | |
| static VDF_API void | _MarkSmallSchedule (VdfSchedule *schedule) |
| Marks the schedule as small if it is indeed small. | |
| static VDF_API void | _ComputeLockMasks (const VdfRequest &request, VdfSchedule *schedule, const PoolPriorityVector &sortedPoolOutputs) |
| Setup the lock masks require for sparse mung buffer locking for all the outputs in the pool chain. | |
| static VDF_API bool | _ApplyAffectsMasksForNode (VdfScheduleNode *node) |
| Applies the affects masks to the scheduled node. | |
| static VDF_API void | _UpdateAffectsMaskForInvocation (VdfSchedule *schedule, VdfScheduleNode *node) |
| Updates the affects mask on an existing scheduled node invocation. | |
| static VDF_API bool | _UpdateAffectsMasksForNode (VdfSchedule *schedule, VdfScheduleNode *node) |
Updates schedule for node if affects mask changed. | |
| static VDF_API void | _UpdateLockMaskForNode (VdfSchedule *schedule, VdfScheduleNode *node) |
Updates schedule for node if the lock mask changed. | |
Used to make a VdfSchedule.
Definition at line 40 of file scheduler.h.
| using NodeToRequestMap |
A map from VdfNode * to VdfMaskedOutputVector.
Definition at line 49 of file scheduler.h.
| std::vector< std::pair<VdfPoolChainIndex, const VdfOutput *> > PoolPriorityVector |
Definition at line 46 of file scheduler.h.
| VDF_API VdfScheduler | ( | const std::atomic_bool * | interruptionFlag | ) |
Constructs a scheduler.
If include is non-null, the pointed-to atomic flag is checked during scheduling to determine if the client has requested scheduling to be interrupted. If scheduling is interrupted, CreateSchedule attempts to return quickly (on the order of a few ms), leaving the resulting schedule in an unknown state.
|
protected |
Applies the affects mask to the schedule.
Returns false if scheduling has been interrupted.
|
staticprotected |
Applies the affects masks to the scheduled node.
This mask is the ANDing of the request mask and the affects mask (if any). It is used by iterators to quickly skip only to the elements that are affected by the node. It is an optional mask, and if it doesn't exist, the scheduled affects mask will simply be request mask (a super set of the truly affected elements).
|
staticprotected |
Setup the lock masks require for sparse mung buffer locking for all the outputs in the pool chain.
sortedPoolOutputs contains all the pool outputs in the schedule. Callers are responsible for ensuring that sortedPoolOutputs are in descending order of their respective pool chain index, i.e. the pool output furthest downstream will be at the front of the vector.
|
protected |
Generate tasks for the scheduled task graph.
The task graph is used by the parallel evaluation engine.
Returns false if scheduling has been interrupted.
|
inlineprotected |
Returns true if the scheduler has been interrupted, if the scheduler supports interruption.
If interruption is not supported, i.e. no interruption flag has been set, this will always return false.
Definition at line 93 of file scheduler.h.
|
protected |
Initializes the request masks for all the outputs that will be computed as a result of request.
poolOutputs is an output parameter. The vector will contain all the pool outputs scheduled with request masks, sorted in reverse order of pool chain index, i.e. the pool output furthest downstream will be at the front of the vector.
Returns false if scheduling has been interrupted, or if an error has been detected.
|
staticprotected |
Marks the schedule as small if it is indeed small.
|
protected |
Method to schedule the buffer passes and the "keep" masks for the scheduled nodes.
Schedulers that care about performance will want to call this after all the outputs have gone through the _ScheduleOutput method above.
Returns false if scheduling has been interrupted.
|
protected |
Schedule the outputs from which buffers should be passed.
This helps ensure that potentially large portions of the network that won't have any effect in this schedule are skipped when passing buffers.
sortedPoolOutputs contains all the pool outputs in the schedule. Callers are responsible for ensuring that sortedPoolOutputs are in descending order of their respective pool chain index, i.e. the pool output furthest downstream will be at the front of the vector.
Returns false if scheduling has been interrupted.
|
protected |
Schedule the task graph for multi-threaded munging.
This will generate tasks and invocations, as well as dependencies between them.
Returns false if scheduling has been interrupted.
|
staticprotected |
Method to signal that a schedule is done being built and that it is now valid for the given network.
|
staticprotected |
Updates the affects mask on an existing scheduled node invocation.
|
staticprotected |
Updates schedule for node if affects mask changed.
|
staticprotected |
Updates schedule for node if the lock mask changed.
| VDF_API bool CreateSchedule | ( | const VdfRequest & | request, |
| VdfSchedule * | schedule, | ||
| bool | topologicallySort ) |
Generates a schedule.
This method supports optional scheduling interruption.
Returns false if scheduling was interrupted, and true otherwise.
|
static |
Generates a schedule.
|
static |
Update schedule after the affects mask changed on output.