KernelDensity.jl icon indicating copy to clipboard operation
KernelDensity.jl copied to clipboard

Use AbstractFFTs instead of FFTW

Open devmotion opened this issue 9 months ago • 6 comments

The AbstractFFTs interface is a bit special: The only way to select a backend such as FFTW or RustFFT is to load the desired backend package (see e.g. https://github.com/JuliaMath/AbstractFFTs.jl/issues/32 and the discussion in https://github.com/JuliaPlots/StatsPlots.jl/pull/480). In particular, as noted in https://github.com/JuliaPlots/StatsPlots.jl/pull/480#issuecomment-1022370329 this means that

Once one of the packages that implements the interface is loaded, there's no way for the user to switch between them, and the whole point of the interface package is to not coerce the user to a choice.

Generally, that seems to be a questionable design decision to me. However, until the design is changed, IMO KernelDensity.jl should follow it and not enforce the use of FFTW.jl throughout the ecosystem, in particular since nowadays different backends such as FFTW.jl, GenericFFTs.jl, and RustFFT.jl (real FFTs planned but not supported yet) exist. Even more so since the GPL-license of FFTW can be problematic and MKL alternative is a large lazy artifact and missing support for e.g. recent Macs with Apple silicon.

devmotion avatar Oct 03 '23 11:10 devmotion