VdfExecutorInterface Class Referenceabstract

Abstract base class for classes that execute a VdfNetwork to compute a requested set of values. More...

+ Inheritance diagram for VdfExecutorInterface:

Public Member Functions

 VdfExecutorInterface (const VdfExecutorInterface &)=delete
 Noncopyable. More...
 
VdfExecutorInterfaceoperator= (const VdfExecutorInterface &)=delete
 
virtual VDF_API ~VdfExecutorInterface ()
 Destructor. More...
 
Evaluation
VDF_API void Run (const VdfSchedule &schedule, VdfExecutorErrorLogger *errorLogger=NULL)
 Executes the schedule. More...
 
VDF_API void Run (const VdfSchedule &schedule, const VdfRequest &computeRequest, VdfExecutorErrorLogger *errorLogger=NULL)
 Executes the schedule. More...
 
Factory Construction
virtual const VdfExecutorFactoryBase & GetFactory () const =0
 Returns a factory class facilitating the construction of new executors that share traits with this executor instance. More...
 
Executor Observer Notification
VDF_API void RegisterObserver (const VdfExecutorObserver *observer) const
 Can be called by clients to register a VdfExecutorObserver with this executor. More...
 
VDF_API void UnregisterObserver (const VdfExecutorObserver *observer) const
 Must be called by clients to unregister a VdfExecutorObserver, which has been previously registered with RegisterObserver(). More...
 
Cache Management
virtual void Resize (const VdfNetwork &network)
 Resize the executor to accomodate data for the given network. More...
 
virtual void SetOutputValue (const VdfOutput &output, const VdfVector &value, const VdfMask &mask)=0
 Sets the cached value for a given output. More...
 
virtual bool TakeOutputValue (const VdfOutput &output, VdfVector *value, const VdfMask &mask)=0
 Transfers ownership of the value to the given output. More...
 
const VdfVectorGetOutputValue (const VdfOutput &output, const VdfMask &mask) const
 Returns the cached value for a given output if it has a cache that contains all values specified by mask. More...
 
virtual void DuplicateOutputData (const VdfOutput &sourceOutput, const VdfOutput &destOutput)=0
 Duplicates the output data associated with sourceOutput and copies it to destOutput. More...
 
Executor Hierarchy Management
const VdfExecutorInterfaceGetParentExecutor () const
 Returns the parent executor, if any. More...
 
VDF_API void SetParentExecutor (const VdfExecutorInterface *parentExecutor)
 Sets the parent executor. More...
 
Invalidation
VDF_API void InvalidateValues (const VdfMaskedOutputVector &invalidationRequest)
 Invalidates the network, starting from the masked outputs in request. More...
 
VDF_API void InvalidateTopologicalState ()
 Invalidate all state depending on network topology. More...
 
VDF_API void ClearData ()
 Clears the executor buffers. More...
 
VDF_API void ClearDataForOutput (const VdfId outputId, const VdfId nodeId)
 Clears the executor buffers for a specific output. More...
 
virtual bool IsEmpty () const =0
 Returns true if the executor buffers are empty. More...
 
Mung Buffer Locking Invalidation Timestamps
void IncrementExecutorInvalidationTimestamp ()
 Increment this executor's invalidation timestamp for mung buffer locking. More...
 
void InheritExecutorInvalidationTimestamp (const VdfExecutorInterface &executor)
 Inherit the invalidation timestamp from another executor. More...
 
VdfInvalidationTimestamp GetExecutorInvalidationTimestamp () const
 Returns this executor's invalidation timestamp. More...
 
virtual bool HasInvalidationTimestampMismatch (const VdfOutput &source, const VdfOutput &dest) const =0
 Returns true, if the invalidation timestamps between the source and dest outputs do not match, i.e. More...
 
Executor Interruption
void SetInterruptionFlag (const std::atomic_bool *interruptionFlag)
 Set the interruption flag. More...
 
const std::atomic_bool * GetInterruptionFlag () const
 Returns the interruption flag. More...
 
bool HasBeenInterrupted () const
 Returns whether or not the executor has been interrupted, if the executor supports interruption. More...
 
Diagnostic Support
void SetExecutionStats (VdfExecutionStats *stats)
 Sets an execution stats object. More...
 
VdfExecutionStatsGetExecutionStats () const
 Returns the Execution Stats object, if any. More...
 

Protected Member Functions

VDF_API VdfExecutorInterface ()
 Protected default constructor. More...
 
VDF_API VdfExecutorInterface (const VdfExecutorInterface *parentExecutor)
 Construct with a parent executor. More...
 
virtual void _Run (const VdfSchedule &schedule, const VdfRequest &computeRequest, VdfExecutorErrorLogger *errorLogger)=0
 Run this executor with the given schedule and request. More...
 
virtual const VdfVector_GetInputValue (const VdfConnection &connection, const VdfMask &mask) const =0
 Returns a value for the cache that flows across connection. More...
 
virtual const VdfVector_GetOutputValueForReading (const VdfOutput &output, const VdfMask &mask) const =0
 Returns an output value for reading. More...
 
virtual VdfVector_GetOutputValueForWriting (const VdfOutput &output) const =0
 Returns an output value for writing. More...
 
virtual bool _IsOutputInvalid (const VdfId outputId, const VdfMask &invalidationMask) const =0
 Returns true if the output is already invalid for the given invalidationMask. More...
 
virtual bool _InvalidateOutput (const VdfOutput &output, const VdfMask &invalidationMask)=0
 Called during invalidation to mark outputs as invalid and determine when the traversal can terminate early. More...
 
virtual bool _PreProcessInvalidation (const VdfMaskedOutputVector &invalidationRequest, VdfMaskedOutputVector *processedRequest)
 This method is called as a pre-processing step before an InvalidateValues() call. More...
 
virtual void _UpdateInvalidationTimestamp ()=0
 Called before invalidation begins to update the timestamp that will be written for every VdfOutput visited during invalidation. More...
 
virtual VDF_API void _ClearData ()
 Virtual implementation of ClearData, which can optionally be overridden by derived classes. More...
 
virtual VDF_API void _ClearDataForOutput (const VdfId outputId, const VdfId nodeId)
 Virtual implementation of ClearDataForOutput, which can optionally be overridden by derived classes. More...
 
virtual void _SetReferenceOutputValue (const VdfOutput &destOutput, const VdfOutput &sourceOutput, const VdfMask &sourceMask) const =0
 Called to set destOutput's buffer output to be a reference to the buffer output of sourceOutput. More...
 
virtual void _TouchOutput (const VdfOutput &output) const =0
 Mark the output as having been visited. More...
 

Friends

class VdfContext
 
class VdfIterator
 
class VdfSpeculationNode
 
template<template< typename > class E, class D >
class VdfSpeculationExecutor
 
template<class T >
class VdfSpeculationExecutorEngine
 
template<class T >
class VdfPullBasedExecutorEngine
 
template<class T >
class VdfParallelSpeculationExecutorEngine
 
class VdfExecutorInvalidator
 

Detailed Description

Abstract base class for classes that execute a VdfNetwork to compute a requested set of values.

Definition at line 44 of file executorInterface.h.

Constructor & Destructor Documentation

◆ VdfExecutorInterface() [1/3]

Noncopyable.

◆ ~VdfExecutorInterface()

virtual VDF_API ~VdfExecutorInterface ( )
virtual

Destructor.

◆ VdfExecutorInterface() [2/3]

VDF_API VdfExecutorInterface ( )
protected

Protected default constructor.

◆ VdfExecutorInterface() [3/3]

VDF_API VdfExecutorInterface ( const VdfExecutorInterface parentExecutor)
explicitprotected

Construct with a parent executor.

Member Function Documentation

◆ _ClearData()

virtual VDF_API void _ClearData ( )
protectedvirtual

Virtual implementation of ClearData, which can optionally be overridden by derived classes.

The default implementation is a no-op.

Reimplemented in EfMaskedSubExecutor, and EfPageCacheBasedExecutor< EngineType, DataManagerType >.

◆ _ClearDataForOutput()

virtual VDF_API void _ClearDataForOutput ( const VdfId  outputId,
const VdfId  nodeId 
)
protectedvirtual

Virtual implementation of ClearDataForOutput, which can optionally be overridden by derived classes.

The default implementation is a no-op.

Reimplemented in VdfDataManagerBasedExecutor< DataManagerType, VdfExecutorInterface >, VdfDataManagerBasedExecutor< DataManagerType, VdfSpeculationExecutorBase >, and VdfDataManagerBasedExecutor< VdfParallelDataManagerVector, VdfExecutorInterface >.

◆ _GetInputValue()

◆ _GetOutputValueForReading()

◆ _GetOutputValueForWriting()

◆ _InvalidateOutput()

virtual bool _InvalidateOutput ( const VdfOutput output,
const VdfMask invalidationMask 
)
protectedpure virtual

Called during invalidation to mark outputs as invalid and determine when the traversal can terminate early.

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

Implemented in VdfDataManagerBasedExecutor< DataManagerType, VdfExecutorInterface >, VdfDataManagerBasedExecutor< DataManagerType, VdfSpeculationExecutorBase >, VdfDataManagerBasedExecutor< VdfParallelDataManagerVector, VdfExecutorInterface >, and EfMaskedSubExecutor.

◆ _IsOutputInvalid()

virtual bool _IsOutputInvalid ( const VdfId  outputId,
const VdfMask invalidationMask 
) const
protectedpure virtual

◆ _PreProcessInvalidation()

virtual bool _PreProcessInvalidation ( const VdfMaskedOutputVector invalidationRequest,
VdfMaskedOutputVector processedRequest 
)
inlineprotectedvirtual

This method is called as a pre-processing step before an InvalidateValues() call.

The method will return true if processedRequest is to override the originally supplied invalidationRequest for executor invalidation.

Definition at line 364 of file executorInterface.h.

◆ _Run()

virtual void _Run ( const VdfSchedule schedule,
const VdfRequest &  computeRequest,
VdfExecutorErrorLogger errorLogger 
)
protectedpure virtual

Run this executor with the given schedule and request.

Implemented in VdfSimpleExecutor.

◆ _SetReferenceOutputValue()

virtual void _SetReferenceOutputValue ( const VdfOutput destOutput,
const VdfOutput sourceOutput,
const VdfMask sourceMask 
) const
protectedpure virtual

◆ _TouchOutput()

virtual void _TouchOutput ( const VdfOutput output) const
protectedpure virtual

Mark the output as having been visited.

This is only to be used by the speculation engine to tell its parent executor that an output has been visited and should be marked for invalidation.

Implemented in VdfDataManagerBasedExecutor< DataManagerType, VdfExecutorInterface >, VdfDataManagerBasedExecutor< DataManagerType, VdfSpeculationExecutorBase >, VdfDataManagerBasedExecutor< VdfParallelDataManagerVector, VdfExecutorInterface >, and VdfDatalessExecutor.

◆ _UpdateInvalidationTimestamp()

virtual void _UpdateInvalidationTimestamp ( )
protectedpure virtual

Called before invalidation begins to update the timestamp that will be written for every VdfOutput visited during invalidation.

This timestamp is later used to identify outputs for mung buffer locking.

Implemented in VdfDataManagerBasedExecutor< DataManagerType, VdfExecutorInterface >, VdfDataManagerBasedExecutor< DataManagerType, VdfSpeculationExecutorBase >, VdfDataManagerBasedExecutor< VdfParallelDataManagerVector, VdfExecutorInterface >, and VdfDatalessExecutor.

◆ ClearData()

VDF_API void ClearData ( )

Clears the executor buffers.

Note that derived classes may also clear other data, including topological state.

◆ ClearDataForOutput()

VDF_API void ClearDataForOutput ( const VdfId  outputId,
const VdfId  nodeId 
)

Clears the executor buffers for a specific output.

◆ DuplicateOutputData()

virtual void DuplicateOutputData ( const VdfOutput sourceOutput,
const VdfOutput destOutput 
)
pure virtual

◆ GetExecutionStats()

VdfExecutionStats* GetExecutionStats ( ) const
inline

Returns the Execution Stats object, if any.

Definition at line 299 of file executorInterface.h.

◆ GetExecutorInvalidationTimestamp()

VdfInvalidationTimestamp GetExecutorInvalidationTimestamp ( ) const
inline

Returns this executor's invalidation timestamp.

Definition at line 244 of file executorInterface.h.

◆ GetFactory()

virtual const VdfExecutorFactoryBase& GetFactory ( ) const
pure virtual

Returns a factory class facilitating the construction of new executors that share traits with this executor instance.

Implemented in EfPageCacheSubExecutor< EngineType, DataManagerType >, VdfExecutor< EngineType, DataManagerType >, EfMaskedSubExecutor, EfPageCacheExecutor< EngineType, DataManagerType >, and VdfSimpleExecutor.

◆ GetInterruptionFlag()

const std::atomic_bool* GetInterruptionFlag ( ) const
inline

Returns the interruption flag.

Definition at line 270 of file executorInterface.h.

◆ GetOutputValue()

const VdfVector* GetOutputValue ( const VdfOutput output,
const VdfMask mask 
) const
inline

Returns the cached value for a given output if it has a cache that contains all values specified by mask.

Otherwise, returns NULL.

Definition at line 141 of file executorInterface.h.

◆ GetParentExecutor()

const VdfExecutorInterface* GetParentExecutor ( ) const
inline

Returns the parent executor, if any.

Definition at line 162 of file executorInterface.h.

◆ HasBeenInterrupted()

bool HasBeenInterrupted ( ) const
inline

Returns whether or not the executor has been interrupted, if the executor supports interruption.

If interruption is not supported, i.e. no interruption flag has been set, this will always return false.

Definition at line 278 of file executorInterface.h.

◆ HasInvalidationTimestampMismatch()

virtual bool HasInvalidationTimestampMismatch ( const VdfOutput source,
const VdfOutput dest 
) const
pure virtual

Returns true, if the invalidation timestamps between the source and dest outputs do not match, i.e.

the source output should be mung buffer locked.

Implemented in EfMaskedSubExecutor, VdfDataManagerBasedExecutor< DataManagerType, VdfExecutorInterface >, VdfDataManagerBasedExecutor< DataManagerType, VdfSpeculationExecutorBase >, and VdfDataManagerBasedExecutor< VdfParallelDataManagerVector, VdfExecutorInterface >.

◆ IncrementExecutorInvalidationTimestamp()

void IncrementExecutorInvalidationTimestamp ( )
inline

Increment this executor's invalidation timestamp for mung buffer locking.

Definition at line 231 of file executorInterface.h.

◆ InheritExecutorInvalidationTimestamp()

void InheritExecutorInvalidationTimestamp ( const VdfExecutorInterface executor)
inline

Inherit the invalidation timestamp from another executor.

Definition at line 237 of file executorInterface.h.

◆ InvalidateTopologicalState()

VDF_API void InvalidateTopologicalState ( )

Invalidate all state depending on network topology.

This must be called after changes to the network have been made.

TODO: I believe that we should not have this kind of API exposed. Clients should not have to know about the internal state kept in the executors. This is very similiar to schedules and perhaps should be treated like schedules by being registered with the networks that they depend on. A generalized mechanism in VdfNetwork might be nice.

◆ InvalidateValues()

VDF_API void InvalidateValues ( const VdfMaskedOutputVector invalidationRequest)

Invalidates the network, starting from the masked outputs in request.

Performs an optimized vectorized traversal.

◆ IsEmpty()

◆ RegisterObserver()

VDF_API void RegisterObserver ( const VdfExecutorObserver observer) const

Can be called by clients to register a VdfExecutorObserver with this executor.

◆ Resize()

virtual void Resize ( const VdfNetwork network)
inlinevirtual

◆ Run() [1/2]

VDF_API void Run ( const VdfSchedule schedule,
VdfExecutorErrorLogger errorLogger = NULL 
)

Executes the schedule.

◆ Run() [2/2]

VDF_API void Run ( const VdfSchedule schedule,
const VdfRequest &  computeRequest,
VdfExecutorErrorLogger errorLogger = NULL 
)

Executes the schedule.

computeRequest must be a subset of the scheduled request. If the full, scheduled request should be computed, then computeRequest should be set to schedule.GetRequest().

◆ SetExecutionStats()

void SetExecutionStats ( VdfExecutionStats stats)
inline

Sets an execution stats object.

When stats is not NULL, then execution statistics will be gathered into the object. When NULL, execution statistics will not be gathered.

Definition at line 293 of file executorInterface.h.

◆ SetInterruptionFlag()

void SetInterruptionFlag ( const std::atomic_bool *  interruptionFlag)
inline

Set the interruption flag.

Definition at line 264 of file executorInterface.h.

◆ SetOutputValue()

◆ SetParentExecutor()

VDF_API void SetParentExecutor ( const VdfExecutorInterface parentExecutor)

Sets the parent executor.

This method also inherits the execution stats from the parent executor, unless the executor already has its execution stats set.

XXX: We need to get rid of this public API, since most executors do not support changing out the parent executor after construction.

◆ TakeOutputValue()

virtual bool TakeOutputValue ( const VdfOutput output,
VdfVector value,
const VdfMask mask 
)
pure virtual

Transfers ownership of the value to the given output.

Returns true if the transfer of ownership was successful. If the transfer of ownership was successful, the executor assumes responsibility for the lifetime of value. Otherwise, the call site maintains this responsibility.

Implemented in VdfDataManagerBasedExecutor< DataManagerType, VdfExecutorInterface >, VdfDataManagerBasedExecutor< DataManagerType, VdfSpeculationExecutorBase >, VdfDataManagerBasedExecutor< VdfParallelDataManagerVector, VdfExecutorInterface >, and VdfDatalessExecutor.

◆ UnregisterObserver()

VDF_API void UnregisterObserver ( const VdfExecutorObserver observer) const

Must be called by clients to unregister a VdfExecutorObserver, which has been previously registered with RegisterObserver().


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