FFTW.jl
FFTW.jl copied to clipboard
Expose full guru interface API
The current plan_*
API does not expose the full functionality that the C FFTW API has, namely the ability to specify a custom stride pattern and the number of transforms to perform.
In my use case I have dense arrays of a custom number type VarNum{T}
, wrapping two T
s, and need to perform transforms on the x
and y
components separately. For instance, consider:
struct VarNum{T<:Number} <: Number
x::T
y::T
end
# arrays
u = Matrix{VarNum{Float64}}(10, 10)
U = Matrix{VarNum{Complex{Float64}}}(10, 6)
# create and apply plan
p = plan_rftt(u, [2, 1])
A_mul_B!(U, p, U)
I have somehow hacked into FFTW.jl
code as much as needed to achieve what I want. This required doubling the strides of VarNum
arrays, doubling the howmany
parameter, and defining appropriate methods for VarNum
arrays. I feel, though, that such functionality might be useful to many other people and it would be good to have it in the package.
In the Hadamard.jl package, I also had to ccall
the low-level guru interface. It's not too hard, but it is worth thinking about a higher-level way to expose this.
I would be happy to prepare a pull request, because I need this quite badly at the moment. I need guidance, though, since I know the guru API up to a certain point.
The design space allows some flexibility here, depending on how much functionality we want to expose. For my use case, a julian trait-based dispatch mechanisms with trait functions acting on the number type (i.e. strides and howmany) would be sufficient, but the guru API is vastly more flexible, e.g. split arrays, and a one-to-one map to the C API might be a better start.
Yeah. As you know, guru interface is already in FFTW.jl but for internal use. You can reuse it. https://github.com/JuliaMath/FFTW.jl/blob/master/src/fft.jl#L491
@appleparan Thanks. I was wondering what kind of API and functionality we want to have on the Julia side.