Backends and support

BackendTransformsDifferentiation
CPU / FFTWFloat32/Float64; forward/inverse, selected axes, plans, mutationEnzyme forward/reverse
NVIDIA GPU / CUDA 5Verified on A40; Float32/Float64, selected axes, plans, mutation, mul!Not validated for CuArray
Reactant CPUFloat32/Float64; up to four transform axes, plans, mutationForward/reverse
Reactant NVIDIA GPUVerified on A40; same transform coverage as Reactant CPUForward/reverse
TPU, AMD, MetalNot validatedNot validated

Distributed/sharded FFTs are not validated. See Performance for CPU/GPU measurements.

CUDA

Install and load CUDA separately to activate the extension. With a working CUDA installation, the interface is:

using CUDA, FastHartleyTransform
# Keep the input and transformed data on the GPU during repeated execution.
x = CUDA.randn(Float32, 64, 64)
p = plan_fht(x, (1, 2))
y = p * x
restored = inv(p) * y # The inverse plan includes normalization.

The extension uses cuFFT backward FFT plans. CuArray execution is separate from Reactant compilation.

Reactant

Convert arrays with Reactant.to_rarray, then compile the calculation with Reactant.@compile. Shape or transform-axis changes can trigger recompilation. See Differentiation and compiled execution for setup and constraints.

Choosing a path

Use CPU FFTW for a direct Julia API with reusable plans. Use Reactant when the larger downstream computation can be compiled together. Select a device based on actual execution and measurements on that device.