From a25af7f2e75774a81b550be6bc7add91309eabea Mon Sep 17 00:00:00 2001 From: Valentin Churavy Date: Thu, 10 Oct 2024 10:35:07 +0200 Subject: [PATCH] Force more specialization on promote_to_const --- src/ParallelKernel/EnzymeExt/autodiff_gpu.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ParallelKernel/EnzymeExt/autodiff_gpu.jl b/src/ParallelKernel/EnzymeExt/autodiff_gpu.jl index bde30b0..b500f01 100644 --- a/src/ParallelKernel/EnzymeExt/autodiff_gpu.jl +++ b/src/ParallelKernel/EnzymeExt/autodiff_gpu.jl @@ -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