Loading...
Searching...
No Matches
VdfExecutorInterface Class Referenceabstract

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

#include <executorInterface.h>

+ Inheritance diagram for VdfExecutorInterface:

Public Member Functions

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

Protected Member Functions

VDF_API VdfExecutorInterface ()
 Protected default constructor.
 
VDF_API VdfExecutorInterface (const VdfExecutorInterface *parentExecutor)
 Construct with a parent executor.
 
virtual void _Run (const VdfSchedule &schedule, const VdfRequest &computeRequest, VdfExecutorErrorLogger *errorLogger)=0
 Run this executor with the given schedule and request.
 
virtual const VdfVector_GetInputValue (const VdfConnection &connection, const VdfMask &mask) const =0
 Returns a value for the cache that flows across connection.
 
virtual const VdfVector_GetOutputValueForReading (const VdfOutput &output, const VdfMask &mask) const =0
 Returns an output value for reading.
 
virtual VdfVector_GetOutputValueForWriting (const VdfOutput &output) const =0
 Returns an output value for writing.
 
virtual bool _IsOutputInvalid (const VdfId outputId, const VdfMask &invalidationMask) const =0
 Returns true if the output is already invalid for the given invalidationMask.
 
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.
 
virtual bool _PreProcessInvalidation (const VdfMaskedOutputVector &invalidationRequest, VdfMaskedOutputVector *processedRequest)
 This method is called as a pre-processing step before an InvalidateValues() call.
 
virtual void _UpdateInvalidationTimestamp ()=0
 Called before invalidation begins to update the timestamp that will be written for every VdfOutput visited during invalidation.
 
virtual VDF_API void _ClearData ()
 Virtual implementation of the ClearData call.
 
virtual VDF_API void _ClearDataForOutput (const VdfId outputId, const VdfId nodeId)
 Virtual implementation of the ClearDataForOutput call.
 
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.
 
virtual void _TouchOutput (const VdfOutput &output) const =0
 Mark the output as having been visited.
 

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 the ClearData call.

This may be overridden by classes, which derive from VdfExecutorInterface.

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

◆ _ClearDataForOutput()

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

◆ _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 EfMaskedSubExecutor, VdfDataManagerBasedExecutor< DataManagerType, VdfExecutorInterface >, VdfDataManagerBasedExecutor< VdfParallelDataManagerVector, VdfExecutorInterface >, and VdfDataManagerBasedExecutor< DataManagerType, VdfSpeculationExecutorBase >.

◆ _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 361 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 VdfDatalessExecutor, VdfDataManagerBasedExecutor< DataManagerType, VdfExecutorInterface >, VdfDataManagerBasedExecutor< VdfParallelDataManagerVector, VdfExecutorInterface >, and VdfDataManagerBasedExecutor< DataManagerType, VdfSpeculationExecutorBase >.

◆ _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 VdfDatalessExecutor, VdfDataManagerBasedExecutor< DataManagerType, VdfExecutorInterface >, VdfDataManagerBasedExecutor< VdfParallelDataManagerVector, VdfExecutorInterface >, and VdfDataManagerBasedExecutor< DataManagerType, VdfSpeculationExecutorBase >.

◆ ClearData()

VDF_API void ClearData ( )

Clears the executors buffers.

◆ 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 296 of file executorInterface.h.

◆ GetExecutorInvalidationTimestamp()

VdfInvalidationTimestamp GetExecutorInvalidationTimestamp ( ) const
inline

Returns this executor's invalidation timestamp.

Definition at line 241 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 EfMaskedSubExecutor, EfExecutor< EngineType, DataManagerType >, EfPageCacheExecutor< EngineType, DataManagerType >, EfPageCacheSubExecutor< EngineType, DataManagerType >, and VdfSimpleExecutor.

◆ GetInterruptionFlag()

const std::atomic_bool * GetInterruptionFlag ( ) const
inline

Returns the interruption flag.

Definition at line 267 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 275 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< VdfParallelDataManagerVector, VdfExecutorInterface >, and VdfDataManagerBasedExecutor< DataManagerType, VdfSpeculationExecutorBase >.

◆ IncrementExecutorInvalidationTimestamp()

void IncrementExecutorInvalidationTimestamp ( )
inline

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

Definition at line 228 of file executorInterface.h.

◆ InheritExecutorInvalidationTimestamp()

void InheritExecutorInvalidationTimestamp ( const VdfExecutorInterface executor)
inline

Inherit the invalidation timestamp from another executor.

Definition at line 234 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.

XXX:exec 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,
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().

◆ Run() [2/2]

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

Executes the schedule.

◆ 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 290 of file executorInterface.h.

◆ SetInterruptionFlag()

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

Set the interruption flag.

Definition at line 261 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 VdfDatalessExecutor, VdfDataManagerBasedExecutor< DataManagerType, VdfExecutorInterface >, VdfDataManagerBasedExecutor< VdfParallelDataManagerVector, VdfExecutorInterface >, and VdfDataManagerBasedExecutor< DataManagerType, VdfSpeculationExecutorBase >.

◆ 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().

Friends And Related Function Documentation

◆ VdfContext

friend class VdfContext
friend

Definition at line 403 of file executorInterface.h.

◆ VdfExecutorInvalidator

friend class VdfExecutorInvalidator
friend

Definition at line 420 of file executorInterface.h.

◆ VdfIterator

friend class VdfIterator
friend

Definition at line 407 of file executorInterface.h.

◆ VdfParallelSpeculationExecutorEngine

Definition at line 417 of file executorInterface.h.

◆ VdfPullBasedExecutorEngine

friend class VdfPullBasedExecutorEngine
friend

Definition at line 416 of file executorInterface.h.

◆ VdfSpeculationExecutor

friend class VdfSpeculationExecutor
friend

Definition at line 414 of file executorInterface.h.

◆ VdfSpeculationExecutorEngine

friend class VdfSpeculationExecutorEngine
friend

Definition at line 415 of file executorInterface.h.

◆ VdfSpeculationNode

friend class VdfSpeculationNode
friend

Definition at line 410 of file executorInterface.h.


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