Internal tape interface that is used by active types to trigger the storing of an expression. More...
#include <internalStatementRecordingTapeInterface.hpp>
Public Types | |
using | Identifier = T_Identifier |
See InternalStatementRecordingTapeInterface. | |
Interface definition | |
static bool constexpr | AllowJacobianOptimization |
If certain operations can be hidden from the tape. | |
template<typename Real > | |
void | initIdentifier (Real &value, Identifier &identifier) |
template<typename Real > | |
void | destroyIdentifier (Real &value, Identifier &identifier) |
Has to be called for each identifier, before it is deallocated. | |
template<typename Lhs , typename Rhs > | |
void | store (Lhs &lhs, Rhs const &rhs) |
Has to be called by an AD variable every time it is assigned. | |
Internal tape interface that is used by active types to trigger the storing of an expression.
See Tape Interface Design for a general overview of the tape interface design in CoDiPack.
This interface contains callbacks used by AD variables to access the tape implementation. Each AD variable in the program allocates an identifier and this identifier has to be initialized with a call to initIdentifier(). When an AD variable in the program is destroyed, its identifier has to be freed by the tape by a call to destroyIdentifier() before it is deallocated.
The compile time switch AllowJacobianOptimization signals the AD variables that the underlying tape is a Jacobian tape, indicating that certain operations can be hidden from the tape recording process.
store() has to be called by the AD variable every time it is assigned. The left hand side value (lhs) has to implement LhsExpressionInterface, the right hand side value (rhs) has to implement ExpressionInterface.
ActiveType is the default implementation in CoDiPack which uses this interface and implements the behavior described above.
T_Identifier | The adjoint/tangent identification type of a tape, usually chosen as ActiveType::Identifier. |
void codi::InternalStatementRecordingTapeInterface< T_Identifier >::initIdentifier | ( | Real & | value, |
Identifier & | identifier ) |
Has to be called for each identifier, after it is allocated.
void codi::InternalStatementRecordingTapeInterface< T_Identifier >::store | ( | Lhs & | lhs, |
Rhs const & | rhs ) |
Has to be called by an AD variable every time it is assigned.
Update of the value is performed by the tape. The tape will additionally store information, e.g., for the reversal of the statement.
Lhs | Has to implement LhsExpressionInterface. |
Rhs | Has to implement ExpressionInterface. |
|
staticconstexpr |
If certain operations can be hidden from the tape.