From 8db04ff73735dd062c17480701516c30003f22f3 Mon Sep 17 00:00:00 2001 From: Valentin Churavy Date: Wed, 7 Feb 2024 14:42:52 -0500 Subject: [PATCH] Support enzyme in KA --- Project.toml | 2 +- src/CUDAKernels.jl | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index abb9008514..8909da9d20 100644 --- a/Project.toml +++ b/Project.toml @@ -57,7 +57,7 @@ DataFrames = "1" ExprTools = "0.1" GPUArrays = "10.0.1" GPUCompiler = "0.24, 0.25" -KernelAbstractions = "0.9.2" +KernelAbstractions = "0.9.17" LLVM = "6" LLVMLoopInfo = "1" LazyArtifacts = "1" diff --git a/src/CUDAKernels.jl b/src/CUDAKernels.jl index 3473da7eba..c478285f28 100644 --- a/src/CUDAKernels.jl +++ b/src/CUDAKernels.jl @@ -243,4 +243,10 @@ function KA.priority!(::CUDABackend, prio::Symbol) return nothing end +KA.supports_enzyme(::CUDABackend) = true +function KA.__fake_compiler_job(::CUDABackend) + mi = CUDA.methodinstance(typeof(()->return), Tuple{}) + return CUDA.CompilerJob(mi, CUDA.compiler_config(CUDA.device())) +end + end