HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
VdfParallelExecutorDataManager< DerivedClass > Class Template Reference

This class provides functionality to manage executor data stored as VdfExecutorData from multiple threads. The methods in this data manager are thread-safe unless called out to not be thread-safe in the documentation. More...

#include <parallelExecutorDataManager.h>

+ Inheritance diagram for VdfParallelExecutorDataManager< DerivedClass >:

Public Types

typedef
Vdf_ParallelExecutorDataManagerTraits
< DerivedClass >::DataHandle 
DataHandle
 
typedef
Vdf_ParallelExecutorDataManagerInterface
< DerivedClass, DataHandle
Base
 

Public Member Functions

VdfVectorGetInputValue (const VdfConnection &connection, const VdfMask &mask) const
 
VdfVectorGetOutputValueForReading (const DataHandle dataHandle, const VdfMask &mask) const
 
VdfVectorGetOrCreateOutputValueForWriting (const VdfOutput &output, const DataHandle dataHandle) const
 
void SetOutputValue (const VdfOutput &output, const VdfVector &value, const VdfMask &mask)
 
bool TakeOutputValue (const VdfOutput &output, VdfVector *value, const VdfMask &mask)
 
void SetReferenceOutputValue (const VdfVector *sourceValue, const VdfId destOutputId) const
 
void DuplicateOutputData (const VdfOutput &sourceOutput, const VdfOutput &destOutput)
 
bool IsOutputInvalid (const VdfId outputId, const VdfMask &invalidationMask) const
 
bool InvalidateOutput (const VdfOutput &output, const VdfMask &invalidationMask)
 
void Touch (const VdfOutput &output) const
 
void UpdateInvalidationTimestamp (const VdfInvalidationTimestamp &timestamp)
 
const VdfInvalidationTimestampGetInvalidationTimestamp () const
 
bool HasInvalidationTimestampMismatch (const DataHandle &sourceHandle, const DataHandle &destHandle) const
 

Static Public Member Functions

static VdfVectorCreateOutputCache (const VdfOutput &output, VdfExecutorBufferData *bufferData)
 
static VdfVectorCreateOutputCache (const VdfOutput &output, VdfExecutorBufferData *bufferData, const VdfMask::Bits &bits)
 

Protected Member Functions

 VdfParallelExecutorDataManager ()
 
 ~VdfParallelExecutorDataManager ()
 
- Protected Member Functions inherited from Vdf_ParallelExecutorDataManagerInterface< DerivedClass, Vdf_ParallelExecutorDataManagerTraits< DerivedClass >::DataHandle >
 Vdf_ParallelExecutorDataManagerInterface ()
 
virtual ~Vdf_ParallelExecutorDataManagerInterface ()
 
void _Resize (const VdfNetwork &network)
 
bool _IsValidDataHandle (const Vdf_ParallelExecutorDataManagerTraits< DerivedClass >::DataHandlehandle) const
 
Vdf_ParallelExecutorDataManagerTraits
< DerivedClass >::DataHandle 
_GetOrCreateDataHandle (const VdfId outputId) const
 
Vdf_ParallelExecutorDataManagerTraits
< DerivedClass >::DataHandle 
_GetDataHandle (const VdfId outputId) const
 
VdfExecutorBufferData_GetPrivateBufferData (const Vdf_ParallelExecutorDataManagerTraits< DerivedClass >::DataHandlehandle) const
 
VdfExecutorBufferData_GetScratchBufferData (const Vdf_ParallelExecutorDataManagerTraits< DerivedClass >::DataHandlehandle) const
 
VdfExecutorBufferData_GetPublicBufferData (const Vdf_ParallelExecutorDataManagerTraits< DerivedClass >::DataHandlehandle) const
 
void _PublishPrivateBufferData (const Vdf_ParallelExecutorDataManagerTraits< DerivedClass >::DataHandlehandle) const
 
void _PublishScratchBufferData (const Vdf_ParallelExecutorDataManagerTraits< DerivedClass >::DataHandlehandle) const
 
VdfExecutorBufferData_GetTransferredBufferData (const Vdf_ParallelExecutorDataManagerTraits< DerivedClass >::DataHandlehandle) const
 
bool _TransferBufferData (const Vdf_ParallelExecutorDataManagerTraits< DerivedClass >::DataHandlehandle, VdfVector *value, const VdfMask &mask)
 
void _ResetTransferredBufferData (const Vdf_ParallelExecutorDataManagerTraits< DerivedClass >::DataHandlehandle)
 
VdfExecutorInvalidationData_GetInvalidationData (const Vdf_ParallelExecutorDataManagerTraits< DerivedClass >::DataHandlehandle) const
 
VdfInvalidationTimestamp _GetInvalidationTimestamp (const Vdf_ParallelExecutorDataManagerTraits< DerivedClass >::DataHandlehandle) const
 
void _SetInvalidationTimestamp (const Vdf_ParallelExecutorDataManagerTraits< DerivedClass >::DataHandlehandle, VdfInvalidationTimestamp ts)
 
bool _IsTouched (const VdfId outputId) const
 
void _Touch (const VdfId outputId) const
 
bool _Untouch (const VdfId outputId)
 
void _ClearDataForOutput (const VdfOutput &output)
 

Detailed Description

template<typename DerivedClass>
class VdfParallelExecutorDataManager< DerivedClass >

This class provides functionality to manage executor data stored as VdfExecutorData from multiple threads. The methods in this data manager are thread-safe unless called out to not be thread-safe in the documentation.

Definition at line 42 of file parallelExecutorDataManager.h.

Member Typedef Documentation

template<typename DerivedClass>
typedef Vdf_ParallelExecutorDataManagerInterface<DerivedClass, DataHandle> VdfParallelExecutorDataManager< DerivedClass >::Base

The base class type.

Definition at line 60 of file parallelExecutorDataManager.h.

template<typename DerivedClass>
typedef Vdf_ParallelExecutorDataManagerTraits<DerivedClass>::DataHandle VdfParallelExecutorDataManager< DerivedClass >::DataHandle

The data handle type defined via the specialized traits class.

Definition at line 54 of file parallelExecutorDataManager.h.

Constructor & Destructor Documentation

template<typename DerivedClass>
VdfParallelExecutorDataManager< DerivedClass >::VdfParallelExecutorDataManager ( )
inlineprotected

Constructor

Definition at line 199 of file parallelExecutorDataManager.h.

template<typename DerivedClass>
VdfParallelExecutorDataManager< DerivedClass >::~VdfParallelExecutorDataManager ( )
inlineprotected

Prevent destruction via base class pointers (static polymorphism only).

Definition at line 206 of file parallelExecutorDataManager.h.

Member Function Documentation

template<typename DerivedClass >
VdfVector * VdfParallelExecutorDataManager< DerivedClass >::CreateOutputCache ( const VdfOutput output,
VdfExecutorBufferData bufferData 
)
static

Creates a new cache for an output, given the output data object.

Definition at line 402 of file parallelExecutorDataManager.h.

template<typename DerivedClass >
VdfVector * VdfParallelExecutorDataManager< DerivedClass >::CreateOutputCache ( const VdfOutput output,
VdfExecutorBufferData bufferData,
const VdfMask::Bits bits 
)
static

Creates a new cache for an output, given the output data object. This method makes sure that the returned vector is properly resized to accommodate all the elements set in the specified bits.

Definition at line 419 of file parallelExecutorDataManager.h.

template<typename DerivedClass >
void VdfParallelExecutorDataManager< DerivedClass >::DuplicateOutputData ( const VdfOutput sourceOutput,
const VdfOutput destOutput 
)

Duplicates the output data associated with sourceOutput and copies it to destOutput.

This method is not thread-safe.

Definition at line 437 of file parallelExecutorDataManager.h.

template<typename DerivedClass >
VdfVector * VdfParallelExecutorDataManager< DerivedClass >::GetInputValue ( const VdfConnection connection,
const VdfMask mask 
) const

Returns the input value flowing across the given connection with the given mask. If the the cache is not valid, or if the cache does not contain all the elements in mask, returns NULL. If no output data exists for output, it will not be created.

Definition at line 228 of file parallelExecutorDataManager.h.

template<typename DerivedClass>
const VdfInvalidationTimestamp& VdfParallelExecutorDataManager< DerivedClass >::GetInvalidationTimestamp ( ) const
inline

Returns the current invalidation timestamp on this executor.

Definition at line 183 of file parallelExecutorDataManager.h.

template<typename DerivedClass >
VdfVector * VdfParallelExecutorDataManager< DerivedClass >::GetOrCreateOutputValueForWriting ( const VdfOutput output,
const DataHandle  dataHandle 
) const

Returns a new or existing output value.

Definition at line 291 of file parallelExecutorDataManager.h.

template<typename DerivedClass >
VdfVector * VdfParallelExecutorDataManager< DerivedClass >::GetOutputValueForReading ( const DataHandle  dataHandle,
const VdfMask mask 
) const

Returns the cached value for a given output and mask. If the the cache is not valid, or if the cache does not contain all the elements in mask, returns NULL. If no output data exists for output, it will not be created.

Definition at line 261 of file parallelExecutorDataManager.h.

template<typename DerivedClass >
bool VdfParallelExecutorDataManager< DerivedClass >::HasInvalidationTimestampMismatch ( const DataHandle sourceHandle,
const DataHandle destHandle 
) const

Returns true, if the invalidation timestamps between sourceExecutorData and destExecutorData do not match, i.e. the source output should be mung buffer locked.

Definition at line 596 of file parallelExecutorDataManager.h.

template<typename DerivedClass >
bool VdfParallelExecutorDataManager< DerivedClass >::InvalidateOutput ( const VdfOutput output,
const VdfMask invalidationMask 
)

Marks output as invalid.

Returns true if there was anything to invalidate and false if the output was already invalid.

This method is not thread-safe.

Definition at line 505 of file parallelExecutorDataManager.h.

template<typename DerivedClass >
bool VdfParallelExecutorDataManager< DerivedClass >::IsOutputInvalid ( const VdfId  outputId,
const VdfMask invalidationMask 
) const

Returns true if the output is already invalid for the given invalidationMask.

Definition at line 480 of file parallelExecutorDataManager.h.

template<typename DerivedClass >
void VdfParallelExecutorDataManager< DerivedClass >::SetOutputValue ( const VdfOutput output,
const VdfVector value,
const VdfMask mask 
)

Sets the cached value for a given output, creating the output cache if necessary.

If the output already contains data, it will be merged with the new data as indicated by value and mask.

This method provides very limited thread-safety: It is safe to call this method if the data manager is already sized appropriately, and during a round of evaluation, data is set no more than once per individual output. It is not safe to call this method concurrently on the same output, including an output that may have its value mutated as part of a concurrent round of evaluation.

Definition at line 315 of file parallelExecutorDataManager.h.

template<typename DerivedClass >
void VdfParallelExecutorDataManager< DerivedClass >::SetReferenceOutputValue ( const VdfVector sourceValue,
const VdfId  destOutputId 
) const

Called to set destOutput's buffer output to be a reference to the sourceValue.

Definition at line 387 of file parallelExecutorDataManager.h.

template<typename DerivedClass >
bool VdfParallelExecutorDataManager< DerivedClass >::TakeOutputValue ( const VdfOutput output,
VdfVector value,
const VdfMask mask 
)

Transfers the ownership of value to the given output. Returns true if this succeeds. The output will assume responsibility for the lifetime management of value, if successful. Otherwise, the call site maintains this responsibility.

If a value has previously been transferred to this output, the method will fail to transfer the ownership of this value and return false.

Definition at line 365 of file parallelExecutorDataManager.h.

template<typename DerivedClass >
void VdfParallelExecutorDataManager< DerivedClass >::Touch ( const VdfOutput output) const

Marks the data at the given output as having been touched by evaluation.

Definition at line 588 of file parallelExecutorDataManager.h.

template<typename DerivedClass>
void VdfParallelExecutorDataManager< DerivedClass >::UpdateInvalidationTimestamp ( const VdfInvalidationTimestamp timestamp)
inline

Increments the the current invalidation timestamp on this executor.

This method is not thread-safe.

Definition at line 176 of file parallelExecutorDataManager.h.


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