The static methods for the AD tool interface. More...
#include <adToolInterface.h>
Public Types | |
typedef double | AdjointType |
The data type that is used for the adjoint variables. | |
typedef int | IndexType |
The data type from the AD tool for the identification of AD variables. | |
typedef double | ModifiedType |
The type that is send through the modified buffers. | |
typedef double | PrimalType |
The data type used for the floating point data. | |
typedef double | Type |
The actual type that the AD implementation uses. | |
Public Types inherited from medi::ADToolInterface | |
typedef void | AdjointType |
The data type that is used for the adjoint variables. | |
typedef void | IndexType |
The data type from the AD tool for the identification of AD variables. | |
typedef void | ModifiedType |
The type that is send through the modified buffers. | |
typedef void | PrimalType |
The data type used for the floating point data. | |
typedef void | Type |
The actual type that the AD implementation uses. | |
Static Public Member Functions | |
static void | clearIndex (Type &value) |
Delete the index in a buffer such that the buffer can be overwritten. | |
static void | createIndex (Type &value, IndexType &index) |
Create an index for the given item in the buffer. | |
static void | getFromModifyBuffer (const ModifiedType &modValue, Type &value) |
Copies the nescessary data from the received MeDiPack buffer into the user buffer. | |
static IndexType | getIndex (const Type &value) |
Get the AD identifier for this value. | |
static PrimalType | getValue (const Type &value) |
Get the primal floating point value of the AD value. | |
static void | registerValue (Type &value, PrimalType &oldPrimal, IndexType &index) |
Register an AD value on the receiving side of the communication. | |
static void | setIntoModifyBuffer (ModifiedType &modValue, const Type &value) |
Copies the nescessary data from the user buffer into the buffer crated by MeDiPack. | |
Additional Inherited Members | |
Public Member Functions inherited from medi::ADToolInterface | |
virtual void | addToolAction (HandleBase *h) const =0 |
Register the handle so that the AD tool can evaluate it in the reverse sweep. | |
ADToolInterface (MPI_Datatype primalMpiType, MPI_Datatype adjointMpiType) | |
Create an interface for the AD type. | |
virtual AMPI_Op | convertOperator (AMPI_Op op) const =0 |
Convert the mpi intrinsic operators like MPI_SUM to the specific one for the AD tool. | |
virtual void | createIndexTypeBuffer (void *&buf, size_t size) const =0 |
Create an array for the index variables. | |
virtual void | createPrimalTypeBuffer (void *&buf, size_t size) const =0 |
Create an array for the passive variables. | |
virtual void | deleteIndexTypeBuffer (void *&buf) const =0 |
Delete the array of the index variables. | |
virtual void | deletePrimalTypeBuffer (void *&buf) const =0 |
Delete the array of the passive variables. | |
MPI_Datatype | getAdjointMpiType () const |
The mpi data type for the adjoint type. | |
MPI_Datatype | getPrimalMpiType () const |
The mpi data type for the primal type. | |
virtual bool | isActiveType () const =0 |
If this AD interface represents an AD type. | |
virtual bool | isHandleRequired () const =0 |
The handle needs to be created if an adjoint action is required by the AD tool. | |
virtual bool | isModifiedBufferRequired () const =0 |
Indicates if the AD tool needs to modify the buffer in order to send the correct data. | |
virtual bool | isOldPrimalsRequired () const =0 |
Indicates if MeDiPack needs store the overwritten primal values for the AD tool. | |
virtual void | startAssembly (HandleBase *h) const =0 |
Indicates to the AD tool that an adjoint action is in the progress of beeing recorded. | |
virtual void | stopAssembly (HandleBase *h) const =0 |
Indicates to the AD tool that an adjoint action is beeing finished. | |
virtual | ~ADToolInterface () |
The static methods for the AD tool interface.
All these static methods need to be implemented by the AD tool
typedef double medi::StaticADToolInterface::AdjointType |
The data type that is used for the adjoint variables.
typedef int medi::StaticADToolInterface::IndexType |
The data type from the AD tool for the identification of AD variables.
typedef double medi::StaticADToolInterface::ModifiedType |
The type that is send through the modified buffers.
typedef double medi::StaticADToolInterface::PrimalType |
The data type used for the floating point data.
typedef double medi::StaticADToolInterface::Type |
The actual type that the AD implementation uses.
|
static |
Delete the index in a buffer such that the buffer can be overwritten.
[in,out] | value | The AD value in the buffer. |
Create an index for the given item in the buffer.
[in,out] | value | The AD value in the buffer. |
[out] | index | The index for the value. |
|
static |
Copies the nescessary data from the received MeDiPack buffer into the user buffer.
[in] | modValue | The value in the modified buffer |
[out] | value | The value in the user buffer. |
Get the AD identifier for this value.
[in] | value | The AD value. |
|
static |
Get the primal floating point value of the AD value.
[in] | value | The AD value. |
|
static |
Register an AD value on the receiving side of the communication.
[in,out] | value | The AD value in the user buffer on the receiving side. |
[out] | oldPrimal | The old primal value that was overwritten by this value. |
[in,out] | index | The identifier registered for the old value. This value may be set here or already be the value from createIndex. |
|
static |
Copies the nescessary data from the user buffer into the buffer crated by MeDiPack.
[out] | modValue | The value in the modified buffer |
[in] | value | The value in the user buffer. |