diff --git a/Project.toml b/Project.toml index a34cc83b..134da1ec 100644 --- a/Project.toml +++ b/Project.toml @@ -48,7 +48,7 @@ CEnum = "0.5, 1" Crayons = "4" ExprTools = "0.1" GPUArrays = "12.1" -GPUCompiler = "2.17" +GPUCompiler = "2.18" GPUToolbox = "3.4" IntelITT = "0.2" KernelAbstractions = "0.10" diff --git a/src/compiler/execution.jl b/src/compiler/execution.jl index f39bd4b7..aaab7794 100644 --- a/src/compiler/execution.jl +++ b/src/compiler/execution.jl @@ -326,7 +326,11 @@ end const zefunction_lock = ReentrantLock() function zefunction(f::F, tt::TT=Tuple{}; kwargs...) where {F,TT} - fun = zefunction_link(methodinstance(F, tt); kwargs...) + # the kernel also depends on the task's context and device, see `zefunction_link` + kw = values(kwargs) + fun = GPUCompiler.cached_lookup(ZeKernel, F, tt, (context(), device(), kw)) do + zefunction_link(methodinstance(F, tt); kw...) + end return HostKernel{F,tt}(f, fun) end