Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxSagebaum committed Jul 9, 2024
2 parents e8d6d33 + 22507e9 commit ddd3391
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions include/codi/tapes/commonTapeImplementation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -535,9 +535,9 @@ namespace codi {
func.template call<callType>(&impl, dataView, std::forward<Args>(args)...);

codiAssert(endPos == dataView.getPosition());
} else if (LowLevelFunctionEntryCallKind::Delete == callType) CODI_Unlikely {
} else CODI_Unlikely if (LowLevelFunctionEntryCallKind::Delete == callType) {
// No delete registered. Data is skiped by the curLLFByteDataPos update.
} else CODI_Unlikely {
} else {
CODI_EXCEPTION("Requested call is not supported for low level function with token '%d'.", (int)id);
}

Expand Down
2 changes: 1 addition & 1 deletion include/codi/tapes/jacobianBaseTape.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,7 @@ namespace codi {

CODI_NO_INLINE void internalResizeAdjointsVector() {
// overallocate as next multiple of Config::ChunkSize
adjoints.resize(getNextMultiple((size_t)indexManager.get().getLargestCreatedIndex() + 1, Config::ChunkSize));
adjoints.resize(getNextMultiple(indexManager.get().getLargestCreatedIndex() + 1, (Identifier)Config::ChunkSize));
}
};
}
2 changes: 1 addition & 1 deletion include/codi/tapes/jacobianLinearTape.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ namespace codi {
// curAdjointPos at the end of the loop.

EventSystem<JacobianLinearTape>::notifyStatementEvaluateListeners(
tape, curAdjointPos, GradientTraits::dim<Adjoint>(), GradientTraits::toArray(lhsAdjoint).data());
tape, (Identifier)curAdjointPos, GradientTraits::dim<Adjoint>(), GradientTraits::toArray(lhsAdjoint).data());

if (Config::ReversalZeroesAdjoints) {
adjointVector[curAdjointPos] = Adjoint();
Expand Down
5 changes: 3 additions & 2 deletions include/codi/tapes/tagging/tagTapeBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ namespace codi {
/// Callback for a tag error.
using TagErrorCallback = void (*)(Tag const& correctTag, Tag const& wrongTag, void* userData);

static Tag constexpr PassiveTag = Tag(0); ///< Tag indicating an inactive value.
static Tag constexpr PassiveTag = Tag(0); ///< Tag indicating an inactive value.
static Tag constexpr InvalidTag = Tag(-1); ///< Tag indicating an invalid value.

protected:

Expand Down Expand Up @@ -223,7 +224,7 @@ namespace codi {

/// Checks if the tag is correct. Errors are set on the ValidationIndicator object.
CODI_INLINE void verifyTag(ValidationIndicator<Real, Tag>& vi, Tag const& tag) const {
if (PassiveTag != tag) {
if (PassiveTag != tag && InvalidTag != tag) {
vi.isActive = true;
if (tag != curTag) {
vi.hasError = true;
Expand Down
2 changes: 1 addition & 1 deletion include/codi/tapes/tagging/tagTapeReverse.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ namespace codi {

/// -1 tag.
Identifier getInvalidIndex() const {
return Identifier(-1);
return Identifier(Base::InvalidTag);
}

/// Verify tag.
Expand Down

0 comments on commit ddd3391

Please sign in to comment.