Skip to content

Commit

Permalink
Fix unused errors
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmoses committed Mar 8, 2024
1 parent 651b42f commit 783e604
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion enzyme/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ add_definitions(-DENZYME_VERSION_PATCH=${ENZYME_PATCH_VERSION})

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
SET(CMAKE_CXX_FLAGS "-Wall -fno-rtti ${CMAKE_CXX_FLAGS} -Werror=unused-variable -Werror=dangling-else -Werror=unused-but-set-variable -Werror=return-type -Werror=nonnull")
SET(CMAKE_CXX_FLAGS "-Wall -fno-rtti ${CMAKE_CXX_FLAGS} -Werror=unused-variable -Werror=dangling-else -Werror=unused-but-set-variable -Werror=return-type -Werror=nonnull -Werror=unused-result -Werror=reorder")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -ggdb")
SET(CMAKE_CXX_FLAGS_RELEASE "-O2")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,11 @@ struct GenericOpInterfaceReverse
return std::make_pair(pushCache, popCache);
};

gutils->Logic.differentiate(gutils, *linalgOp.getBlock()->getParent(),
adjoint.getRegion(), buildFuncReturnOp, hook);
auto sub = gutils->Logic.differentiate(
gutils, *linalgOp.getBlock()->getParent(), adjoint.getRegion(),
buildFuncReturnOp, hook);
if (!sub.succeeded())
return sub;

auto newOpYield = cast<linalg::YieldOp>(
cast<linalg::GenericOp>(newOp).getBodyRegion().front().getTerminator());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,9 @@ struct ForOpInterfaceReverse
gutils->mapReverseModeBlocks.map(&oBB, &revBB);
}
for (auto &&[oBB, revBB] : llvm::zip(oldReg, newReg)) {
gutils->Logic.visitChildren(&oBB, &revBB, gutils);
auto sub = gutils->Logic.visitChildren(&oBB, &revBB, gutils);
if (!sub.succeeded())
return sub;
Block *newBB = gutils->getNewFromOriginal(&oBB);
gutils->Logic.handlePredecessors(&oBB, newBB, &revBB, gutils,
buildFuncReturnOp);
Expand Down
2 changes: 1 addition & 1 deletion enzyme/Enzyme/MLIR/Interfaces/GradientUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ class MGradientUtils {
bool omp;

unsigned width;
SmallVector<DIFFE_TYPE, 1> RetDiffeTypes;
ArrayRef<DIFFE_TYPE> ArgDiffeTypes;
SmallVector<DIFFE_TYPE, 1> RetDiffeTypes;

mlir::Value getNewFromOriginal(const mlir::Value originst) const;
mlir::Block *getNewFromOriginal(mlir::Block *originst) const;
Expand Down

0 comments on commit 783e604

Please sign in to comment.