Skip to content

Commit

Permalink
Add guess activity of ref of int
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmoses committed Sep 18, 2023
1 parent a66ede4 commit e3e40e7
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/compiler.jl
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,17 @@ end
return state == ActiveState
end

@inline function Enzyme.guess_activity(::Type{T}, Mode::API.CDerivativeMode) where {T<:AbstractArray{<:Integer}}
return Const{T}
end

@inline function Enzyme.guess_activity(::Type{T}, Mode::API.CDerivativeMode) where {T<:Base.Ref{<:Integer}}
return Const{T}
end
@inline function Enzyme.guess_activity(::Type{T}, Mode::API.CDerivativeMode) where {T<:Base.RefValue{<:Integer}}
return Const{T}
end

@inline function Enzyme.guess_activity(::Type{T}, Mode::API.CDerivativeMode) where {T<:AbstractArray}
if Mode == API.DEM_ForwardMode
return DuplicatedNoNeed{T}
Expand Down

0 comments on commit e3e40e7

Please sign in to comment.