From ac78d25730155f4cdc5b7db10123b8b1f0279b14 Mon Sep 17 00:00:00 2001 From: "William S. Moses" Date: Tue, 1 Oct 2024 23:43:11 -0400 Subject: [PATCH 1/3] Mark assert applicable as non-differentiable --- Project.toml | 7 +++++++ ext/FFTWEnzymeExt.jl | 8 ++++++++ 2 files changed, 15 insertions(+) create mode 100644 ext/FFTWEnzymeExt.jl diff --git a/Project.toml b/Project.toml index b648109..62d7a64 100644 --- a/Project.toml +++ b/Project.toml @@ -10,8 +10,15 @@ MKL_jll = "856f044c-d86e-5d09-b602-aeab76dc8ba7" Preferences = "21216c6a-2e73-6563-6e65-726566657250" Reexport = "189a3867-3050-52da-a836-e630ba90ab69" +[weakdeps] +Enzyme = "7da242da-08ed-463a-9acd-ee780be4f1d9" + +[extensions] +FFTWEnzymeExt = "Enzyme" + [compat] AbstractFFTs = "1.5" +Enzyme = "0.12, 0.13" FFTW_jll = "3.3.9" LinearAlgebra = "<0.0.1, 1" MKL_jll = "2019.0.117, 2020, 2021, 2022, 2023, 2024" diff --git a/ext/FFTWEnzymeExt.jl b/ext/FFTWEnzymeExt.jl new file mode 100644 index 0000000..b0137cf --- /dev/null +++ b/ext/FFTWEnzymeExt.jl @@ -0,0 +1,8 @@ +module FFTWEnzymeExt + +using Enzyme, FFTW + +Enzyme.EnzymeRules.inactive_noinl(typeof(assert_applicable), x...) = true + +end # module + From 8abd91d12863d68eac984089cf8c796db3d633c3 Mon Sep 17 00:00:00 2001 From: "William S. Moses" Date: Tue, 1 Oct 2024 23:53:15 -0400 Subject: [PATCH 2/3] fixup --- ext/FFTWEnzymeExt.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/FFTWEnzymeExt.jl b/ext/FFTWEnzymeExt.jl index b0137cf..dbd29cf 100644 --- a/ext/FFTWEnzymeExt.jl +++ b/ext/FFTWEnzymeExt.jl @@ -2,7 +2,7 @@ module FFTWEnzymeExt using Enzyme, FFTW -Enzyme.EnzymeRules.inactive_noinl(typeof(assert_applicable), x...) = true +Enzyme.EnzymeRules.inactive_noinl(typeof(FFTW.assert_applicable), x...) = true end # module From e5699f1fcba0e7eddb4c5550c097a45467afd6eb Mon Sep 17 00:00:00 2001 From: "William S. Moses" Date: Tue, 1 Oct 2024 23:53:33 -0400 Subject: [PATCH 3/3] fixup --- ext/FFTWEnzymeExt.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/FFTWEnzymeExt.jl b/ext/FFTWEnzymeExt.jl index dbd29cf..f05cd96 100644 --- a/ext/FFTWEnzymeExt.jl +++ b/ext/FFTWEnzymeExt.jl @@ -2,7 +2,7 @@ module FFTWEnzymeExt using Enzyme, FFTW -Enzyme.EnzymeRules.inactive_noinl(typeof(FFTW.assert_applicable), x...) = true +Enzyme.EnzymeRules.inactive_noinl(::typeof(FFTW.assert_applicable), x...) = true end # module