Conversation
Contributor
|
Your PR requires formatting changes to meet the project's style guidelines. Click here to view the suggested changes.diff --git a/src/errors.jl b/src/errors.jl
index 1e64c4b6..d5d9ad13 100644
--- a/src/errors.jl
+++ b/src/errors.jl
@@ -291,7 +291,7 @@ function InteractiveUtils.code_typed(ece::EnzymeRuntimeActivityError; interactiv
end
end
-struct EnzymeNoTypeError{MT,WT} <: EnzymeError
+struct EnzymeNoTypeError{MT, WT} <: EnzymeError
msg::Cstring
mi::MT
world::WT
@@ -305,7 +305,7 @@ function Base.showerror(io::IO, ece::EnzymeNoTypeError)
print(io, " Generally this shouldn't occur as Enzyme records type information from julia, but may be expected if you, for example copy untyped data.\n")
print(io, " or alternatively emit very large sized registers that exceed the maximum size of Enzyme's type analysis. If it seems reasonable to differentiate\n")
print(io, " this code, open an issue! If the cause of the error is too large of a register, you can request Enzyme increase the size (https://enzyme.mit.edu/julia/dev/api/#Enzyme.API.maxtypeoffset!-Tuple{Any})\n")
- print(io, " or depth (https://enzyme.mit.edu/julia/dev/api/#Enzyme.API.maxtypedepth!-Tuple{Any}) of its type analysis.\n");
+ print(io, " or depth (https://enzyme.mit.edu/julia/dev/api/#Enzyme.API.maxtypedepth!-Tuple{Any}) of its type analysis.\n")
print(io, " Alternatively, you can tell Enzyme to take its best guess from context with (https://enzyme.mit.edu/julia/dev/api/#Enzyme.API.looseTypeAnalysis!-Tuple{Any})\n")
print(io, " All of these settings are global configurations that need to be set immeidately after loading Enzyme, before any differentiation occurs\n")
print(io, " To toggle more information for debugging (needed for bug reports), set Enzyme.Compiler.VERBOSE_ERRORS[] = true (default false)\n")
@@ -313,7 +313,7 @@ function Base.showerror(io::IO, ece::EnzymeNoTypeError)
msg = Base.unsafe_string(ece.msg)
print(io, msg, '\n')
end
- if ece.mi !== nothing
+ return if ece.mi !== nothing
print(io, " Failure within method: ", ece.mi, "\n")
printstyled(io, "Hint"; bold = true, color = :cyan)
printstyled(
@@ -324,7 +324,7 @@ function Base.showerror(io::IO, ece::EnzymeNoTypeError)
end
end
-function InteractiveUtils.code_typed(ece::EnzymeNoTypeError; interactive::Bool=false, kwargs...)
+function InteractiveUtils.code_typed(ece::EnzymeNoTypeError; interactive::Bool = false, kwargs...)
mi = ece.mi
if mi === nothing
throw(AssertionError("code_typed(::EnzymeNoTypeError; interactive::Bool=false, kwargs...) not supported for error without mi"))
@@ -350,10 +350,10 @@ function InteractiveUtils.code_typed(ece::EnzymeNoTypeError; interactive::Bool=f
interp = Enzyme.Compiler.Interpreter.EnzymeInterpreter(CT, nothing, world, mode, true)
sig = mi.specTypes # XXX: can we just use the method instance?
- if interactive
+ return if interactive
# call Cthulhu without introducing a dependency on Cthulhu
mod = get(Base.loaded_modules, Cthulhu, nothing)
- mod===nothing && error("Interactive code reflection requires Cthulhu; please install and load this package first.")
+ mod === nothing && error("Interactive code reflection requires Cthulhu; please install and load this package first.")
descend_code_typed = getfield(mod, :descend_code_typed)
descend_code_typed(sig; interp, kwargs...)
else
@@ -562,7 +562,7 @@ function julia_error(
println(io, "within ", mi)
end
end
-
+
mi = nothing
world = nothing
@@ -1023,7 +1023,7 @@ end
end
end
- mi = nothing
+ mi = nothing
world = nothing
if isa(val, LLVM.Instruction) |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2719 +/- ##
==========================================
- Coverage 72.48% 72.32% -0.17%
==========================================
Files 58 58
Lines 18635 18679 +44
==========================================
+ Hits 13508 13510 +2
- Misses 5127 5169 +42 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Member
Author
|
Closes #2715 |
Contributor
Benchmark Results
Benchmark PlotsA plot of the benchmark results has been uploaded as an artifact at https://github.com/EnzymeAD/Enzyme.jl/actions/runs/18929686505/artifacts/4413592869. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.