![]() |
|
Contains a specification of how to execute a particular VdfNetwork. More...
#include <schedule.h>
Classes | |
| class | IteratorRange |
| Minimal iterator range that the schedule returns instances of, in order to facilitate iterating over sub-sections of the internal containers. More... | |
| class | OutputId |
| An OutputId is a small key object that, once obtained for a particular VdfOutput, can be used to query the schedule about that VdfOutput. More... | |
Public Types | |
| using | ScheduleNodeVector = std::vector< VdfScheduleNode > |
| The type for the vector of schedule nodes in the schedule. | |
| using | TaskIdRange = IteratorRange< Vdf_CountingIterator< VdfScheduleTaskId > > |
| An iterable range of task ids. | |
| using | InputDependencyRange = IteratorRange< std::vector< VdfScheduleInputDependency >::const_iterator > |
| An iterable range of input dependencies. | |
| using | InputsRange = IteratorRange< std::vector< VdfScheduleInput >::const_iterator > |
| An iterable range of scheduled inputs. | |
Public Member Functions | |
| VdfSchedule (const VdfSchedule &)=delete | |
| Noncopyable. | |
| VdfSchedule & | operator= (const VdfSchedule &)=delete |
| VDF_API | VdfSchedule () |
| Constructs an empty schedule. | |
| VDF_API | ~VdfSchedule () |
| Destructor. | |
| VDF_API void | Clear () |
| Clears the schedule. | |
| bool | IsValid () const |
| Returns whether or not this schedule is valid and can be used for execution. | |
| const VdfNetwork * | GetNetwork () const |
| Returns the network for this schedule. | |
| VDF_API void | ForEachScheduledOutput (const VdfNode &node, const VdfScheduledOutputCallback &callback) const |
Loops over each scheduled output of node and calls callback with the output and request mask in an efficient manner. | |
| size_t | GetNumUniqueInputDependencies () const |
| Returns the number of unique input dependencies created for the scheduled task graph. | |
| size_t | GetNumComputeTasks () const |
| Returns the total number of compute tasks in the schedule. | |
| size_t | GetNumInputsTasks () const |
| Returns the total number of inputs tasks in the schedule. | |
| size_t | GetNumPrepTasks () const |
| Returns the total number of prep tasks in the schedule. | |
| size_t | GetNumKeepTasks () const |
| Returns the total number of keep tasks in the schedule. | |
| const TaskIdRange | GetComputeTaskIds (const VdfNode &node) const |
| Returns a range of ids describing compute tasks associated with the given node. | |
| TaskIdRange | GetComputeTaskIds (const VdfScheduleInputDependency &input) const |
| Returns an iterable range of task indices given an input dependency. | |
| const VdfScheduleTaskIndex | GetKeepTaskIndex (const VdfNode &node) const |
| Returns an index to the keep task associated with the given node. | |
| const VdfScheduleComputeTask & | GetComputeTask (const VdfScheduleTaskIndex index) const |
| Returns the compute task associated with the given task index. | |
| const VdfScheduleInputsTask & | GetInputsTask (const VdfScheduleTaskIndex index) const |
| Returns the inputs task associated with the given task index. | |
| InputDependencyRange | GetPrereqInputDependencies (const VdfScheduleInputsTask &task) const |
| Returns an iterable range of prereq input dependencies for the given inputs task. | |
| InputDependencyRange | GetOptionalInputDependencies (const VdfScheduleInputsTask &task) const |
| Returns an iterable range of optional (i.e. | |
| InputDependencyRange | GetRequiredInputDependencies (const VdfScheduleComputeTask &task) const |
| Returns an iterable range of required (i.e. | |
| VDF_API VdfScheduleInputDependencyUniqueIndex | GetUniqueIndex (const OutputId outputId) const |
| Returns the unique index assigned to the output. | |
Queries | |
| VDF_API bool | IsScheduled (const VdfNode &node) const |
Returns whether this schedule includes node in any way. | |
| VDF_API OutputId | GetOutputId (const VdfOutput &output) const |
| Returns a small, cheap OutputId, which can be passed to other Get* methods in this class to efficiently get scheduling information about a particular VdfOutput. | |
| VDF_API OutputId | GetOrCreateOutputId (const VdfOutput &output) |
| Similar to GetOutputId, but creates an OutptuId if none exists, effectively adding the output to the schedule. | |
| VDF_API void | AddInput (const VdfConnection &connection, const VdfMask &mask) |
Adds the input targeted by the given connection to the schedule. | |
| VDF_API void | DeduplicateInputs () |
| Consolidates scheduled input entries added by AddInput. | |
| VDF_API const VdfNode * | GetNode (const OutputId &outputId) const |
Returns the VdfNode that owns the VdfOutput associated with the given outputId. | |
| VDF_API OutputId | GetOutputIdsBegin (const VdfNode &node) const |
Gets an OutputId identifying the first scheduled output for the given node, if any. | |
| VDF_API OutputId | GetOutputIdsEnd (const VdfNode &node) const |
| Gets an OutputId identifying the "end" of the scheduled outputs for a node. | |
| VDF_API InputsRange | GetInputs (const VdfNode &node) const |
Returns a range of inputs scheduled for the given node. | |
| VDF_API bool | IsAffective (const OutputId &outputId) const |
Returns true if the output is expected to have an effect on its corresponding input, and false otherwise. | |
Queries By OutputId | |
| VDF_API const VdfOutput * | GetOutput (const OutputId &outputId) const |
| Returns the scheduled VdfOutput associated with the given OutputId. | |
| VDF_API const VdfOutput * | GetOutputToClear (const VdfNode &node) const |
Returns the output whose temporary buffer can be immediately deallocated after node has finished executing. | |
| VDF_API const VdfMask & | GetRequestMask (const OutputId &outputId) const |
| Returns the request mask associated with the given OutputId. | |
| const VdfMask & | GetRequestMask (const VdfScheduleTaskIndex invocationIndex) const |
| Returns the request mask for the given node invocation. | |
| VDF_API void | GetRequestAndAffectsMask (const OutputId &outputId, const VdfMask **requestMask, const VdfMask **affectsMask) const |
| Returns pointers to the request and affects masks simultaneously, saving on the overhead of making two queries when client code just needs both masks. | |
| void | GetRequestAndAffectsMask (const VdfScheduleTaskIndex invocationIndex, const VdfMask **requestMask, const VdfMask **affectsMask) const |
| Returns pointers to the request and affects masks for the given node invocation index. | |
| VDF_API const VdfMask & | GetAffectsMask (const OutputId &outputId) const |
| Returns the affects mask associated with the given OutputId. | |
| VDF_API const VdfMask & | GetKeepMask (const OutputId &outputId) const |
| Returns the keep mask associated with the given OutputId. | |
| const VdfMask & | GetKeepMask (const VdfScheduleTaskIndex invocationIndex) const |
| Returns the keep mask for the given node invocation index. | |
| VDF_API const VdfOutput * | GetPassToOutput (const OutputId &outputId) const |
| Returns the "pass to" output associated with the given OutputId. | |
| VDF_API const VdfOutput * | GetFromBufferOutput (const OutputId &outputId) const |
| Returns the "from buffer's" output associated with the given OutputId. | |
| bool | HasSMBL () const |
Returns true if this schedule participates in sparse mung buffer locking. | |
Scheduler Data Access | |
| bool | IsSmallSchedule () const |
| Returns whether this schedule is small enough to avoid overhead incurred by the _nodesToIndexMap mapping, which is otherwise of great benefit to schedule node lookup time. | |
| VDF_API void | SetRequest (const VdfRequest &request) |
| Sets the request that was used to make up this schedule. | |
| const VdfRequest & | GetRequest () const |
| Returns the request for this schedule. | |
| ScheduleNodeVector & | GetScheduleNodeVector () |
| Returns the vector of schedule nodes in this schedule. | |
| const ScheduleNodeVector & | GetScheduleNodeVector () const |
| int | GetScheduleNodeIndex (const OutputId &outputId) const |
Returns the node index of the schedule node associated with the given outputId. | |
| const TfBits & | GetScheduledNodeBits () const |
| Returns a set of bits where each set bit's index corresponds to the node index of a node in this schedule. | |
| VDF_API void | SetRequestMask (const OutputId &outputId, const VdfMask &mask) |
Registers a request mask for the output indicated by outputId. | |
| VDF_API void | SetAffectsMask (const OutputId &outputId, const VdfMask &mask) |
Registers an affects mask for the output indicated by outputId. | |
| VDF_API void | SetKeepMask (const OutputId &outputId, const VdfMask &mask) |
Registers a keep mask for the output indicated by outputId. | |
| VDF_API void | SetPassToOutput (const OutputId &outputId, const VdfOutput *output) |
Registers a "pass to" output for the output indicated by outputId. | |
| VDF_API void | SetFromBufferOutput (const OutputId &outputId, const VdfOutput *output) |
Registers a "from buffer" for the output indicated by outputId. | |
| VDF_API void | SetOutputToClear (const VdfNode &node, const VdfOutput *outputToClear) |
Registers an output whose temporary buffer can be eagerly cleared as soon as node has finished executing. | |
| VDF_API void | InitializeFromNetwork (const VdfNetwork &network) |
| Initializes structures based on the size of the network. | |
| void | SetHasSMBL (bool enable) |
| Enables SMBL for this schedule. | |
Friends | |
| class | VdfScheduler |
Contains a specification of how to execute a particular VdfNetwork.
Contains ordering and dependency information about the nodes in a network.
Definition at line 40 of file schedule.h.
| using InputDependencyRange = IteratorRange<std::vector<VdfScheduleInputDependency>::const_iterator> |
An iterable range of input dependencies.
Definition at line 78 of file schedule.h.
| using InputsRange = IteratorRange<std::vector<VdfScheduleInput>::const_iterator> |
An iterable range of scheduled inputs.
Definition at line 83 of file schedule.h.
| using ScheduleNodeVector = std::vector<VdfScheduleNode> |
The type for the vector of schedule nodes in the schedule.
Definition at line 70 of file schedule.h.
An iterable range of task ids.
Definition at line 74 of file schedule.h.
|
delete |
Noncopyable.
| VDF_API VdfSchedule | ( | ) |
Constructs an empty schedule.
| VDF_API ~VdfSchedule | ( | ) |
Destructor.
| VDF_API void AddInput | ( | const VdfConnection & | connection, |
| const VdfMask & | mask | ||
| ) |
Adds the input targeted by the given connection to the schedule.
The specified mask indicates which data elements the input depends on.
| VDF_API void Clear | ( | ) |
Clears the schedule.
This marks the schedule as invalid and is no longer suitable for execution.
| VDF_API void DeduplicateInputs | ( | ) |
Consolidates scheduled input entries added by AddInput.
Ensures that each pair of scheduled input and source output has a unique entry that accumulates the masks passed to AddInput. The scheduler is responsible for calling this method after all inputs have been added and before any call to GetInputs.
| VDF_API void ForEachScheduledOutput | ( | const VdfNode & | node, |
| const VdfScheduledOutputCallback & | callback | ||
| ) | const |
Loops over each scheduled output of node and calls callback with the output and request mask in an efficient manner.
Returns the affects mask associated with the given OutputId.
|
inline |
Returns the compute task associated with the given task index.
Definition at line 431 of file schedule.h.
|
inline |
Returns a range of ids describing compute tasks associated with the given node.
Definition at line 402 of file schedule.h.
|
inline |
Returns an iterable range of task indices given an input dependency.
Definition at line 413 of file schedule.h.
Returns the "from buffer's" output associated with the given OutputId.
| VDF_API InputsRange GetInputs | ( | const VdfNode & | node | ) | const |
Returns a range of inputs scheduled for the given node.
Note that not all inputs in the network are also scheduled for the node.
|
inline |
Returns the inputs task associated with the given task index.
Definition at line 439 of file schedule.h.
Returns the keep mask associated with the given OutputId.
|
inline |
Returns the keep mask for the given node invocation index.
Definition at line 334 of file schedule.h.
|
inline |
Returns an index to the keep task associated with the given node.
Definition at line 422 of file schedule.h.
|
inline |
Returns the network for this schedule.
Definition at line 178 of file schedule.h.
|
inline |
Returns the total number of compute tasks in the schedule.
Definition at line 377 of file schedule.h.
|
inline |
Returns the total number of inputs tasks in the schedule.
Definition at line 383 of file schedule.h.
|
inline |
Returns the total number of keep tasks in the schedule.
Definition at line 395 of file schedule.h.
|
inline |
Returns the total number of prep tasks in the schedule.
Definition at line 389 of file schedule.h.
|
inline |
Returns the number of unique input dependencies created for the scheduled task graph.
Each unique input dependency refers to the same output and mask combination.
Definition at line 371 of file schedule.h.
|
inline |
Returns an iterable range of optional (i.e.
dependent on prereq results) input dependencies for the given inputs task.
Definition at line 458 of file schedule.h.
Similar to GetOutputId, but creates an OutptuId if none exists, effectively adding the output to the schedule.
So you want to be very careful how you use this method.
Gets an OutputId identifying the first scheduled output for the given node, if any.
The returned OutputId may be invalid if there are no scheduled outputs for node.
Note that node must be scheduled for this API to work, cf. IsScheduled().
Rather than calling this method directly, consider using VDF_FOR_EACH_SCHEDULED_OUTPUT_ID(...) instead.
Gets an OutputId identifying the "end" of the scheduled outputs for a node.
This OutputId should never be used to query the schedule, as it never represents a particular scheduled output. See GetOutputIdsBegin().
Note that node must be scheduled for this API to work, cf. IsScheduled().
Rather than calling this method directly, consider using VDF_FOR_EACH_SCHEDULED_OUTPUT_ID(...) instead.
Returns the output whose temporary buffer can be immediately deallocated after node has finished executing.
Returns the "pass to" output associated with the given OutputId.
|
inline |
Returns an iterable range of prereq input dependencies for the given inputs task.
Definition at line 448 of file schedule.h.
|
inline |
Returns the request for this schedule.
Definition at line 496 of file schedule.h.
| VDF_API void GetRequestAndAffectsMask | ( | const OutputId & | outputId, |
| const VdfMask ** | requestMask, | ||
| const VdfMask ** | affectsMask | ||
| ) | const |
Returns pointers to the request and affects masks simultaneously, saving on the overhead of making two queries when client code just needs both masks.
|
inline |
Returns pointers to the request and affects masks for the given node invocation index.
Definition at line 313 of file schedule.h.
Returns the request mask associated with the given OutputId.
|
inline |
Returns the request mask for the given node invocation.
Definition at line 294 of file schedule.h.
|
inline |
Returns an iterable range of required (i.e.
read/writes and reads not dependent on prereqs) input dependencies for the given compute task.
Definition at line 468 of file schedule.h.
|
inline |
Returns a set of bits where each set bit's index corresponds to the node index of a node in this schedule.
Definition at line 521 of file schedule.h.
|
inline |
Returns the node index of the schedule node associated with the given outputId.
Definition at line 514 of file schedule.h.
|
inline |
Returns the vector of schedule nodes in this schedule.
It is never appropriate to access the vector of schedule nodes directly except during scheduling.
Definition at line 503 of file schedule.h.
|
inline |
Definition at line 507 of file schedule.h.
| VDF_API VdfScheduleInputDependencyUniqueIndex GetUniqueIndex | ( | const OutputId | outputId | ) | const |
Returns the unique index assigned to the output.
|
inline |
Returns true if this schedule participates in sparse mung buffer locking.
Definition at line 353 of file schedule.h.
| VDF_API void InitializeFromNetwork | ( | const VdfNetwork & | network | ) |
Initializes structures based on the size of the network.
| VDF_API bool IsAffective | ( | const OutputId & | outputId | ) | const |
Returns true if the output is expected to have an effect on its corresponding input, and false otherwise.
Outputs that don't have an 'affects' mask or a corresponding input are always considered to affect their data.
| VDF_API bool IsScheduled | ( | const VdfNode & | node | ) | const |
Returns whether this schedule includes node in any way.
|
inline |
Returns whether this schedule is small enough to avoid overhead incurred by the _nodesToIndexMap mapping, which is otherwise of great benefit to schedule node lookup time.
Definition at line 487 of file schedule.h.
|
inline |
Returns whether or not this schedule is valid and can be used for execution.
Definition at line 172 of file schedule.h.
Registers an affects mask for the output indicated by outputId.
Registers a "from buffer" for the output indicated by outputId.
|
inline |
Enables SMBL for this schedule.
Definition at line 561 of file schedule.h.
Registers a keep mask for the output indicated by outputId.
Registers an output whose temporary buffer can be eagerly cleared as soon as node has finished executing.
Registers a "pass to" output for the output indicated by outputId.
| VDF_API void SetRequest | ( | const VdfRequest & | request | ) |
Sets the request that was used to make up this schedule.
Registers a request mask for the output indicated by outputId.
|
friend |
Definition at line 571 of file schedule.h.