scheduleTasks.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_TASKS_H
8 #define PXR_EXEC_VDF_SCHEDULE_TASKS_H
9 
11 
12 #include "pxr/pxr.h"
13 
14 #include "pxr/exec/vdf/mask.h"
15 
16 #include "pxr/base/tf/diagnostic.h"
17 
18 PXR_NAMESPACE_OPEN_SCOPE
19 
20 class VdfOutput;
21 
25 typedef uint32_t VdfScheduleTaskId;
26 
29 typedef uint32_t VdfScheduleTaskIndex;
30 
33 typedef uint32_t VdfScheduleTaskNum;
34 
37 static const uint32_t VdfScheduleTaskInvalid = uint32_t(-1);
38 
41 inline bool VdfScheduleTaskIsInvalid(uint32_t task) {
42  return task == VdfScheduleTaskInvalid;
43 }
44 
49  VdfScheduleTaskId taskId;
50  VdfScheduleTaskNum taskNum;
51 };
52 
57  bool isAffective : 1; // Is this compute task affective?
58  bool hasKeep : 1; // Does this compute task keep any data?
59 };
60 
65  // The index into the VdfScheduleNodeInvocation array. This is an invalid
66  // index for nodes with only one compute task.
67  VdfScheduleTaskIndex invocationIndex;
68 
69  // The corresponding inputs task. This is an invalid task index for nodes
70  // with only one compute task, and without prereqs and reads, which could
71  // be run in parallel with read/writes.
72  VdfScheduleTaskIndex inputsTaskIndex;
73 
74  // The corresponding node preparation task. Every scheduled node has at
75  // most one of these. The task is shared amongst all invocations of that
76  // node. An invalid index denotes that node preparation need not be
77  // synchronized.
78  VdfScheduleTaskIndex prepTaskIndex;
79 
80  // Index into the input dependencies array. The first required input
81  // dependency, i.e. read/write or read not dependent on prereqs.
82  VdfScheduleTaskIndex requiredsIndex;
83 
84  // The number of required input dependencies.
85  VdfScheduleTaskNum requiredsNum;
86 
87  // Additional bit flags.
89 };
90 
96  VdfMask requestMask;
97  VdfMask affectsMask;
98  VdfMask keepMask;
99 };
100 
105  VdfScheduleTaskIndex inputDepIndex;
106  VdfScheduleTaskNum prereqsNum;
107  VdfScheduleTaskNum optionalsNum;
108 };
109 
116 
122  // A unique index for the output and mask combination of this dependency.
124 
125  // The requested output at the source end of the input dependency.
126  const VdfOutput &output;
127 
128  // The requested mask at the source end of the input dependency.
129  VdfMask mask;
130 
131  // The compute task id of the first task to be invoked to fulfill this
132  // input dependency. Note, this can be a compute task id, or a keep task
133  // index. If this is a keep task index, computeTaskNum shall be set to 0.
134  VdfScheduleTaskId computeOrKeepTaskId;
135 
136  // The number of compute task ids to be invoked to fulfill this input
137  // dependency. If this is 0, the input dependency is for a keep task.
138  VdfScheduleTaskNum computeTaskNum;
139 };
140 
141 PXR_NAMESPACE_CLOSE_SCOPE
142 
143 #endif
A structure describing a range of task ids, beginning at taskId and ending at taskId + taskNum.
Definition: scheduleTasks.h:48
uint32_t VdfScheduleTaskNum
Type describing a number of task indices or ids.
Definition: scheduleTasks.h:33
A VdfMask is placed on connections to specify the data flowing through them.
Definition: mask.h:36
Low-level utilities for informing users of various internal and external diagnostic conditions.
Describes a single input dependency, i.e.
uint32_t VdfScheduleTaskId
Type describing a task id.
Definition: scheduleTasks.h:20
Further describes every invocation of a single node.
Definition: scheduleTasks.h:95
A VdfOutput represents an output on a node.
Definition: output.h:31
A VdfScheduleComputeTask represents a unit of computation for the parallel evaluation engine.
Definition: scheduleTasks.h:64
Structure describing an additional task used to run prereqs and reads concurrently with read/write in...
bool VdfScheduleTaskIsInvalid(uint32_t task)
Returns true if the given task index or id is invalid.
Definition: scheduleTasks.h:41
uint32_t VdfScheduleTaskIndex
Type describing a task index.
Definition: scheduleTasks.h:29
uint32_t VdfScheduleInputDependencyUniqueIndex
A sequential index assigned to the unique output and mask combination of a VdfScheduleInputDependency...
A bit field with additional flags to further describe a VdfScheduleComputeTask.
Definition: scheduleTasks.h:56