Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ function HINT_START(option)
end

function __init__()
if !isdefined(Base.Experimental, :register_error_hint)
return nothing
end
# robust against internal changes
condition = (
isdefined(Enzyme, :Compiler) &&
Expand All @@ -28,16 +31,8 @@ function __init__()
bold=true,
)
printstyled(io, HINT_END; italic=true)
elseif occursin("EnzymeRuntimeActivityError", string(nameof(T)))
printstyled(io, HINT_START("mode"); bold=true)
printstyled(
io,
"\n\n\tAutoEnzyme(; mode=Enzyme.set_runtime_activity(Enzyme.Forward))\n\tAutoEnzyme(; mode=Enzyme.set_runtime_activity(Enzyme.Reverse))";
color=:cyan,
bold=true,
)
printstyled(io, HINT_END; italic=true)
end
# EnzymeRuntimeActivityError is no longer a concrete type since https://github.com/EnzymeAD/Enzyme.jl/pull/2555 (now a UnionAll) so we cannot define a hint
end
end
end
Expand Down
8 changes: 2 additions & 6 deletions DifferentiationInterface/test/Back/Enzyme/test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ end
@test occursin("AutoEnzyme", msg)
@test occursin("function_annotation", msg)
@test occursin("ADTypes", msg)
@test occursin("DifferentiationInterface", msg)
end

@testset "RuntimeActivityError" begin
Expand Down Expand Up @@ -181,11 +180,8 @@ end
catch e
end
msg = sprint(showerror, e)
@test occursin("AutoEnzyme", msg)
@test occursin("mode", msg)
@test occursin("set_runtime_activity", msg)
@test occursin("ADTypes", msg)
@test occursin("DifferentiationInterface", msg)
@test_broken occursin("AutoEnzyme", msg)
@test_broken occursin("ADTypes", msg)
end
end

Expand Down
Loading