From 07ca8815957fff88b510dca9d50437a2bc80f8b4 Mon Sep 17 00:00:00 2001 From: William Moses Date: Fri, 7 Jul 2023 18:31:43 -0400 Subject: [PATCH] Wrap gradient utils in julia_error (#938) --- src/compiler.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler.jl b/src/compiler.jl index bcafe304cf..122126ba1a 100644 --- a/src/compiler.jl +++ b/src/compiler.jl @@ -5647,7 +5647,7 @@ function julia_error(cstr::Cstring, val::LLVM.API.LLVMValueRef, errtype::API.Err if errtype == API.ET_NoDerivative exc = NoDerivativeException(msg, ir, bt) if data != C_NULL - gutils = API.EnzymeGradientUtilsRef(data) + gutils = GradientUtils(API.EnzymeGradientUtilsRef(data)) newb = new_from_original(gutils, val) while isa(newb, LLVM.PHIInst) newb = LLVM.Instruction(LLVM.API.LLVMGetNextInstruction(newb)) @@ -5663,7 +5663,7 @@ function julia_error(cstr::Cstring, val::LLVM.API.LLVMValueRef, errtype::API.Err end throw(exc) elseif errtype == API.ET_NoShadow - data = API.EnzymeGradientUtilsRef(data) + data = GradientUtils(API.EnzymeGradientUtilsRef(data)) ip = API.EnzymeGradientUtilsInvertedPointersToString(data) sval = Base.unsafe_string(ip) API.EnzymeStringFree(ip)