HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
testUtils.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_TEST_UTILS_H
8 #define PXR_EXEC_VDF_TEST_UTILS_H
9 
10 /// \file
11 
12 #include "pxr/pxr.h"
13 
14 #include "pxr/exec/vdf/api.h"
19 #include "pxr/exec/vdf/iterator.h"
20 #include "pxr/exec/vdf/network.h"
23 #include "pxr/exec/vdf/schedule.h"
27 
28 #include "pxr/base/tf/hash.h"
29 #include "pxr/base/tf/hashmap.h"
30 #include "pxr/base/tf/token.h"
31 
32 #include <functional>
33 #include <memory>
34 #include <string>
35 
37 
38 class VdfMask;
39 class VdfNode;
40 class VdfSpeculationNode;
41 
42 ////////////////////////////////////////////////////////////////////////////////
43 ///
44 /// This file contains classes to facilitate network creation in unit tests.
45 ///
46 /// Simple example of how to use these classes:
47 ///
48 /// \code
49 /// VdfTestUtils::Network graph; // The container for the nodes.
50 /// VdfTestUtils::CallbackNodeType outType; // The consumer node type.
51 ///
52 /// // Consumer nodes read and write ints.
53 /// outType.ReadWrite<int>(_tokens->moves, _tokens->moves);
54 ///
55 /// graph.AddInputVector<int>("input", 3); // Add an input node.
56 /// graph.Add("consume", outType); // Add a consumer node.
57 ///
58 /// graph["input"] // Add a few input values to
59 /// .SetValue(0, 11) // the input node.
60 /// .SetValue(1, 22)
61 /// .SetValue(2, 33)
62 /// ;
63 ///
64 /// // Finally, connect node "input"'s default output to "consume's" moves
65 /// // input with a mask.
66 ///
67 /// graph["input"] >>
68 /// graph["consume"].In(_tokens->moves, VdfMask::AllOnes(3));
69 ///
70 /// \endcode
71 ///
72 ///
73 
74 namespace VdfTestUtils
75 {
76 
77 ////////////////////////////////////////////////////////////////////////////////
78 /// \class CallbackNode
79 ///
80 /// \brief A helper class that implements a simple callback node.
81 ///
83 {
84 public:
85 
86  using ValueFunction = void(const VdfContext &context);
87 
89  VdfNetwork *network,
90  const VdfInputSpecs &inputSpecs,
91  const VdfOutputSpecs &outputSpecs,
92  ValueFunction *const cb)
93  : VdfNode(network, inputSpecs, outputSpecs),
94  _cb(cb) {}
95 
96  virtual void Compute(const VdfContext &context) const override {
97  (*_cb)(context);
98  }
99 
100 protected:
101 
102  virtual ~CallbackNode() {}
103 
104  virtual bool _IsDerivedEqual(const VdfNode &rhs) const override {
105  return false;
106  }
107 
108 private:
109 
110  ValueFunction *const _cb;
111 };
112 
113 ////////////////////////////////////////////////////////////////////////////////
114 /// \class OutputAccessor
115 ///
116 /// \brief A helper class which enables access to a VdfOutput from a VdfContext.
117 ///
119 {
120 public:
121  OutputAccessor(const VdfContext &context) : _context(context) {}
122 
123  const VdfOutput *GetOutput() const {
124  return _GetNode(_context).GetOutput();
125  }
126 
127 private:
128  const VdfContext &_context;
129 
130 };
131 
132 ////////////////////////////////////////////////////////////////////////////////
133 /// \class DependencyCallbackNode
134 ///
135 /// \brief A CallbackNode which allows for passing in a custom input / output
136 /// dependency callback.
137 ///
139 {
140 public:
141  using InputDependencyFunction = std::function<
142  VdfMask::Bits (const VdfMaskedOutput &maskedOutput,
143  const VdfConnection &inputConnection)>;
144 
145  using OutputDependencyFunction = std::function<
146  VdfMask (const VdfConnection &inputConnection,
147  const VdfMask &inputDependencyMask,
148  const VdfOutput &output)>;
149 
151  VdfNetwork *network,
152  const VdfInputSpecs &inputSpecs,
153  const VdfOutputSpecs &outputSpecs,
154  ValueFunction *function,
155  const InputDependencyFunction &inputDependencyFunction,
156  const OutputDependencyFunction &outputDependencyFunction) :
157  CallbackNode(network, inputSpecs, outputSpecs, function),
158  _inputDependencyFunction(inputDependencyFunction),
159  _outputDependencyFunction(outputDependencyFunction) {
160  }
161 
162 protected:
164  const VdfMaskedOutput &maskedOutput,
165  const VdfConnection &inputConnection) const {
166  if (_inputDependencyFunction) {
167  return _inputDependencyFunction(
168  maskedOutput, inputConnection);
169  } else {
171  maskedOutput, inputConnection);
172  }
173  }
174 
176  const VdfConnection &inputConnection,
177  const VdfMask &inputDependencyMask,
178  const VdfOutput &output) const {
179  if (_outputDependencyFunction) {
180  return _outputDependencyFunction(
181  inputConnection, inputDependencyMask, output);
182  } else {
184  inputConnection, inputDependencyMask, output);
185  }
186  }
187 
188 private:
189  InputDependencyFunction _inputDependencyFunction;
190  OutputDependencyFunction _outputDependencyFunction;
191 
192 };
193 
194 ////////////////////////////////////////////////////////////////////////////////
195 /// \class NodeType
196 ///
197 /// \brief Base class for various kinds of nodes that can be created.
198 ///
200 {
201 public:
202  VDF_API
203  virtual ~NodeType();
204  virtual VdfNode *NewNode(VdfNetwork *net) const = 0;
205 };
206 
207 
208 ////////////////////////////////////////////////////////////////////////////////
209 /// \class InputNodeType
210 ///
211 /// \brief This class specifies a VdfInputVector of type T
212 ///
213 template<typename T>
214 class InputNodeType : public NodeType
215 {
216 public:
217  InputNodeType(size_t size) : _size(size) {}
218 
219  /// Creates a VdfInputVector<T>.
220  ///
221  virtual VdfNode *NewNode(VdfNetwork *net) const
222  {
223  return new VdfInputVector<T>(net, _size);
224  }
225 
226 private:
227 
228  const size_t _size;
229 
230 };
231 
232 ////////////////////////////////////////////////////////////////////////////////
233 /// \class CallbackNodeType
234 ///
235 /// \brief This class specifies a CallbackNode with a given callback function.
236 ///
238 {
239 public:
240 
241  /// Creates a callback node type with callback function \p function.
242  ///
244  _function(function) {
245  }
246 
247  /// Creates a CallbackNode from this node type.
248  ///
249  virtual VdfNode *NewNode(VdfNetwork *net) const
250  {
251  return new DependencyCallbackNode(
252  net, _inputSpecs, _outputSpecs,
253  _function, _inputDependencyFunction, _outputDependencyFunction);
254  }
255 
256  /// Adds a ReadConnector to this node type.
257  ///
258  template <typename T>
260  _inputSpecs.ReadConnector<T>(name);
261  return *this;
262  }
263 
264  /// Adds a ReadWrite input and an associated Output to this node type.
265  ///
266  template<typename T>
267  CallbackNodeType &ReadWrite(const TfToken &name, const TfToken &outName) {
268  _inputSpecs.ReadWriteConnector<T>(name, outName);
269  _outputSpecs.Connector<T>(outName);
270  return *this;
271  }
272 
273  /// Adds an output to this node type.
274  ///
275  template<typename T>
277  _outputSpecs.Connector<T>(name);
278  return *this;
279  }
280 
281  /// Sets an input dependency mask computation callback for this
282  /// node type.
283  ///
286  _inputDependencyFunction = function;
287  return *this;
288  }
289 
290  /// Sets an output dependency mask computation callback for this
291  /// node type.
292  ///
295  _outputDependencyFunction = function;
296  return *this;
297  }
298 
299 private:
300 
301  VdfInputSpecs _inputSpecs;
302  VdfOutputSpecs _outputSpecs;
303 
304  CallbackNode::ValueFunction *_function;
305  DependencyCallbackNode::InputDependencyFunction _inputDependencyFunction;
306  DependencyCallbackNode::OutputDependencyFunction _outputDependencyFunction;
307 };
308 
309 
310 ////////////////////////////////////////////////////////////////////////////////
311 /// \class Node
312 ///
313 /// \brief This class is a wrapper around a VdfNode.
314 ///
315 
316 class Node
317 {
318 private:
319 
320  // These are private helper classes to support connection creation.
321 
322  // Represents a node's input.
323  class _NodeInput
324  {
325  public:
326  VdfNode *inputNode;
327  TfToken inputName;
328  VdfMask inputMask;
329  };
330 
331  // Represents a node's output.
332  class _NodeOutput
333  {
334  public:
335 
336  VDF_API
337  Node &operator>>(const _NodeInput &rhs);
338 
339  Node *owner;
340  TfToken outputName;
341  };
342 
343 
344 public:
345 
346  /// Operator used to connect the default output of this node to
347  /// the input described by \p rhs.
348  ///
349  VDF_API
350  Node &operator>>(const _NodeInput &rhs);
351 
352  /// Returns an input to this node that can be connected to an output.
353  ///
354  VDF_API
355  _NodeInput In(const TfToken &inputName, const VdfMask &inputMask);
356 
357  /// Returns an output to this node that can be connected to an input.
358  ///
359  VDF_API
360  _NodeOutput Output(const TfToken &outputName);
361 
362  /// Set a value on this node. Assumes it is an input node.
363  ///
364  /// Note: you'll get a crash if this node isn't an input vector.
365  ///
366  template<typename T>
367  Node &SetValue(int index, const T &val) {
368  dynamic_cast<VdfInputVector<T> *>(_vdfNode)->SetValue(index, val);
369  return *this;
370  }
371 
372  /// Returns a pointer to the underlying VdfNode.
373  ///
374  operator VdfNode *() { return GetVdfNode(); }
375 
376  VdfNode *GetVdfNode() { return _vdfNode; }
377 
378  const VdfNode *GetVdfNode() const { return _vdfNode; }
379 
380  VdfOutput *GetOutput() const { return _vdfNode->GetOutput(); }
381 
382 private:
383 
384  // Helper method to actually do the connection.
385  //
386  void _Connect(const _NodeInput &rhs, VdfOutput *output);
387 
388  friend class Network;
389  friend class _NodeOutput;
390 
391  // The network for connection purposes.
392  VdfNetwork *_network;
393 
394  // The underlying VdfNode that we represent.
395  VdfNode *_vdfNode;
396 };
397 
398 
399 ////////////////////////////////////////////////////////////////////////////////
400 /// \class Network
401 ///
402 /// \brief This is a container class used to hold on to all the nodes and
403 /// to facilitate their management.
404 ///
405 class Network
406 {
407 
408 private:
409 
410  ////////////////////////////////////////////////////////////////////////////////
411  ///
412  /// \class _EditMonitor
413  ///
414  /// An EditMonitor used to track node actions
415  ///
416  class VDF_API_TYPE _EditMonitor : public VdfNetwork::EditMonitor
417  {
418  public:
419 
420  /// Constructs an _EditMonitor for \p network
421  ///
422  _EditMonitor(Network *network) : _network(network) {}
423 
424  VDF_API
425  ~_EditMonitor();
426 
427  /// \name Implemented Edit Monitor Events
428  /// @{
429 
430  /// Ensures that the VdfTestUtils::Node corresponding to the deleted
431  /// VdfNode \p node is also deleted from the VdfTestUtils::Network
432  ///
433  VDF_API
434  void WillDelete(const VdfNode *node) override;
435 
436  /// Ensures that all VdfTestUtils::Nodes are deleted from the
437  /// VdfTestUtils::Network
438  ///
439  VDF_API
440  void WillClear() override;
441  /// @}
442 
443  /// \name Unimplemented Edit Monitor Events
444  /// @{
445  void DidConnect(const VdfConnection *connection) override {}
446  void DidAddNode(const VdfNode *node) override {}
447  void WillDelete(const VdfConnection *connection) override {}
448  /// @}
449 
450 
451  private:
452  Network *_network;
453  };
454 
455 
456 public:
457 
458  Network() : _editMonitor(this) {
459  _network.RegisterEditMonitor(&_editMonitor);
460  }
461 
463  _network.UnregisterEditMonitor(&_editMonitor);
464  }
465 
466  /// Creates a node named \p nodeName of type \p nodeType.
467  ///
468  /// Note that \p nodeName will be the debug name of the created node.
469  ///
470  /// Note also that there is no error checking of whether or not this
471  /// nodeName has already been used, and the new node will simply overwrite
472  /// the old one.
473  ///
474  VDF_API
475  void Add(const std::string &nodeName, const NodeType &nodeType);
476 
477  /// Takes ownership of a \p customNode that was created externally.
478  ///
479  /// It must have been created with this network's VdfNetwork though.
480  ///
481  VDF_API
482  void Add(const std::string &nodeName, VdfNode *customNode);
483 
484  /// Creates an input vector of type T named \p nodeName.
485  ///
486  template <typename T>
487  void AddInputVector(const std::string &nodeName, size_t size = 1) {
488  Add(nodeName, InputNodeType<T>(size));
489  }
490 
491  /// Returns a reference to a node named \p nodeName.
492  ///
493  VDF_API
494  Node &operator[](const std::string &nodeName);
495 
496  /// Returns a const reference to a node named \p nodeName.
497  ///
498  VDF_API
499  const Node &operator[](const std::string &nodeName) const;
500 
501  /// Returns the node name for the VdfTestUtils::Node corresponding to
502  /// a VdfNode with VdfId \p nodeId
503  ///
504  VDF_API
505  const std::string GetNodeName(const VdfId nodeId);
506 
507  /// Returns a pointer to a connection named \p connectionName. The syntax
508  /// for connectionName is:
509  ///
510  /// srcNode:connector -> tgtNode:connector
511  ///
512  /// If there is exactly one input or output connector only, you can also
513  /// write:
514  ///
515  /// srcNode -> tgtNode:connector
516  ///
517  VDF_API
518  VdfConnection *GetConnection(const std::string &connectionName);
519 
520  /// Returns a reference to the underlying VdfNetwork.
521  ///
522  VdfNetwork &GetNetwork() { return _network; }
523 
524  /// Returns a const reference to the underlying VdfNetwork.
525  ///
526  const VdfNetwork &GetNetwork() const { return _network; }
527 
528 private:
529 
530  // Node class needs to publish _connections;
531  friend class Node;
532 
533  // Nodes that have been created, indexed by their name.
535  _StringToNodeMap _nodes;
536 
537  // The network that will contain the VdfNodes we create.
538  VdfNetwork _network;
539 
540  // An EditMonitor that allows us to keep the Network in sync when Nodes
541  // are deleted
542  _EditMonitor _editMonitor;
543 };
544 
545 
546 ////////////////////////////////////////////////////////////////////////////////
547 /// \class ExecutionStatsProcessor
548 ///
549 /// \brief Simple processor that processor ExecutionStats into a vector of
550 /// vector of events and a vector of substats that mirrors the internal
551 /// structure of ExecutionStats.
552 ///
553 
554 
556 public:
557 
558  /// Constructor.
559  ///
561 
562  /// Destructor.
563  ///
564  VDF_API
566 
567  typedef
568  std::unordered_map<
570  std::vector<VdfExecutionStats::Event>>
572 
574  std::vector<ExecutionStatsProcessor*> subStats;
575 
576 protected:
577  /// Virtual method implementing process event for processing.
578  ///
579  VDF_API
580  void _ProcessEvent(
582  const VdfExecutionStats::Event& event) override;
583 
584  /// Virtual method implementing process sub stat for processing.
585  ///
586  VDF_API
587  void _ProcessSubStat(const VdfExecutionStats* stats) override;
588 };
589 
590 ////////////////////////////////////////////////////////////////////////////////
591 /// \class ExecutionStats
592 ///
593 /// \brief Simple wrapper around ExecutionStats that allows for logging
594 /// arbitrary data for testing.
595 ///
596 
598 public:
599 
600  /// Constructor.
601  ///
602  ExecutionStats() : _stats(std::make_unique<_ExecutionStats>()) {}
603 
604  //// Destructor.
605  ///
607 
608  /// Public log function.
609  ///
610  VDF_API
611  void Log(VdfExecutionStats::EventType event, VdfId nodeId, uint64_t data);
612 
613  /// Public log begin function.
614  ///
615  VDF_API
616  void LogBegin(
618  VdfId nodeId,
619  uint64_t data);
620 
621  /// Public log end function.
622  ///
623  VDF_API
624  void LogEnd(
626  VdfId nodeId,
627  uint64_t data);
628 
629  /// Processes the processor using the internally held stats.
630  ///
631  VDF_API
632  void GetProcessedStats(VdfExecutionStatsProcessor* processor) const;
633 
634  /// Adds a sub stat to the internally held ExecutionStats.
635  ///
636  VDF_API
637  void AddSubStat(VdfId nodeId);
638 
639 private:
640  /// Sub-classed ExecutionStats that calls directly to log to bypass
641  /// needing a node.
642  ///
643  class _ExecutionStats : public VdfExecutionStats {
644  public:
645  _ExecutionStats() : VdfExecutionStats(&_network) {}
646  ~_ExecutionStats() {}
647 
648  void Log(
650  VdfId nodeId,
651  uint64_t data);
652 
653  void LogBegin(
655  VdfId nodeId,
656  uint64_t data);
657 
658  void LogEnd(
660  VdfId nodeId,
661  uint64_t data);
662 
663  void AddSubStat(VdfId nodeId);
664 
665  private:
666  VdfNetwork _network;
667  };
668 
669 private:
670  std::unique_ptr<_ExecutionStats> _stats;
671 };
672 
673 ////////////////////////////////////////////////////////////////////////////////
674 ///
675 /// Create a new test speculation executor.
676 ///
677 inline std::unique_ptr<VdfSpeculationExecutorBase>
679  const VdfSpeculationNode *speculationNode,
680  const VdfExecutorInterface *parentExecutor) {
681  // Multi-threaded executor.
683  return std::unique_ptr<VdfSpeculationExecutorBase>(
687  speculationNode, parentExecutor));
688  }
689 
690  // Single-threaded executor.
691  return std::unique_ptr<VdfSpeculationExecutorBase>(
695  speculationNode, parentExecutor));
696 }
697 
698 ////////////////////////////////////////////////////////////////////////////////
699 
700 } // namespace VdfTestUtils
701 
703 
704 #endif
std::vector< ExecutionStatsProcessor * > subStats
Definition: testUtils.h:574
const VdfNode * GetVdfNode() const
Definition: testUtils.h:378
virtual bool _IsDerivedEqual(const VdfNode &rhs) const override
Definition: testUtils.h:104
CallbackNodeType & Read(const TfToken &name)
Definition: testUtils.h:259
VdfNetwork & GetNetwork()
Definition: testUtils.h:522
void
Definition: png.h:1083
#define PXR_NAMESPACE_OPEN_SCOPE
Definition: pxr.h:73
CallbackNodeType & ComputeInputDependencyMaskCallback(const DependencyCallbackNode::InputDependencyFunction &function)
Definition: testUtils.h:284
void AddInputVector(const std::string &nodeName, size_t size=1)
Definition: testUtils.h:487
CallbackNode(VdfNetwork *network, const VdfInputSpecs &inputSpecs, const VdfOutputSpecs &outputSpecs, ValueFunction *const cb)
Definition: testUtils.h:88
CallbackNodeType(CallbackNode::ValueFunction *function)
Definition: testUtils.h:243
VDF_API _NodeOutput Output(const TfToken &outputName)
Definition: node.h:52
A VdfMask is placed on connections to specify the data flowing through them.
Definition: mask.h:36
**But if you need a or simply need to know when the task has note that the like this
Definition: thread.h:626
const VdfOutput * GetOutput(const TfToken &name) const
Definition: node.h:227
This is a container class used to hold on to all the nodes and to facilitate their management...
Definition: testUtils.h:405
std::function< VdfMask::Bits(const VdfMaskedOutput &maskedOutput, const VdfConnection &inputConnection)> InputDependencyFunction
Definition: testUtils.h:143
#define VDF_API
Definition: api.h:25
Executor used in speculation.
VDF_API Node & operator[](const std::string &nodeName)
VDF_API void Log(VdfExecutionStats::EventType event, VdfId nodeId, uint64_t data)
friend class _NodeOutput
Definition: testUtils.h:389
OutputAccessor(const VdfContext &context)
Definition: testUtils.h:121
virtual VdfNode * NewNode(VdfNetwork *net) const
Definition: testUtils.h:249
Fast, compressed bit array which is capable of performing logical operations without first decompress...
virtual void Compute(const VdfContext &context) const override
Definition: testUtils.h:96
This class specifies a VdfInputVector of type T.
Definition: testUtils.h:214
struct _cl_event * event
Definition: glcorearb.h:2961
VDF_API VdfConnection * GetConnection(const std::string &connectionName)
This is a data manager for executors that uses data stored in a vector indexed by output ids...
CallbackNodeType & Out(const TfToken &name)
Definition: testUtils.h:276
Definition: token.h:70
DependencyCallbackNode(VdfNetwork *network, const VdfInputSpecs &inputSpecs, const VdfOutputSpecs &outputSpecs, ValueFunction *function, const InputDependencyFunction &inputDependencyFunction, const OutputDependencyFunction &outputDependencyFunction)
Definition: testUtils.h:150
VDF_API Node & operator>>(const _NodeInput &rhs)
VDF_API _NodeInput In(const TfToken &inputName, const VdfMask &inputMask)
VDF_API void GetProcessedStats(VdfExecutionStatsProcessor *processor) const
std::unique_ptr< VdfSpeculationExecutorBase > CreateSpeculationExecutor(const VdfSpeculationNode *speculationNode, const VdfExecutorInterface *parentExecutor)
Definition: testUtils.h:678
const VdfOutput * GetOutput() const
Definition: testUtils.h:123
A helper class which enables access to a VdfOutput from a VdfContext.
Definition: testUtils.h:118
TfCompressedBits Bits
Definition: mask.h:38
This class is a wrapper around a VdfNode.
Definition: testUtils.h:316
Simple processor that processor ExecutionStats into a vector of vector of events and a vector of subs...
Definition: testUtils.h:555
VDF_API void Add(const std::string &nodeName, const NodeType &nodeType)
A helper class that implements a simple callback node.
Definition: testUtils.h:82
Simple wrapper around ExecutionStats that allows for logging arbitrary data for testing.
Definition: testUtils.h:597
GLuint const GLchar * name
Definition: glcorearb.h:786
A node that pulls on a vector of value that are downstream of the current execution position...
VDF_API bool VdfIsParallelEvaluationEnabled()
void(const VdfContext &context) ValueFunction
Definition: testUtils.h:86
VDF_API void LogEnd(VdfExecutionStats::EventType event, VdfId nodeId, uint64_t data)
virtual VDF_API VdfMask _ComputeOutputDependencyMask(const VdfConnection &inputConnection, const VdfMask &inputDependencyMask, const VdfOutput &output) const
CallbackNodeType & ReadWrite(const TfToken &name, const TfToken &outName)
Definition: testUtils.h:267
Class to hold on to an externally owned output and a mask.
Definition: maskedOutput.h:31
GLsizeiptr size
Definition: glcorearb.h:664
This is a data manager for executors that uses data stored in a vector indexed by output ids...
VdfOutput * GetOutput() const
Definition: testUtils.h:380
#define VDF_API_TYPE
Definition: api.h:26
A CallbackNode which allows for passing in a custom input / output dependency callback.
Definition: testUtils.h:138
VDF_API void UnregisterEditMonitor(EditMonitor *monitor)
GLuint index
Definition: glcorearb.h:786
std::unordered_map< ExecutionStatsProcessor::ThreadId, std::vector< VdfExecutionStats::Event > > ThreadToEvents
Definition: testUtils.h:571
GLuint GLfloat * val
Definition: glcorearb.h:1608
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
InputNodeType(size_t size)
Definition: testUtils.h:217
VdfOutputSpecs & Connector(const TfToken &name)
Create an "Out" connector with the given name.
const VdfNetwork & GetNetwork() const
Definition: testUtils.h:526
virtual VdfMask _ComputeOutputDependencyMask(const VdfConnection &inputConnection, const VdfMask &inputDependencyMask, const VdfOutput &output) const
Definition: testUtils.h:175
const VdfNode & _GetNode(const VdfContext &context) const
Definition: iterator.h:45
virtual VdfNode * NewNode(VdfNetwork *net) const
Definition: testUtils.h:221
VDF_API void LogBegin(VdfExecutionStats::EventType event, VdfId nodeId, uint64_t data)
VdfInputSpecs & ReadConnector(const TfToken &inName, const TfToken &outName=VdfTokens->empty, bool prerequisite=false)
std::function< VdfMask(const VdfConnection &inputConnection, const VdfMask &inputDependencyMask, const VdfOutput &output)> OutputDependencyFunction
Definition: testUtils.h:148
virtual VDF_API VdfMask::Bits _ComputeInputDependencyMask(const VdfMaskedOutput &maskedOutput, const VdfConnection &inputConnection) const
This class provides an executor engine to the speculation executor.
VDF_API void AddSubStat(VdfId nodeId)
VdfNode * GetVdfNode()
Definition: testUtils.h:376
Abstract base class for classes that execute a VdfNetwork to compute a requested set of values...
VDF_API void RegisterEditMonitor(EditMonitor *monitor)
VDF_API const std::string GetNodeName(const VdfId nodeId)
CallbackNodeType & ComputeOutputDependencyMaskCallback(const DependencyCallbackNode::OutputDependencyFunction &function)
Definition: testUtils.h:293
Base class for various kinds of nodes that can be created.
Definition: testUtils.h:199
This class specifies a CallbackNode with a given callback function.
Definition: testUtils.h:237
Definition: format.h:1821
virtual VdfMask::Bits _ComputeInputDependencyMask(const VdfMaskedOutput &maskedOutput, const VdfConnection &inputConnection) const
Definition: testUtils.h:163
VdfInputSpecs & ReadWriteConnector(const TfToken &inName, const TfToken &outName)
Node & SetValue(int index, const T &val)
Definition: testUtils.h:367
uint64_t VdfId
The unique identifier type for Vdf objects.
Definition: types.h:107