From b85113984e4abebeda4cbb0d972523444daf3b15 Mon Sep 17 00:00:00 2001 From: kchristin Date: Sat, 9 Nov 2024 15:20:46 +0200 Subject: [PATCH] Clone kernel call instead of recreating it --- lib/Differentiator/ReverseModeVisitor.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/Differentiator/ReverseModeVisitor.cpp b/lib/Differentiator/ReverseModeVisitor.cpp index 6c279ff45..7d465853c 100644 --- a/lib/Differentiator/ReverseModeVisitor.cpp +++ b/lib/Differentiator/ReverseModeVisitor.cpp @@ -2303,6 +2303,9 @@ Expr* getArraySizeExpr(const ArrayType* AT, ASTContext& context, m_ExternalSource->ActBeforeFinalizingVisitCallExpr( CE, OverloadedDerivedFn, DerivedCallArgs, CallArgDx, asGrad); + if (isa(CE)) + return StmtDiff(Clone(CE)); + Expr* call = nullptr; QualType returnType = FD->getReturnType();