using StaticArrays, FFTW
A = [@SVector rand(ComplexF64, 3) for m ∈ 1:512]
fft(A)
but FFTW.jl throws an error when I try it.
Due to performance and ergonomic reasons, I really want to use an array of static vectors, instead of an array with one extra dimension. But just to be clear, I’m trying to perform an operation analogous to
A = rand(ComplexF64, 3, 512)
fft(A, dims=2)
Is there a way to accomplish this with an array of SArrays? I’d like to also do this on the GPU.
Maybe you want fft(reinterpret(reshape, ComplexF64, A), 2)? That ought to be a little quicker than fft(stack(A), 2). You can reinterpret back afterwards (or call eachcol).
Thanks, I guess this is it! I didn’t know about this three argument reinterpret. Is this expected to work on GPU as well? I currently do not have access to one to try things out.