Skip to content

Commit

Permalink
Simplify no derivative message (EnzymeAD#1632)
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmoses authored Jul 12, 2024
1 parent ff9d320 commit 3eed408
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/compiler.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1825,7 +1825,7 @@ end

function Base.showerror(io::IO, ece::NoDerivativeException)
print(io, "Enzyme compilation failed.\n")
if ece.ir !== nothing && !occursin("No create nofree of empty function", ece.msg)
if ece.ir !== nothing
print(io, "Current scope: \n")
print(io, ece.ir)
end
Expand Down Expand Up @@ -1996,6 +1996,9 @@ function julia_error(cstr::Cstring, val::LLVM.API.LLVMValueRef, errtype::API.Err
end

if errtype == API.ET_NoDerivative
if occursin("No create nofree of empty function", msg) || occursin("No forward mode derivative found for", msg) || occursin("No augmented forward mode derivative found for", msg) || occursin("No reverse pass found", msg)
ir = nothing
end
exc = NoDerivativeException(msg, ir, bt)
if B != C_NULL
B = IRBuilder(B)
Expand Down

0 comments on commit 3eed408

Please sign in to comment.