From a5a40bcc5f08125e552c7828092b4ca087aa056d Mon Sep 17 00:00:00 2001 From: "William S. Moses" Date: Sun, 14 Apr 2024 21:37:24 -0400 Subject: [PATCH] Fix caching for forwarderr --- enzyme/Enzyme/CallDerivatives.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/enzyme/Enzyme/CallDerivatives.cpp b/enzyme/Enzyme/CallDerivatives.cpp index 6280dc9f1b44..a805f9c9e46b 100644 --- a/enzyme/Enzyme/CallDerivatives.cpp +++ b/enzyme/Enzyme/CallDerivatives.cpp @@ -3195,7 +3195,8 @@ bool AdjointGenerator::handleKnownCallDerivatives( } // Cache and rematerialization irrelevant for forward mode. - if (Mode == DerivativeMode::ForwardMode) { + if (Mode == DerivativeMode::ForwardMode || + Mode == DerivativeMode::ForwardModeError) { eraseIfUnused(call); return true; }