Provides global adjoint variables owned by a tape type. Thread-safe for use in parallel taping.
More...
|
void | beginUse () |
| Declare that the adjoints are in use, e.g., during a tape evaluation, and cannot be resized right now.
|
|
Gradient * | data () |
| Pointer to an underlying array implementation.
|
|
void | endUse () |
| Declare that the adjoints are no longer occupied.
|
|
Gradient & | operator[] (Identifier const &identifier) |
| Reference access to the adjoint variable identified by identifier.
|
|
Gradient const & | operator[] (Identifier const &identifier) const |
| Constant reference access to the adjoint variable identified by identifier.
|
|
void | resize (Identifier const &newSize) |
| Ensure that identifiers up to newSize can be passed to operator[] without error.
|
|
size_t | size () const |
| Returns the number of adjoint variables. Internally, declares usage of the adjoints.
|
|
void | swap (ThreadSafeGlobalAdjoints &) |
| Swap two sets of adjoint variables. Internally, declares usage of the adjoints.
|
|
| ThreadSafeGlobalAdjoints (size_t initialSize) |
| Constructor.
|
|
void | zeroAll () |
| Set all adjoint variables to Gradient().
|
|
void | beginUse () |
| Declare that the adjoints are in use, e.g., during a tape evaluation, and cannot be resized right now.
|
|
Gradient * | data () |
| Pointer to an underlying array implementation.
|
|
void | endUse () |
| Declare that the adjoints are no longer occupied.
|
|
| InternalAdjointsInterface (size_t initialSize) |
|
Gradient & | operator[] (Identifier const &identifier) |
| Reference access to the adjoint variable identified by identifier.
|
|
Gradient const & | operator[] (Identifier const &identifier) const |
| Constant reference access to the adjoint variable identified by identifier.
|
|
void | resize (Identifier const &newSize) |
| Ensure that identifiers up to newSize can be passed to operator[] without error.
|
|
size_t | size () const |
| Returns the number of adjoint variables. Internally, declares usage of the adjoints.
|
|
template<typename Impl > |
void | swap (Impl &other) |
| Swap two sets of adjoint variables. Internally, declares usage of the adjoints.
|
|
void | zeroAll () |
| Set all adjoint variables to Gradient().
|
|
template<typename T_Gradient, typename T_Identifier, typename T_Tape, typename T_ParallelToolbox>
struct codi::ThreadSafeGlobalAdjoints< T_Gradient, T_Identifier, T_Tape, T_ParallelToolbox >
Provides global adjoint variables owned by a tape type. Thread-safe for use in parallel taping.
- Template Parameters
-
template<typename T_Gradient , typename T_Identifier , typename T_Tape , typename T_ParallelToolbox >
Declare that the adjoints are in use, e.g., during a tape evaluation, and cannot be resized right now.
Implementation: Sets an internal lock.
template<typename T_Gradient , typename T_Identifier , typename T_Tape , typename T_ParallelToolbox >
Constant reference access to the adjoint variable identified by identifier.
Implementation: No locking is performed, beginUse and endUse have to be used accordingly.