diff --git a/ext/EnzymeCoreExt.jl b/ext/EnzymeCoreExt.jl index 0fe728af3d..fb1003eaf9 100644 --- a/ext/EnzymeCoreExt.jl +++ b/ext/EnzymeCoreExt.jl @@ -25,7 +25,7 @@ end function EnzymeCore.EnzymeRules.inactive_noinl(::typeof(CUDA.is_pinned), args...) return nothing end -function EnzymeCore.EnzymeRules.inactive_noinl(::typeof(CUDA.launch_configuration), args...; kwargs...) +function EnzymeCore.EnzymeRules.inactive(::typeof(CUDA.launch_configuration), args...; kwargs...) return nothing end diff --git a/test/extensions/enzyme.jl b/test/extensions/enzyme.jl index 3cc6949b69..3e34af70a5 100644 --- a/test/extensions/enzyme.jl +++ b/test/extensions/enzyme.jl @@ -145,6 +145,16 @@ end @test all(dx .≈ 1) @test all(dy .≈ 1) end + +sumabs2(x) = sum(abs2.(x)) + +@testset "Reverse sum abs2" begin + x = CuArray([1.0, 2.0, 3.0, 4.0]) + dx = CuArray([0., 0.0, 0.0, 0.0]) + Enzyme.autodiff(Reverse, sumabs2, Active, Duplicated(x, dx)) + @test all(dx .≈ 2 .* x) +end + # TODO once reverse kernels are in # function togpu(x) # x = CuArray(x)