From cc0f8437a5be207851edee6da6d75d999aba40b1 Mon Sep 17 00:00:00 2001 From: "petro.zarytskyi" Date: Mon, 25 Nov 2024 18:48:45 +0100 Subject: [PATCH] fix cuda --- lib/Differentiator/ReverseModeVisitor.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Differentiator/ReverseModeVisitor.cpp b/lib/Differentiator/ReverseModeVisitor.cpp index 07096ce7d..5c41fc4d7 100644 --- a/lib/Differentiator/ReverseModeVisitor.cpp +++ b/lib/Differentiator/ReverseModeVisitor.cpp @@ -1462,10 +1462,10 @@ Expr* getArraySizeExpr(const ArrayType* AT, ASTContext& context, return foundExpr; } // Not found, construct the adjoint and register it. - VarDecl* VDDiff = - BuildVarDecl(VD->getType(), CreateUniqueIdentifier(nameDiff_str), - m_DerivativeFnScope->getParent()->getParent(), DC, - getZeroInit(VD->getType())); + QualType TyDiff = getNonConstType(VD->getType()); + VarDecl* VDDiff = BuildVarDecl( + TyDiff, CreateUniqueIdentifier(nameDiff_str), + m_DerivativeFnScope->getParent()->getParent(), DC, getZeroInit(TyDiff)); DC->addDecl(VDDiff); DC->makeDeclVisibleInContext(VDDiff);