Loading...
Searching...
No Matches
VdfScheduler Class Reference

Used to make a VdfSchedule. More...

#include <scheduler.h>

Public Types

typedef std::vector< std::pair< VdfPoolChainIndex, const VdfOutput * > > PoolPriorityVector
 
typedef TfHashMap< const VdfNode *, VdfMaskedOutputVector, TfHashNodeToRequestMap
 A map from VdfNode * to VdfMaskedOutputVector.
 

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.
 

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 _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.
 
static VDF_API void _MarkSmallSchedule (VdfSchedule *schedule)
 Marks the schedule as small if it is indeed small.
 
static VDF_API void _ScheduleBufferPasses (const VdfRequest &request, VdfSchedule *schedule)
 Method to schedule the buffer passes and the "keep" masks for the scheduled nodes.
 
static VDF_API void _ScheduleForPassThroughs (const VdfRequest &request, VdfSchedule *schedule, const PoolPriorityVector &sortedPoolOutputs)
 Schedule the outputs from which buffers should be passed.
 
static VDF_API void _GenerateTasks (VdfSchedule *schedule, const PoolPriorityVector &sortedPoolOutputs)
 Generate tasks for the scheduled task graph.
 
static VDF_API void _ScheduleTaskGraph (VdfSchedule *schedule, const PoolPriorityVector &sortedPoolOutputs)
 Schedule the task graph for multi-threaded munging.
 
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 void _ApplyAffectsMasks (VdfSchedule *schedule)
 Applies the affects mask to the schedule.
 
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.
 

Detailed Description

Used to make a VdfSchedule.

Definition at line 34 of file scheduler.h.

Member Typedef Documentation

◆ NodeToRequestMap

typedef TfHashMap<const VdfNode *, VdfMaskedOutputVector, TfHash> NodeToRequestMap

A map from VdfNode * to VdfMaskedOutputVector.

Definition at line 44 of file scheduler.h.

◆ PoolPriorityVector

typedef std::vector< std::pair<VdfPoolChainIndex, const VdfOutput *> > PoolPriorityVector

Definition at line 40 of file scheduler.h.

Member Function Documentation

◆ _ApplyAffectsMasks()

static VDF_API void _ApplyAffectsMasks ( VdfSchedule schedule)
staticprotected

Applies the affects mask to the schedule.

◆ _ApplyAffectsMasksForNode()

static VDF_API bool _ApplyAffectsMasksForNode ( VdfScheduleNode node)
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).

◆ _ComputeLockMasks()

static VDF_API void _ComputeLockMasks ( const VdfRequest &  request,
VdfSchedule schedule,
const PoolPriorityVector &  sortedPoolOutputs 
)
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.

◆ _GenerateTasks()

static VDF_API void _GenerateTasks ( VdfSchedule schedule,
const PoolPriorityVector &  sortedPoolOutputs 
)
staticprotected

Generate tasks for the scheduled task graph.

The task graph is used by the parallel evaluation engine.

◆ _InitializeRequestMasks()

static VDF_API void _InitializeRequestMasks ( const VdfRequest &  request,
VdfSchedule schedule,
PoolPriorityVector *  poolOutputs 
)
staticprotected

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.

◆ _MarkSmallSchedule()

static VDF_API void _MarkSmallSchedule ( VdfSchedule schedule)
staticprotected

Marks the schedule as small if it is indeed small.

◆ _ScheduleBufferPasses()

static VDF_API void _ScheduleBufferPasses ( const VdfRequest &  request,
VdfSchedule schedule 
)
staticprotected

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.

◆ _ScheduleForPassThroughs()

static VDF_API void _ScheduleForPassThroughs ( const VdfRequest &  request,
VdfSchedule schedule,
const PoolPriorityVector &  sortedPoolOutputs 
)
staticprotected

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.

◆ _ScheduleTaskGraph()

static VDF_API void _ScheduleTaskGraph ( VdfSchedule schedule,
const PoolPriorityVector &  sortedPoolOutputs 
)
staticprotected

Schedule the task graph for multi-threaded munging.

This will generate tasks and invocations, as well as dependencies between them.

◆ _SetScheduleValid()

static VDF_API void _SetScheduleValid ( VdfSchedule schedule,
const VdfNetwork network 
)
staticprotected

Method to signal that a schedule is done being built and that it is now valid for the given network.

◆ _UpdateAffectsMaskForInvocation()

static VDF_API void _UpdateAffectsMaskForInvocation ( VdfSchedule schedule,
VdfScheduleNode node 
)
staticprotected

Updates the affects mask on an existing scheduled node invocation.

◆ _UpdateAffectsMasksForNode()

static VDF_API bool _UpdateAffectsMasksForNode ( VdfSchedule schedule,
VdfScheduleNode node 
)
staticprotected

Updates schedule for node if affects mask changed.

◆ _UpdateLockMaskForNode()

static VDF_API void _UpdateLockMaskForNode ( VdfSchedule schedule,
VdfScheduleNode node 
)
staticprotected

Updates schedule for node if the lock mask changed.

◆ Schedule()

static VDF_API void Schedule ( const VdfRequest &  request,
VdfSchedule schedule,
bool  topologicallySort 
)
static

Generates a schedule.

◆ UpdateAffectsMaskForOutput()

static VDF_API bool UpdateAffectsMaskForOutput ( VdfSchedule schedule,
const VdfOutput output 
)
static

Update schedule after the affects mask changed on output.


The documentation for this class was generated from the following file: