Loading...
Searching...
No Matches
VdfParallelExecutorDataManager< DerivedClass > Class Template Reference

This class provides functionality to manage executor data stored as VdfExecutorData from multiple threads. More...

#include <parallelExecutorDataManager.h>

+ Inheritance diagram for VdfParallelExecutorDataManager< DerivedClass >:

Public Types

typedef Vdf_ParallelExecutorDataManagerTraits< DerivedClass >::DataHandle DataHandle
 The data handle type defined via the specialized traits class.
 
typedef Vdf_ParallelExecutorDataManagerInterface< DerivedClass, DataHandleBase
 The base class type.
 

Public Member Functions

VdfVectorGetInputValue (const VdfConnection &connection, const VdfMask &mask) const
 Returns the input value flowing across the given connection with the given mask.
 
VdfVectorGetOutputValueForReading (const DataHandle dataHandle, const VdfMask &mask) const
 Returns the cached value for a given output and mask.
 
VdfVectorGetOrCreateOutputValueForWriting (const VdfOutput &output, const DataHandle dataHandle) const
 Returns a new or existing output value.
 
void SetOutputValue (const VdfOutput &output, const VdfVector &value, const VdfMask &mask)
 Sets the cached value for a given output, creating the output cache if necessary.
 
bool TakeOutputValue (const VdfOutput &output, VdfVector *value, const VdfMask &mask)
 Transfers the ownership of value to the given output.
 
void SetReferenceOutputValue (const VdfVector *sourceValue, const VdfId destOutputId) const
 Called to set destOutput's buffer output to be a reference to the sourceValue.
 
void DuplicateOutputData (const VdfOutput &sourceOutput, const VdfOutput &destOutput)
 Duplicates the output data associated with sourceOutput and copies it to destOutput.
 
bool IsOutputInvalid (const VdfId outputId, const VdfMask &invalidationMask) const
 Returns true if the output is already invalid for the given invalidationMask.
 
bool InvalidateOutput (const VdfOutput &output, const VdfMask &invalidationMask)
 Marks output as invalid.
 
void Touch (const VdfOutput &output) const
 Marks the data at the given output as having been touched by evaluation.
 
void UpdateInvalidationTimestamp (const VdfInvalidationTimestamp &timestamp)
 Increments the the current invalidation timestamp on this executor.
 
const VdfInvalidationTimestampGetInvalidationTimestamp () const
 Returns the current invalidation timestamp on this executor.
 
bool HasInvalidationTimestampMismatch (const DataHandle &sourceHandle, const DataHandle &destHandle) const
 Returns true, if the invalidation timestamps between sourceExecutorData and destExecutorData do not match, i.e.
 

Static Public Member Functions

static VdfVectorCreateOutputCache (const VdfOutput &output, VdfExecutorBufferData *bufferData)
 Creates a new cache for an output, given the output data object.
 
static VdfVectorCreateOutputCache (const VdfOutput &output, VdfExecutorBufferData *bufferData, const VdfMask::Bits &bits)
 Creates a new cache for an output, given the output data object.
 

Protected Member Functions

 VdfParallelExecutorDataManager ()
 Constructor.
 
 ~VdfParallelExecutorDataManager ()
 Prevent destruction via base class pointers (static polymorphism only).
 
- Protected Member Functions inherited from Vdf_ParallelExecutorDataManagerInterface< DerivedClass, Vdf_ParallelExecutorDataManagerTraits< DerivedClass >::DataHandle >
 Vdf_ParallelExecutorDataManagerInterface ()
 Allow construction via derived classes, only.
 
virtual ~Vdf_ParallelExecutorDataManagerInterface ()
 Prevent destruction via base class pointers (static polymorphism only).
 
void _Resize (const VdfNetwork &network)
 Resize the data manager to accommodate all the outputs in the given network.
 
bool _IsValidDataHandle (const DataHandle handle) const
 Returns true if the given data handle is valid, i.e.
 
DataHandle _GetOrCreateDataHandle (const VdfId outputId) const
 Returns an existing data handle, or creates a new one for the given outputId.
 
DataHandle _GetDataHandle (const VdfId outputId) const
 Returns an existing data handle for the given outputId.
 
VdfExecutorBufferData_GetPrivateBufferData (const DataHandle handle) const
 Returns the private VdfExecutorBufferData associated with the given handle.
 
VdfExecutorBufferData_GetScratchBufferData (const DataHandle handle) const
 Returns the scratch VdfExecutorBufferData associated with the given handle.
 
VdfExecutorBufferData_GetPublicBufferData (const DataHandle handle) const
 Returns the public VdfExecutorBufferData associated with the given handle.
 
void _PublishPrivateBufferData (const DataHandle handle) const
 Publishes the private VdfExecutorBufferData, and retains the previously public VdfExecutorBufferData as private data.
 
void _PublishScratchBufferData (const DataHandle handle) const
 Publishes the scratch VdfExecutorBufferData, and retains the previously public VdfExecutorBufferData as scratch data.
 
VdfExecutorBufferData_GetTransferredBufferData (const DataHandle handle) const
 Returns the transferred VdfExecutorBufferData associated with the given handle.
 
bool _TransferBufferData (const DataHandle handle, VdfVector *value, const VdfMask &mask)
 Transfers ownership of the value to the output associated with handle.
 
void _ResetTransferredBufferData (const DataHandle handle)
 Resets the transferred buffer associated with the given handle.
 
VdfExecutorInvalidationData * _GetInvalidationData (const DataHandle handle) const
 Returns the VdfExecutorInvalidationData associated with the given handle.
 
VdfInvalidationTimestamp _GetInvalidationTimestamp (const DataHandle handle) const
 Returns the VdfInvalidationTimestamp associated with the given handle.
 
void _SetInvalidationTimestamp (const DataHandle handle, VdfInvalidationTimestamp ts)
 Sets the invalidation timestamp for the give data handle.
 
bool _IsTouched (const VdfId outputId) const
 Returns true if the data at the given output has been touched by evaluation.
 
void _Touch (const VdfId outputId) const
 Marks the data at the given output as having been touched by evaluation.
 
bool _Untouch (const VdfId outputId)
 Marks the data at the given output as not having been touched by evaluation.
 
void _ClearDataForOutput (const VdfOutput &output)
 Clears the executor data for a specific 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

◆ Base

template<typename DerivedClass >
Vdf_ParallelExecutorDataManagerInterface<DerivedClass, DataHandle> Base

The base class type.

Definition at line 60 of file parallelExecutorDataManager.h.

◆ DataHandle

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

The data handle type defined via the specialized traits class.

Definition at line 54 of file parallelExecutorDataManager.h.

Constructor & Destructor Documentation

◆ VdfParallelExecutorDataManager()

template<typename DerivedClass >
VdfParallelExecutorDataManager ( )
inlineprotected

Constructor.

Definition at line 199 of file parallelExecutorDataManager.h.

◆ ~VdfParallelExecutorDataManager()

template<typename DerivedClass >
~VdfParallelExecutorDataManager ( )
inlineprotected

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

Definition at line 206 of file parallelExecutorDataManager.h.

Member Function Documentation

◆ CreateOutputCache() [1/2]

template<typename DerivedClass >
VdfVector * 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.

◆ CreateOutputCache() [2/2]

template<typename DerivedClass >
VdfVector * 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.

◆ DuplicateOutputData()

template<typename DerivedClass >
void 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.

◆ GetInputValue()

template<typename DerivedClass >
VdfVector * 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.

◆ GetInvalidationTimestamp()

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

Returns the current invalidation timestamp on this executor.

Definition at line 183 of file parallelExecutorDataManager.h.

◆ GetOrCreateOutputValueForWriting()

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

Returns a new or existing output value.

Definition at line 291 of file parallelExecutorDataManager.h.

◆ GetOutputValueForReading()

template<typename DerivedClass >
VdfVector * 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.

◆ HasInvalidationTimestampMismatch()

template<typename DerivedClass >
bool 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.

◆ InvalidateOutput()

template<typename DerivedClass >
bool 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.

◆ IsOutputInvalid()

template<typename DerivedClass >
bool 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.

◆ SetOutputValue()

template<typename DerivedClass >
void 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.

◆ SetReferenceOutputValue()

template<typename DerivedClass >
void 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.

◆ TakeOutputValue()

template<typename DerivedClass >
bool 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.

◆ Touch()

template<typename DerivedClass >
void 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.

◆ UpdateInvalidationTimestamp()

template<typename DerivedClass >
void 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: