Provides global adjoint variables owned by a tape type. Thread-safe for use in parallel taping.
More...
|
| inlinevoid | beginUse () |
| | Declare that the adjoints are in use, e.g., during a tape evaluation, and cannot be resized right now.
|
| |
| inlineGradient * | data () |
| | Return an array-like object for data access, for example a pointer to an underlying array or a reference to something with overloaded operator[].
|
| |
| inlinevoid | endUse () |
| | Declare that the adjoints are no longer occupied.
|
| |
| inlineGradient & | operator[] (Identifier const &identifier) |
| | Reference access to the adjoint variable identified by identifier.
|
| |
| inlineGradient 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.
|
| |
| inlinesize_t | size () const |
| | Returns the number of adjoint variables. Internally, declares usage of the adjoints.
|
| |
| inlinevoid | swap (ThreadSafeGlobalAdjoints &) |
| | Swap two sets of adjoint variables. Internally, declares usage of the adjoints.
|
| |
|
| ThreadSafeGlobalAdjoints (size_t initialSize) |
| | Constructor.
|
| |
| inlinevoid | zeroAll (Identifier const &maxIdentifier) |
| | Set all adjoint variables up to and including maxIdentifier to Gradient().
|
| |
|
inlinevoid | beginUse () |
| | Declare that the adjoints are in use, e.g., during a tape evaluation, and cannot be resized right now.
|
| |
|
template<typename ArrayAccess> |
| ArrayAccess | data () |
| | Return an array-like object for data access, for example a pointer to an underlying array or a reference to something with overloaded operator[].
|
| |
|
inlinevoid | endUse () |
| | Declare that the adjoints are no longer occupied.
|
| |
| | InternalAdjointsInterface (size_t initialSize) |
| |
|
inlineGradient & | operator[] (Identifier const &identifier) |
| | Reference access to the adjoint variable identified by identifier.
|
| |
|
inlineGradient 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.
|
| |
|
inlinesize_t | size () const |
| | Returns the number of adjoint variables. Internally, declares usage of the adjoints.
|
| |
|
template<typename Impl> |
| inlinevoid | swap (Impl &other) |
| | Swap two sets of adjoint variables. Internally, declares usage of the adjoints.
|
| |
|
inlinevoid | zeroAll (Identifier const &maxIdentifier) |
| | Set all adjoint variables up to and including maxIdentifier 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>
Reference access to the adjoint variable identified by identifier.
Implementation: No locking is performed, beginUse and endUse have to be used accordingly.
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.