HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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,
TfHash
NodeToRequestMap
 A map from VdfNode * to VdfMaskedOutputVector. More...
 

Static Public Member Functions

static VDF_API void Schedule (const VdfRequest &request, VdfSchedule *schedule, bool topologicallySort)
 
static VDF_API bool UpdateAffectsMaskForOutput (VdfSchedule *schedule, const VdfOutput &output)
 

Static Protected Member Functions

static VDF_API void _SetScheduleValid (VdfSchedule *schedule, const VdfNetwork *network)
 
static VDF_API void _InitializeRequestMasks (const VdfRequest &request, VdfSchedule *schedule, PoolPriorityVector *poolOutputs)
 
static VDF_API void _MarkSmallSchedule (VdfSchedule *schedule)
 Marks the schedule as small if it is indeed small. More...
 
static VDF_API void _ScheduleBufferPasses (const VdfRequest &request, VdfSchedule *schedule)
 
static VDF_API void _ScheduleForPassThroughs (const VdfRequest &request, VdfSchedule *schedule, const PoolPriorityVector &sortedPoolOutputs)
 
static VDF_API void _GenerateTasks (VdfSchedule *schedule, const PoolPriorityVector &sortedPoolOutputs)
 
static VDF_API void _ScheduleTaskGraph (VdfSchedule *schedule, const PoolPriorityVector &sortedPoolOutputs)
 
static VDF_API void _ComputeLockMasks (const VdfRequest &request, VdfSchedule *schedule, const PoolPriorityVector &sortedPoolOutputs)
 
static VDF_API void _ApplyAffectsMasks (VdfSchedule *schedule)
 
static VDF_API bool _ApplyAffectsMasksForNode (VdfScheduleNode *node)
 
static VDF_API void _UpdateAffectsMaskForInvocation (VdfSchedule *schedule, VdfScheduleNode *node)
 
static VDF_API bool _UpdateAffectsMasksForNode (VdfSchedule *schedule, VdfScheduleNode *node)
 
static VDF_API void _UpdateLockMaskForNode (VdfSchedule *schedule, VdfScheduleNode *node)
 

Detailed Description

Used to make a VdfSchedule.

Definition at line 34 of file scheduler.h.

Member Typedef Documentation

A map from VdfNode * to VdfMaskedOutputVector.

Definition at line 44 of file scheduler.h.

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

Definition at line 40 of file scheduler.h.

Member Function Documentation

static VDF_API void VdfScheduler::_ApplyAffectsMasks ( VdfSchedule schedule)
staticprotected

Applies the affects mask to the schedule.

static VDF_API bool VdfScheduler::_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).

static VDF_API void VdfScheduler::_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.

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

Generate tasks for the scheduled task graph. The task graph is used by the parallel evaluation engine.

static VDF_API void VdfScheduler::_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.

static VDF_API void VdfScheduler::_MarkSmallSchedule ( VdfSchedule schedule)
staticprotected

Marks the schedule as small if it is indeed small.

static VDF_API void VdfScheduler::_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.

static VDF_API void VdfScheduler::_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.

static VDF_API void VdfScheduler::_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.

static VDF_API void VdfScheduler::_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.

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

Updates the affects mask on an existing scheduled node invocation.

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

Updates schedule for node if affects mask changed.

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

Updates schedule for node if the lock mask changed.

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

Generates a schedule.

static VDF_API bool VdfScheduler::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: