Skip to content

Commit

Permalink
more tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmoses committed Dec 15, 2024
1 parent 501b9e8 commit 1dc2182
Showing 1 changed file with 9 additions and 16 deletions.
25 changes: 9 additions & 16 deletions src/compiler.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3573,16 +3573,15 @@ function GPUCompiler.codegen(

specTypes = Interpreter.simplify_kw(mi.specTypes)

caller = mi
if mode == API.DEM_ForwardMode
has_custom_rule =
EnzymeRules.has_frule_from_sig(specTypes; world, method_table) #, caller)
EnzymeRules.has_frule_from_sig(specTypes; world, method_table)
if has_custom_rule
@safe_debug "Found frule for" mi.specTypes
end
else
has_custom_rule =
EnzymeRules.has_rrule_from_sig(specTypes; world, method_table) # , caller)
EnzymeRules.has_rrule_from_sig(specTypes; world, method_table)
if has_custom_rule
@safe_debug "Found rrule for" mi.specTypes
end
Expand All @@ -3597,7 +3596,8 @@ function GPUCompiler.codegen(
actualRetType = k.ci.rettype
end

if EnzymeRules.noalias_from_sig(mi.specTypes; world, method_table) #, caller)
if EnzymeRules.noalias_from_sig(mi.specTypes; world, method_table)
push!(edges, mi)
push!(return_attributes(llvmfn), EnumAttribute("noalias"))
for u in LLVM.uses(llvmfn)
c = LLVM.user(u)
Expand Down Expand Up @@ -3821,12 +3821,8 @@ end
end
continue
end
if EnzymeRules.is_inactive_from_sig(specTypes; world, method_table) && #, caller) &&
Enzyme.has_method(
Tuple{typeof(EnzymeRules.inactive),specTypes.parameters...},
world,
method_table,
)
if EnzymeRules.is_inactive_from_sig(specTypes; world, method_table)
push!(edges, mi)
handleCustom(
llvmfn,
"enz_noop",
Expand All @@ -3839,12 +3835,8 @@ end
)
continue
end
if EnzymeRules.is_inactive_noinl_from_sig(specTypes; world, method_table) # , caller) &&
has_method(
Tuple{typeof(EnzymeRules.inactive_noinl),specTypes.parameters...},
world,
method_table,
)
if EnzymeRules.is_inactive_noinl_from_sig(specTypes; world, method_table)
push!(edges, mi)
handleCustom(
llvmfn,
"enz_noop",
Expand Down Expand Up @@ -5557,6 +5549,7 @@ end
ABI,
ErrIfFuncWritten,
RuntimeActivity,
nothing
)
finally
deactivate(ctx)
Expand Down

0 comments on commit 1dc2182

Please sign in to comment.