HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
schedule.h
Go to the documentation of this file.
1 //
2 // Copyright 2025 Pixar
3 //
4 // Licensed under the terms set forth in the LICENSE.txt file available at
5 // https://openusd.org/license.
6 //
7 #ifndef PXR_EXEC_VDF_SCHEDULE_H
8 #define PXR_EXEC_VDF_SCHEDULE_H
9 
10 /// \file
11 
12 #include "pxr/pxr.h"
13 
14 #include "pxr/exec/vdf/api.h"
16 #include "pxr/exec/vdf/node.h"
17 #include "pxr/exec/vdf/request.h"
20 #include "pxr/exec/vdf/types.h"
21 
22 #include "pxr/base/tf/bits.h"
23 
24 #include <vector>
25 
27 
28 class VdfConnection;
29 class VdfNetwork;
30 
31 ///////////////////////////////////////////////////////////////////////////////
32 ///
33 /// \class VdfSchedule
34 ///
35 /// \brief Contains a specification of how to execute a particular VdfNetwork.
36 ///
37 /// Contains ordering and dependency information about the nodes in a network.
38 ///
39 
41 {
42 public:
43  /// Minimal iterator range that the schedule returns instances of, in order
44  /// to facilitate iterating over sub-sections of the internal containers.
45  ///
46  template <typename Iterator>
47  class IteratorRange {
48  public:
49  template <typename IteratorConvertible>
50  IteratorRange(IteratorConvertible begin, IteratorConvertible end) :
51  _begin(begin), _end(end) {}
52 
53  Iterator begin() const { return _begin; }
54  Iterator end() const { return _end; }
55  bool empty() const { return _begin == _end; }
56  size_t size() const { return std::distance(_begin, _end); }
57 
58  private:
59  Iterator _begin;
60  Iterator _end;
61  };
62 
63  /// Noncopyable.
64  ///
65  VdfSchedule(const VdfSchedule &) = delete;
66  VdfSchedule &operator=(const VdfSchedule &) = delete;
67 
68  /// The type for the vector of schedule nodes in the schedule.
69  ///
70  using ScheduleNodeVector = std::vector<VdfScheduleNode>;
71 
72  /// An iterable range of task ids.
73  ///
75 
76  /// An iterable range of input dependencies.
77  ///
78  using InputDependencyRange =
80 
81  /// An iterable range of scheduled inputs.
82  ///
83  using InputsRange =
85 
86  /// An OutputId is a small key object that, once obtained for a particular
87  /// VdfOutput, can be used to query the schedule about that VdfOutput.
88  /// Querying the schedule using OutputId allows efficient queries to be made
89  /// without specific knowledge of how the schedule stores its data.
90  ///
91  class OutputId {
92  public:
93  /// Returns whether this OutputId can be used to make queries
94  /// about an output's scheduling. Output which are not scheduled will
95  /// have invalid ids.
96  ///
97  bool IsValid() const {
98  return _scheduleNodeIndex >= 0 && _secondaryIndex >= 0;
99  }
100 
101  /// Increment this OutputId to refer to the next scheduled output
102  /// on the current output's node.
103  /// Callers should not expect an OutputId that is incremented past
104  /// the end of the scheduled outputs to automatically go invalid.
105  /// Rather than using this operator directly, consider using
106  /// VDF_FOR_EACH_SCHEDULED_OUTPUT_ID(...) instead.
107  ///
109  _secondaryIndex++;
110  return *this;
111  }
112 
113  /// Equality operator.
114  ///
115  bool operator==(const OutputId &rhs) const {
116  return _scheduleNodeIndex == rhs._scheduleNodeIndex &&
117  _secondaryIndex == rhs._secondaryIndex;
118  }
119 
120  bool operator!=(const OutputId &rhs) const {
121  return !(*this == rhs);
122  }
123 
124  private:
125  // Construct an OutputId with a specific schedule node index
126  // and secondary index.
127  //
128  // The scheduleNodeIndex is expected to be one of the possible values
129  // stored in VdfSchedule::_nodesToIndexMap (i.e. [0, _nodes.size()-1])
130  // or a negative value to indicate an invalid id.
131  //
132  // And invalid id signifies that an output is not scheduled.
133  //
134  // The secondaryIndex is an index into the associated
135  // VdfScheduleNode's VdfScheduleOutputs vector, which stores data
136  // about the scheduled node explicitly.
137  //
138  OutputId(int scheduleNodeIndex, int secondaryIndex) :
139  _scheduleNodeIndex(scheduleNodeIndex),
140  _secondaryIndex(secondaryIndex)
141  {}
142 
143  // Only VdfSchedule is allowed to construct instances of VdfOuputId.
144  friend class VdfSchedule;
145 
146  // Data members
147  int _scheduleNodeIndex;
148  int _secondaryIndex;
149  };
150 
151  /// Constructs an empty schedule.
152  ///
153  VDF_API
154  VdfSchedule();
155 
156  /// Destructor
157  ///
158  VDF_API
159  ~VdfSchedule();
160 
161  /// Clears the schedule.
162  ///
163  /// This marks the schedule as invalid and is no longer suitable for
164  /// execution.
165  ///
166  VDF_API
167  void Clear();
168 
169  /// Returns whether or not this schedule is valid and can be used for
170  /// execution.
171  ///
172  bool IsValid() const {
173  return _isValid;
174  }
175 
176  /// Returns the network for this schedule.
177  ///
178  const VdfNetwork *GetNetwork() const { return _network; }
179 
180  /// @{ \name Queries
181 
182  /// Returns whether this schedule includes \p node in any way.
183  ///
184  VDF_API
185  bool IsScheduled(const VdfNode &node) const;
186 
187  /// Returns a small, cheap OutputId, which can be passed to other Get*
188  /// methods in this class to efficiently get scheduling information
189  /// about a particular VdfOutput. If the schedule does not include \p
190  /// output, the returned OutputId's IsValid() method will return false.
191  ///
192  VDF_API
193  OutputId GetOutputId(const VdfOutput &output) const;
194 
195  /// Similar to GetOutputId, but creates an OutptuId if none exists,
196  /// effectively adding the output to the schedule. So you want to be
197  /// very careful how you use this method.
198  ///
199  VDF_API
200  OutputId GetOrCreateOutputId(const VdfOutput &output);
201 
202  /// Adds the input targeted by the given \p connection to the schedule. The
203  /// specified \p mask indicates which data elements the input depends on.
204  ///
205  /// \sa DeduplicateInputs
206  ///
207  VDF_API
208  void AddInput(const VdfConnection &connection, const VdfMask &mask);
209 
210  /// Consolidates scheduled input entries added by AddInput.
211  ///
212  /// Ensures that each pair of scheduled input and source output has a
213  /// unique entry that accumulates the masks passed to AddInput. The
214  /// scheduler is responsible for calling this method after all inputs have
215  /// been added and before any call to GetInputs.
216  ///
217  VDF_API
218  void DeduplicateInputs();
219 
220  /// Returns the VdfNode that owns the VdfOutput associated with the given
221  /// \p outputId.
222  ///
223  VDF_API
224  const VdfNode *GetNode(const OutputId &outputId) const;
225 
226  /// Gets an OutputId identifying the first scheduled output for the given
227  /// \p node, if any. The returned OutputId may be invalid if there are no
228  /// scheduled outputs for \p node.
229  ///
230  /// Note that \p node must be scheduled for this API to work,
231  /// cf. IsScheduled().
232  ///
233  /// Rather than calling this method directly, consider using
234  /// VDF_FOR_EACH_SCHEDULED_OUTPUT_ID(...) instead.
235  ///
236  VDF_API
237  OutputId GetOutputIdsBegin(const VdfNode &node) const;
238 
239  /// Gets an OutputId identifying the "end" of the scheduled outputs for
240  /// a node. This OutputId should never be used to query the schedule, as
241  /// it never represents a particular scheduled output.
242  /// See GetOutputIdsBegin().
243  ///
244  /// Note that \p node must be scheduled for this API to work,
245  /// cf. IsScheduled().
246  ///
247  /// Rather than calling this method directly, consider using
248  /// VDF_FOR_EACH_SCHEDULED_OUTPUT_ID(...) instead.
249  ///
250  VDF_API
251  OutputId GetOutputIdsEnd(const VdfNode &node) const;
252 
253  /// Returns a range of inputs scheduled for the given \p node. Note that
254  /// not all inputs in the network are also scheduled for the \p node.
255  ///
256  VDF_API
257  InputsRange GetInputs(const VdfNode &node) const;
258 
259  /// Returns \c true if the output is expected to have an effect on its
260  /// corresponding input, and \c false otherwise.
261  ///
262  /// Outputs that don't have an 'affects' mask or a corresponding input
263  /// are always considered to affect their data.
264  ///
265  VDF_API
266  bool IsAffective(const OutputId &outputId) const;
267 
268  /// @}
269 
270  /// @{ \name Queries By OutputId
271  /// Any time the schedule is queried by OutputId, the caller must
272  /// ensure the OutputId's IsValid() method returns true beforehand.
273  /// As an optimization, the schedule does not verify this for the calls
274  /// below.
275 
276  /// Returns the scheduled VdfOutput associated with the given OutputId.
277  ///
278  VDF_API
279  const VdfOutput *GetOutput(const OutputId &outputId) const;
280 
281  /// Returns the output whose temporary buffer can be immediately deallocated
282  /// after \p node has finished executing.
283  ///
284  VDF_API
285  const VdfOutput *GetOutputToClear(const VdfNode &node) const;
286 
287  /// Returns the request mask associated with the given OutputId.
288  ///
289  VDF_API
290  const VdfMask &GetRequestMask(const OutputId &outputId) const;
291 
292  /// Returns the request mask for the given node invocation.
293  ///
295  const VdfScheduleTaskIndex invocationIndex) const {
296  TF_DEV_AXIOM(!VdfScheduleTaskIsInvalid(invocationIndex));
297  return _nodeInvocations[invocationIndex].requestMask;
298  }
299 
300  /// Returns pointers to the request and affects masks simultaneously,
301  /// saving on the overhead of making two queries when client code just
302  /// needs both masks.
303  ///
304  VDF_API
306  const OutputId &outputId,
307  const VdfMask **requestMask,
308  const VdfMask **affectsMask) const;
309 
310  /// Returns pointers to the request and affects masks for the given
311  /// node invocation index.
312  ///
314  const VdfScheduleTaskIndex invocationIndex,
315  const VdfMask **requestMask,
316  const VdfMask **affectsMask) const {
317  TF_DEV_AXIOM(!VdfScheduleTaskIsInvalid(invocationIndex));
318  *requestMask = &_nodeInvocations[invocationIndex].requestMask;
319  *affectsMask = &_nodeInvocations[invocationIndex].affectsMask;
320  }
321 
322  /// Returns the affects mask associated with the given OutputId.
323  ///
324  VDF_API
325  const VdfMask &GetAffectsMask(const OutputId &outputId) const;
326 
327  /// Returns the keep mask associated with the given OutputId.
328  ///
329  VDF_API
330  const VdfMask &GetKeepMask(const OutputId &outputId) const;
331 
332  /// Returns the keep mask for the given node invocation index.
333  ///
335  const VdfScheduleTaskIndex invocationIndex) const {
336  TF_DEV_AXIOM(!VdfScheduleTaskIsInvalid(invocationIndex));
337  return _nodeInvocations[invocationIndex].keepMask;
338  }
339 
340  /// Returns the "pass to" output associated with the given OutputId.
341  ///
342  VDF_API
343  const VdfOutput *GetPassToOutput(const OutputId &outputId) const;
344 
345  /// Returns the "from buffer's" output associated with the given OutputId.
346  ///
347  VDF_API
348  const VdfOutput *GetFromBufferOutput(const OutputId &outputId) const;
349 
350  /// Returns \c true if this schedule participates in sparse mung buffer
351  /// locking.
352  ///
353  bool HasSMBL() const {
354  return _hasSMBL;
355  }
356 
357  /// @}
358 
359  /// Loops over each scheduled output of \p node and calls \p callback
360  /// with the output and request mask in an efficient manner.
361  ///
362  VDF_API
364  const VdfNode &node,
365  const VdfScheduledOutputCallback &callback) const;
366 
367  /// Returns the number of unique input dependencies created for the
368  /// scheduled task graph. Each unique input dependency refers to the same
369  /// output and mask combination.
370  ///
372  return _numUniqueInputDeps;
373  }
374 
375  /// Returns the total number of compute tasks in the schedule.
376  ///
377  size_t GetNumComputeTasks() const {
378  return _computeTasks.size();
379  }
380 
381  /// Returns the total number of inputs tasks in the schedule.
382  ///
383  size_t GetNumInputsTasks() const {
384  return _inputsTasks.size();
385  }
386 
387  /// Returns the total number of prep tasks in the schedule.
388  ///
389  size_t GetNumPrepTasks() const {
390  return _numPrepTasks;
391  }
392 
393  /// Returns the total number of keep tasks in the schedule.
394  ///
395  size_t GetNumKeepTasks() const {
396  return _numKeepTasks;
397  }
398 
399  /// Returns a range of ids describing compute tasks associated with
400  /// the given node.
401  ///
402  const TaskIdRange GetComputeTaskIds(const VdfNode &node) const {
403  int scheduleNodeIndex = _GetScheduleNodeIndex(node);
404  TF_DEV_AXIOM(scheduleNodeIndex >= 0);
405  return TaskIdRange(
406  _nodesToComputeTasks[scheduleNodeIndex].taskId,
407  _nodesToComputeTasks[scheduleNodeIndex].taskId +
408  _nodesToComputeTasks[scheduleNodeIndex].taskNum);
409  }
410 
411  /// Returns an iterable range of task indices given an input dependency.
412  ///
414  const VdfScheduleInputDependency &input) const {
415  return TaskIdRange(
416  input.computeOrKeepTaskId,
417  input.computeOrKeepTaskId + input.computeTaskNum);
418  }
419 
420  /// Returns an index to the keep task associated with the given node.
421  ///
422  const VdfScheduleTaskIndex GetKeepTaskIndex(const VdfNode &node) const {
423  int scheduleNodeIndex = _GetScheduleNodeIndex(node);
424  return scheduleNodeIndex >= 0
425  ? _nodesToKeepTasks[scheduleNodeIndex]
426  : VdfScheduleTaskInvalid;
427  }
428 
429  /// Returns the compute task associated with the given task index.
430  ///
432  const VdfScheduleTaskIndex index) const {
433  TF_DEV_AXIOM(index < _computeTasks.size());
434  return _computeTasks[index];
435  }
436 
437  /// Returns the inputs task associated with the given task index.
438  ///
440  const VdfScheduleTaskIndex index) const {
441  TF_DEV_AXIOM(index < _inputsTasks.size());
442  return _inputsTasks[index];
443  }
444 
445  /// Returns an iterable range of prereq input dependencies for the given
446  /// inputs task.
447  ///
449  const VdfScheduleInputsTask &task) const {
450  std::vector<VdfScheduleInputDependency>::const_iterator begin =
451  _inputDeps.begin() + task.inputDepIndex;
452  return InputDependencyRange(begin, begin + task.prereqsNum);
453  }
454 
455  /// Returns an iterable range of optional (i.e. dependent on prereq results)
456  /// input dependencies for the given inputs task.
457  ///
459  const VdfScheduleInputsTask &task) const {
460  std::vector<VdfScheduleInputDependency>::const_iterator begin =
461  _inputDeps.begin() + task.inputDepIndex + task.prereqsNum;
462  return InputDependencyRange(begin, begin + task.optionalsNum);
463  }
464 
465  /// Returns an iterable range of required (i.e. read/writes and reads not
466  /// dependent on prereqs) input dependencies for the given compute task.
467  ///
469  const VdfScheduleComputeTask &task) const {
470  std::vector<VdfScheduleInputDependency>::const_iterator begin =
471  _inputDeps.begin() + task.requiredsIndex;
472  return InputDependencyRange(begin, begin + task.requiredsNum);
473  }
474 
475  /// Returns the unique index assigned to the output.
476  ///
477  VDF_API
479  const OutputId outputId) const;
480 
481  /// @{ \name Scheduler Data Access
482 
483  /// Returns whether this schedule is small enough to avoid overhead incurred
484  /// by the _nodesToIndexMap mapping, which is otherwise of great benefit to
485  /// schedule node lookup time.
486  ///
487  bool IsSmallSchedule() const { return _isSmallSchedule; }
488 
489  /// Sets the request that was used to make up this schedule.
490  ///
491  VDF_API
492  void SetRequest(const VdfRequest &request);
493 
494  /// Returns the request for this schedule.
495  ///
496  const VdfRequest &GetRequest() const { return _request; }
497 
498  /// Returns the vector of schedule nodes in this schedule.
499  ///
500  /// It is never appropriate to access the vector of schedule nodes
501  /// directly except during scheduling.
502  ///
504  return _nodes;
505  }
506 
508  return _nodes;
509  }
510 
511  /// Returns the node index of the schedule node associated with the given
512  /// \p outputId.
513  ///
514  int GetScheduleNodeIndex(const OutputId &outputId) const {
515  return outputId._scheduleNodeIndex;
516  }
517 
518  /// Returns a set of bits where each set bit's index corresponds to
519  /// the node index of a node in this schedule.
520  ///
521  const TfBits &GetScheduledNodeBits() const { return _scheduledNodes; }
522 
523  /// Registers a request mask for the output indicated by \p outputId.
524  ///
525  VDF_API
526  void SetRequestMask(const OutputId &outputId, const VdfMask &mask);
527 
528  /// Registers an affects mask for the output indicated by \p outputId.
529  ///
530  VDF_API
531  void SetAffectsMask(const OutputId &outputId, const VdfMask &mask);
532 
533  /// Registers a keep mask for the output indicated by \p outputId.
534  ///
535  VDF_API
536  void SetKeepMask(const OutputId &outputId, const VdfMask &mask);
537 
538  /// Registers a "pass to" output for the output indicated by \p outputId.
539  ///
540  VDF_API
541  void SetPassToOutput(const OutputId &outputId, const VdfOutput *output);
542 
543  /// Registers a "from buffer" for the output indicated by \p outputId.
544  ///
545  VDF_API
546  void SetFromBufferOutput(const OutputId &outputId, const VdfOutput *output);
547 
548  /// Registers an output whose temporary buffer can be eagerly cleared
549  /// as soon as \p node has finished executing.
550  ///
551  VDF_API
552  void SetOutputToClear(const VdfNode &node, const VdfOutput *outputToClear);
553 
554  /// Initializes structures based on the size of the network.
555  ///
556  VDF_API
557  void InitializeFromNetwork(const VdfNetwork &network);
558 
559  /// Enables SMBL for this schedule.
560  ///
561  void SetHasSMBL(bool enable) {
562  _hasSMBL = enable;
563  }
564 
565  /// @}
566 
567 private:
568 
569  // The VdfScheduler and its derived classes are the only objects allowed
570  // to set a scheduler as valid.
571  friend class VdfScheduler;
572 
573  // The VdfScheduler calls this method to make sure that this schedule
574  // is marked as valid and registered with a particular network.
575  //
576  void _SetIsValidForNetwork(const VdfNetwork *network);
577 
578  // Returns the index into _nodes that corresponds to the given VdfNode.
579  // If the node is not scheduled and thus has no corresponding _nodes entry,
580  // this method returns a value less than 0.
581  VDF_API
582  int _GetScheduleNodeIndex(const VdfNode &node) const;
583 
584  // Ensures that \p node is in the schedule and returns its scheduleNode
585  // index.
586  //
587  int _EnsureNodeInSchedule(const VdfNode &node);
588 
589  // Data Members
590 
591  // The total list of nodes that we have to execute. This is where the
592  // schedule nodes are owned.
593  ScheduleNodeVector _nodes;
594 
595  // The request for this schedule
596  VdfRequest _request;
597 
598  // This is a vector that maps VdfNodes to VdfScheduleNode index in _nodes.
599  std::vector<int> _nodesToIndexMap;
600 
601  // The network that we are registered with. All of our scheduled nodes
602  // belong to this network.
603  const VdfNetwork *_network;
604 
605  // Bits are set for each schedule node's index.
606  TfBits _scheduledNodes;
607 
608  // Flag as to whether or not the schedule is valid.
609  bool _isValid;
610 
611  // A flag that determines whether this schedule's query methods will
612  // use the small schedule optimization, which is to assume there is no
613  // _nodesToIndexMap and instead find schedule nodes by searching the
614  // _nodes array directly.
615  bool _isSmallSchedule;
616 
617  // This flag indicates whether this schedule participates in sparse mung
618  // buffer locking.
619  bool _hasSMBL;
620 
621  // The number of unique input dependencies created for this schedule. Each
622  // unique input dependencies refers to the same output and mask combination.
623  size_t _numUniqueInputDeps;
624 
625  // The scheduled tasks for parallel evaluation.
628  size_t _numKeepTasks;
629  size_t _numPrepTasks;
630 
631  // Scheduled node invocations for nodes with multiple invocations.
633 
634  // The array of input dependencies used to orchestrate task synchronization.
635  std::vector<VdfScheduleInputDependency> _inputDeps;
636 
637  // Arrays that map from the scheduled node index to the scheduled tasks
638  // corresponding to that node.
639  std::vector<VdfScheduleNodeTasks> _nodesToComputeTasks;
640  std::vector<VdfScheduleTaskIndex> _nodesToKeepTasks;
641 };
642 
643 ///////////////////////////////////////////////////////////////////////////////
644 
645 // Example usage:
646 // void MyFunction(const VdfSchedule &schedule, const VdfNode &node) {
647 // VDF_FOR_EACH_SCHEDULED_OUTPUT_ID(outputId, schedule, node) {
648 // DoThingsWithARequestMask(schedule->GetRequestMask(outputId));
649 // }
650 // }
651 //
652 #define VDF_FOR_EACH_SCHEDULED_OUTPUT_ID(OUTPUT_ID_NAME,VDF_SCHEDULE,VDF_NODE) \
653  for (VdfSchedule::OutputId __endId = \
654  (VDF_SCHEDULE).GetOutputIdsEnd(VDF_NODE), \
655  OUTPUT_ID_NAME = (VDF_SCHEDULE).GetOutputIdsBegin(VDF_NODE) ; \
656  OUTPUT_ID_NAME != __endId; ++OUTPUT_ID_NAME)
657 
658 
659 ///////////////////////////////////////////////////////////////////////////////
660 
662 
663 #endif
bool HasSMBL() const
Definition: schedule.h:353
VDF_API bool IsAffective(const OutputId &outputId) const
VDF_API const VdfMask & GetAffectsMask(const OutputId &outputId) const
IteratorRange< std::vector< VdfScheduleInput >::const_iterator > InputsRange
Definition: schedule.h:84
VDF_API void Clear()
VDF_API const VdfMask & GetKeepMask(const OutputId &outputId) const
VDF_API void SetPassToOutput(const OutputId &outputId, const VdfOutput *output)
size_t GetNumInputsTasks() const
Definition: schedule.h:383
bool empty() const
Definition: schedule.h:55
IteratorRange< Vdf_CountingIterator< VdfScheduleTaskId >> TaskIdRange
Definition: schedule.h:74
InputDependencyRange GetRequiredInputDependencies(const VdfScheduleComputeTask &task) const
Definition: schedule.h:468
TaskIdRange GetComputeTaskIds(const VdfScheduleInputDependency &input) const
Definition: schedule.h:413
VDF_API const VdfOutput * GetPassToOutput(const OutputId &outputId) const
const VdfNetwork * GetNetwork() const
Definition: schedule.h:178
ScheduleNodeVector & GetScheduleNodeVector()
Definition: schedule.h:503
VDF_API OutputId GetOrCreateOutputId(const VdfOutput &output)
VDF_API ~VdfSchedule()
VDF_API const VdfOutput * GetFromBufferOutput(const OutputId &outputId) const
#define PXR_NAMESPACE_OPEN_SCOPE
Definition: pxr.h:73
VDF_API OutputId GetOutputId(const VdfOutput &output) const
std::vector< T, Vdf_DefaultInitAllocator< T >> Vdf_DefaultInitVector
Definition: types.h:122
VdfScheduleTaskIndex inputDepIndex
VDF_API void SetRequest(const VdfRequest &request)
size_t size() const
Definition: schedule.h:56
Definition: node.h:52
const VdfScheduleComputeTask & GetComputeTask(const VdfScheduleTaskIndex index) const
Definition: schedule.h:431
std::vector< VdfScheduleNode > ScheduleNodeVector
Definition: schedule.h:70
VDF_API bool IsScheduled(const VdfNode &node) const
void GetRequestAndAffectsMask(const VdfScheduleTaskIndex invocationIndex, const VdfMask **requestMask, const VdfMask **affectsMask) const
Definition: schedule.h:313
VDF_API void ForEachScheduledOutput(const VdfNode &node, const VdfScheduledOutputCallback &callback) const
bool IsSmallSchedule() const
Definition: schedule.h:487
A VdfMask is placed on connections to specify the data flowing through them.
Definition: mask.h:36
VDF_API VdfSchedule()
size_t GetNumComputeTasks() const
Definition: schedule.h:377
VdfScheduleTaskIndex requiredsIndex
Definition: scheduleTasks.h:82
VDF_API void DeduplicateInputs()
VdfScheduleTaskNum computeTaskNum
#define VDF_API
Definition: api.h:25
Iterator end() const
Definition: schedule.h:54
VDF_API OutputId GetOutputIdsBegin(const VdfNode &node) const
VDF_API void SetKeepMask(const OutputId &outputId, const VdfMask &mask)
VDF_API InputsRange GetInputs(const VdfNode &node) const
std::function< void(const VdfOutput *, const VdfMask &)> VdfScheduledOutputCallback
Definition: types.h:86
VDF_API OutputId GetOutputIdsEnd(const VdfNode &node) const
VDF_API void SetFromBufferOutput(const OutputId &outputId, const VdfOutput *output)
Iterator begin() const
Definition: schedule.h:53
VDF_API const VdfOutput * GetOutput(const OutputId &outputId) const
#define TF_DEV_AXIOM(cond)
Fast bit array that keeps track of the number of bits set and can find the next set in a timely manne...
Definition: bits.h:48
const TaskIdRange GetComputeTaskIds(const VdfNode &node) const
Definition: schedule.h:402
const VdfMask & GetRequestMask(const VdfScheduleTaskIndex invocationIndex) const
Definition: schedule.h:294
InputDependencyRange GetPrereqInputDependencies(const VdfScheduleInputsTask &task) const
Definition: schedule.h:448
VdfScheduleTaskNum requiredsNum
Definition: scheduleTasks.h:85
int GetScheduleNodeIndex(const OutputId &outputId) const
Definition: schedule.h:514
VDF_API void SetOutputToClear(const VdfNode &node, const VdfOutput *outputToClear)
Contains a specification of how to execute a particular VdfNetwork.
Definition: schedule.h:40
OutputId & operator++()
Definition: schedule.h:108
size_t GetNumUniqueInputDependencies() const
Definition: schedule.h:371
GLuint GLuint end
Definition: glcorearb.h:475
VDF_API const VdfNode * GetNode(const OutputId &outputId) const
VdfScheduleTaskNum prereqsNum
GLint GLuint mask
Definition: glcorearb.h:124
const VdfScheduleInputsTask & GetInputsTask(const VdfScheduleTaskIndex index) const
Definition: schedule.h:439
const VdfRequest & GetRequest() const
Definition: schedule.h:496
VDF_API void AddInput(const VdfConnection &connection, const VdfMask &mask)
size_t GetNumPrepTasks() const
Definition: schedule.h:389
bool IsValid() const
Definition: schedule.h:172
bool operator!=(const OutputId &rhs) const
Definition: schedule.h:120
const VdfScheduleTaskIndex GetKeepTaskIndex(const VdfNode &node) const
Definition: schedule.h:422
const ScheduleNodeVector & GetScheduleNodeVector() const
Definition: schedule.h:507
Used to make a VdfSchedule.
Definition: scheduler.h:34
size_t GetNumKeepTasks() const
Definition: schedule.h:395
IteratorRange< std::vector< VdfScheduleInputDependency >::const_iterator > InputDependencyRange
Definition: schedule.h:79
bool operator==(const OutputId &rhs) const
Definition: schedule.h:115
VDF_API void GetRequestAndAffectsMask(const OutputId &outputId, const VdfMask **requestMask, const VdfMask **affectsMask) const
VdfSchedule & operator=(const VdfSchedule &)=delete
PcpNodeRef_ChildrenIterator begin(const PcpNodeRef::child_const_range &r)
Support for range-based for loops for PcpNodeRef children ranges.
Definition: node.h:587
VDF_API const VdfMask & GetRequestMask(const OutputId &outputId) const
GLuint index
Definition: glcorearb.h:786
bool IsValid() const
Definition: schedule.h:97
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
bool VdfScheduleTaskIsInvalid(uint32_t task)
Definition: scheduleTasks.h:41
const TfBits & GetScheduledNodeBits() const
Definition: schedule.h:521
void SetHasSMBL(bool enable)
Definition: schedule.h:561
uint32_t VdfScheduleTaskIndex
Definition: scheduleTasks.h:29
VdfScheduleTaskNum optionalsNum
VdfScheduleTaskId computeOrKeepTaskId
uint32_t VdfScheduleInputDependencyUniqueIndex
VDF_API void SetAffectsMask(const OutputId &outputId, const VdfMask &mask)
SIM_API const UT_StringHolder distance
VDF_API void SetRequestMask(const OutputId &outputId, const VdfMask &mask)
VDF_API void InitializeFromNetwork(const VdfNetwork &network)
VDF_API const VdfOutput * GetOutputToClear(const VdfNode &node) const
InputDependencyRange GetOptionalInputDependencies(const VdfScheduleInputsTask &task) const
Definition: schedule.h:458
const VdfMask & GetKeepMask(const VdfScheduleTaskIndex invocationIndex) const
Definition: schedule.h:334
VDF_API VdfScheduleInputDependencyUniqueIndex GetUniqueIndex(const OutputId outputId) const
IteratorRange(IteratorConvertible begin, IteratorConvertible end)
Definition: schedule.h:50