CoDiPack  2.2.0
A Code Differentiation Package
SciComp TU Kaiserslautern
Loading...
Searching...
No Matches
codi::InternalStatementRecordingTapeInterface< T_Identifier > Struct Template Reference

Internal tape interface that is used by active types to trigger the storing of an expression. More...

#include <internalStatementRecordingTapeInterface.hpp>

Inheritance diagram for codi::InternalStatementRecordingTapeInterface< T_Identifier >:

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.
 

Detailed Description

template<typename T_Identifier>
struct codi::InternalStatementRecordingTapeInterface< T_Identifier >

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.

Template Parameters
T_IdentifierThe adjoint/tangent identification type of a tape, usually chosen as ActiveType::Identifier.

Member Function Documentation

◆ initIdentifier()

template<typename T_Identifier >
template<typename Real >
void codi::InternalStatementRecordingTapeInterface< T_Identifier >::initIdentifier ( Real & value,
Identifier & identifier )

Has to be called for each identifier, after it is allocated.

◆ store()

template<typename T_Identifier >
template<typename Lhs , typename Rhs >
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.

Template Parameters
LhsHas to implement LhsExpressionInterface.
RhsHas to implement ExpressionInterface.

Member Data Documentation

◆ AllowJacobianOptimization

template<typename T_Identifier >
bool constexpr codi::InternalStatementRecordingTapeInterface< T_Identifier >::AllowJacobianOptimization
staticconstexpr
Initial value:
=
false

If certain operations can be hidden from the tape.


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