![]() |
|
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. | |
| VdfExecutorInterface & | operator= (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 VdfVector * | GetOutputValue (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 VdfExecutorInterface * | GetParentExecutor () 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. | |
| VdfExecutionStats * | GetExecutionStats () 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 |
Abstract base class for classes that execute a VdfNetwork to compute a requested set of values.
Definition at line 44 of file executorInterface.h.
|
delete |
Noncopyable.
|
virtual |
Destructor.
|
protected |
Protected default constructor.
|
explicitprotected |
Construct with a parent executor.
|
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.
|
protectedvirtual |
Virtual implementation of the ClearDataForOutput call.
This may be overridden by classes, which derive from VdfExecutorInterface.
Reimplemented in VdfDatalessExecutor, VdfDataManagerBasedExecutor< DataManagerType, VdfExecutorInterface >, VdfDataManagerBasedExecutor< VdfParallelDataManagerVector, VdfExecutorInterface >, and VdfDataManagerBasedExecutor< DataManagerType, VdfSpeculationExecutorBase >.
|
protectedpure virtual |
Returns a value for the cache that flows across connection.
Implemented in EfPageCacheBasedExecutor< EngineType, DataManagerType >, VdfDatalessExecutor, VdfDataManagerBasedExecutor< DataManagerType, VdfExecutorInterface >, VdfDataManagerBasedExecutor< VdfParallelDataManagerVector, VdfExecutorInterface >, and VdfDataManagerBasedExecutor< DataManagerType, VdfSpeculationExecutorBase >.
|
protectedpure virtual |
Returns an output value for reading.
Implemented in EfPageCacheBasedExecutor< EngineType, DataManagerType >, VdfDatalessExecutor, VdfDataManagerBasedExecutor< DataManagerType, VdfExecutorInterface >, VdfDataManagerBasedExecutor< VdfParallelDataManagerVector, VdfExecutorInterface >, and VdfDataManagerBasedExecutor< DataManagerType, VdfSpeculationExecutorBase >.
|
protectedpure virtual |
Returns an output value for writing.
Implemented in VdfDatalessExecutor, VdfDataManagerBasedExecutor< DataManagerType, VdfExecutorInterface >, VdfDataManagerBasedExecutor< VdfParallelDataManagerVector, VdfExecutorInterface >, and VdfDataManagerBasedExecutor< DataManagerType, VdfSpeculationExecutorBase >.
|
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 >.
|
protectedpure virtual |
Returns true if the output is already invalid for the given invalidationMask.
Implemented in VdfDataManagerBasedExecutor< DataManagerType, VdfExecutorInterface >, VdfDataManagerBasedExecutor< VdfParallelDataManagerVector, VdfExecutorInterface >, and VdfDataManagerBasedExecutor< DataManagerType, VdfSpeculationExecutorBase >.
|
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.
|
protectedpure virtual |
Run this executor with the given schedule and request.
Implemented in VdfSimpleExecutor.
|
protectedpure virtual |
Called to set destOutput's buffer output to be a reference to the buffer output of sourceOutput.
Implemented in VdfDatalessExecutor, VdfDataManagerBasedExecutor< DataManagerType, VdfExecutorInterface >, VdfDataManagerBasedExecutor< VdfParallelDataManagerVector, VdfExecutorInterface >, and VdfDataManagerBasedExecutor< DataManagerType, VdfSpeculationExecutorBase >.
|
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 >.
|
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 >.
| VDF_API void ClearData | ( | ) |
Clears the executors buffers.
Clears the executor buffers for a specific output.
|
pure virtual |
Duplicates the output data associated with sourceOutput and copies it to destOutput.
Implemented in EfMaskedSubExecutor, VdfDataManagerBasedExecutor< DataManagerType, VdfExecutorInterface >, VdfDataManagerBasedExecutor< VdfParallelDataManagerVector, VdfExecutorInterface >, and VdfDataManagerBasedExecutor< DataManagerType, VdfSpeculationExecutorBase >.
|
inline |
Returns the Execution Stats object, if any.
Definition at line 296 of file executorInterface.h.
|
inline |
Returns this executor's invalidation timestamp.
Definition at line 241 of file executorInterface.h.
|
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.
|
inline |
Returns the interruption flag.
Definition at line 267 of file executorInterface.h.
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.
|
inline |
Returns the parent executor, if any.
Definition at line 162 of file executorInterface.h.
|
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.
|
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 >.
|
inline |
Increment this executor's invalidation timestamp for mung buffer locking.
Definition at line 228 of file executorInterface.h.
|
inline |
Inherit the invalidation timestamp from another executor.
Definition at line 234 of file executorInterface.h.
| 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.
| VDF_API void InvalidateValues | ( | const VdfMaskedOutputVector & | invalidationRequest | ) |
Invalidates the network, starting from the masked outputs in request.
Performs an optimized vectorized traversal.
|
pure virtual |
Returns true if the executor buffers are empty.
Implemented in EfMaskedSubExecutor, VdfDatalessExecutor, VdfDataManagerBasedExecutor< DataManagerType, VdfExecutorInterface >, VdfDataManagerBasedExecutor< VdfParallelDataManagerVector, VdfExecutorInterface >, and VdfDataManagerBasedExecutor< DataManagerType, VdfSpeculationExecutorBase >.
| VDF_API void RegisterObserver | ( | const VdfExecutorObserver * | observer | ) | const |
Can be called by clients to register a VdfExecutorObserver with this executor.
|
inlinevirtual |
Resize the executor to accomodate data for the given network.
Reimplemented in VdfDataManagerBasedExecutor< DataManagerType, VdfExecutorInterface >, VdfDataManagerBasedExecutor< VdfParallelDataManagerVector, VdfExecutorInterface >, and VdfDataManagerBasedExecutor< DataManagerType, VdfSpeculationExecutorBase >.
Definition at line 117 of file executorInterface.h.
| 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().
| VDF_API void Run | ( | const VdfSchedule & | schedule, |
| VdfExecutorErrorLogger * | errorLogger = NULL |
||
| ) |
Executes the schedule.
|
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.
|
inline |
Set the interruption flag.
Definition at line 261 of file executorInterface.h.
|
pure virtual |
Sets the cached value for a given output.
Implemented in EfPageCacheBasedExecutor< EngineType, DataManagerType >, VdfDatalessExecutor, VdfDataManagerBasedExecutor< DataManagerType, VdfExecutorInterface >, VdfDataManagerBasedExecutor< VdfParallelDataManagerVector, VdfExecutorInterface >, and VdfDataManagerBasedExecutor< DataManagerType, VdfSpeculationExecutorBase >.
| 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.
|
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 >.
| VDF_API void UnregisterObserver | ( | const VdfExecutorObserver * | observer | ) | const |
Must be called by clients to unregister a VdfExecutorObserver, which has been previously registered with RegisterObserver().
|
friend |
Definition at line 403 of file executorInterface.h.
|
friend |
Definition at line 420 of file executorInterface.h.
|
friend |
Definition at line 407 of file executorInterface.h.
|
friend |
Definition at line 417 of file executorInterface.h.
|
friend |
Definition at line 416 of file executorInterface.h.
|
friend |
Definition at line 414 of file executorInterface.h.
|
friend |
Definition at line 415 of file executorInterface.h.
|
friend |
Definition at line 410 of file executorInterface.h.