Skip to content

Commit

Permalink
Force more specialization on promote_to_const
Browse files Browse the repository at this point in the history
  • Loading branch information
vchuravy committed Oct 10, 2024
1 parent 8ee2c37 commit a25af7f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ParallelKernel/EnzymeExt/autodiff_gpu.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import Enzyme
# ParallelStencil injects a configuration parameter at the end, for Enzyme we need to wrap that parameter as a Annotation
# for all purposes this ought to be Const. This is not ideal since we might accidentially wrap other parameters the user
# provided as well. This is needed to support @parallel autodiff_deferred(...)
function promote_to_const(args...)
ntuple(length(args)) do i
function promote_to_const(args::Vararg{Any,N}) where N
ntuple(Val(N)) do i
@inline
if !(args[i] isa Enzyme.Annotation ||
(args[i] isa UnionAll && args[i] <: Enzyme.Annotation) || # Const
Expand Down

0 comments on commit a25af7f

Please sign in to comment.