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
6 changes: 6 additions & 0 deletions src/internal_rules/inactive.jl
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,12 @@ end
function EnzymeRules.inactive_noinl(::typeof(Base.dataids), args...)
return nothing
end
function EnzymeRules.inactive_noinl(::typeof(Base.signature_type), args...)
return nothing
end
function EnzymeRules.inactive_noinl(::typeof(Base.methods), args...)
return nothing
end

@inline EnzymeRules.inactive_type(v::Type{Nothing}) = true
@inline EnzymeRules.inactive_type(v::Type{Union{}}) = true
Expand Down
18 changes: 18 additions & 0 deletions src/typeutils/make_zero.jl
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,24 @@ end
return res
end

@inline function EnzymeCore.make_zero(
::Type{Core.SimpleVector},
seen::IdDict,
prev::Core.SimpleVector,
::Val{copy_if_inactive} = Val(false),
)::Core.SimpleVector where {copy_if_inactive}
if haskey(seen, prev)
return seen[prev]
end
data = []
for v in prev
push!(data, EnzymeCore.make_zero(Core.Typeof(v), seen, v, Val(copy_if_inactive)))
end
newa = Core.svec(data)
seen[prev] = newa
return newa
end

@inline function EnzymeCore.make_zero(
::Type{RT},
seen::IdDict,
Expand Down
Loading