Skip to content

Commit

Permalink
Applied suggested change from Johannes.
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxSagebaum committed Sep 10, 2024
1 parent a079c63 commit 01c1ba5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions include/codi/tapes/misc/internalAdjointsInterface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ namespace codi {
/// Ensure that identifiers up to newSize can be passed to operator[] without error.
CODI_NO_INLINE void resize(Identifier const& newSize);

/// Set all adjoint variables up to and including maxIndex to Gradient().
CODI_INLINE void zeroAll(Identifier const& maxIndex);
/// Set all adjoint variables up to and including maxIdentifier to Gradient().
CODI_INLINE void zeroAll(Identifier const& maxIdentifier);

/// Swap two sets of adjoint variables. Internally, declares usage of the adjoints.
template<typename Impl>
Expand Down
4 changes: 2 additions & 2 deletions include/codi/tapes/misc/localAdjoints.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ namespace codi {
}

/// \copydoc InternalAdjointsInterface::zeroAll
CODI_INLINE void zeroAll(Identifier const& maxIndex) {
Identifier maxSize = std::min(maxIndex + 1, (Identifier)adjoints.size());
CODI_INLINE void zeroAll(Identifier const& maxIdentifier) {
Identifier maxSize = std::min(maxIdentifier + 1, (Identifier)adjoints.size());
for (Identifier i = 0; i < maxSize; i += 1) {
adjoints[i] = Gradient();
}
Expand Down
4 changes: 2 additions & 2 deletions include/codi/tapes/misc/threadSafeGlobalAdjoints.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ namespace codi {
}

/// \copydoc InternalAdjointsInterface::zeroAll
CODI_INLINE void zeroAll(Identifier const& maxIndex) {
Identifier maxSize = std::min(maxIndex + 1, (Identifier)adjoints.size());
CODI_INLINE void zeroAll(Identifier const& maxIdentifier) {
Identifier maxSize = std::min(maxIdentifier + 1, (Identifier)adjoints.size());
for (Identifier i = 0; i < maxSize; i += 1) {
adjoints[i] = Gradient();
}
Expand Down

0 comments on commit 01c1ba5

Please sign in to comment.