Similar to the ChainRulesCore support, we could use EnzymeCore.EnzymeRules to define Forward and Reverse mode rules for Enzyme in an extension.
EnzymeCore requires at least Julia v1.6. Making it a dependency for Julia versions older than v1.6 (as is done with ChainRulesCore) would then only be possible if AbstractFFTs add a Julia v1.6 version bound. But since EnzymeCore's sole dependency (Adapt) depends on Requires, it may make more sense to conditionally load on pre-v1.9 using Requires.jl: https://pkgdocs.julialang.org/dev/creating-packages/#Requires.jl
Unlike ChainRulesCore support, it probably only makes sense to only define rules for StridedArray inputs to avoid doing the wrong thing for sparse or structured arrays.
Similar to the ChainRulesCore support, we could use
EnzymeCore.EnzymeRulesto defineForwardandReversemode rules for Enzyme in an extension.EnzymeCore requires at least Julia v1.6. Making it a dependency for Julia versions older than v1.6 (as is done with ChainRulesCore) would then only be possible if AbstractFFTs add a Julia v1.6 version bound. But since EnzymeCore's sole dependency (Adapt) depends on Requires, it may make more sense to conditionally load on pre-v1.9 using Requires.jl: https://pkgdocs.julialang.org/dev/creating-packages/#Requires.jl
Unlike ChainRulesCore support, it probably only makes sense to only define rules for
StridedArrayinputs to avoid doing the wrong thing for sparse or structured arrays.