Skip to content

Commit ec75831

Browse files
ludgerpaehlerwsmoses
authored andcommitted
Handle nvvm sqrt
1 parent b1009c5 commit ec75831

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

enzyme/Enzyme/AdjointGenerator.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2079,7 +2079,12 @@ class AdjointGenerator
20792079
SmallVector<Value *, 2> args = {
20802080
lookup(gutils->getNewFromOriginal(orig_ops[0]), Builder2)};
20812081
Type *tys[] = {orig_ops[0]->getType()};
2082-
auto SqrtF = Intrinsic::getDeclaration(M, ID, tys);
2082+
Function *SqrtF;
2083+
if (ID == Intrinsic::sqrt)
2084+
SqrtF = Intrinsic::getDeclaration(M, ID, tys);
2085+
else
2086+
SqrtF = Intrinsic::getDeclaration(M, ID);
2087+
20832088
auto cal = cast<CallInst>(Builder2.CreateCall(SqrtF, args));
20842089
cal->setCallingConv(SqrtF->getCallingConv());
20852090
cal->setDebugLoc(gutils->getNewFromOriginal(I.getDebugLoc()));

0 commit comments

Comments
 (0)