Directly applying CuFFT on StructArrays

I wonder if there is a way to use CuFFT directly on StructArrays{<:Complex}. Currently, if I write e.g.

using CUDA, StructArrays
x_re = rand(Float32, 10);
x_im = rand(Float32, 10);
x = StructArray{ComplexF32}((x_re,x_im));
x_gpu = replace_storage(CuArray, x);
F = CUFFT.plan_fft!(x_gpu); # throws an error

The main problem is that StructArrays are subtypes of AbstractArrays, which is too obscure to be passed to the functions in CUFFT (and the same happens with FFTW.jl, i.e. FFTW.plan_fft!(x) will throw an error).

I think that making a wrapper for x_gpu would be a possible solution, but I have no idea on that wrapper. Another solution would be to directly pass x_gpu to ccall-ed CUDA libraries but I have no idea on this too. Could you give me a suggestion?

A StructArray is made up of two individual arrays, so the memory layout is different to what CUFFT expects (complex elements). So that can’t work, unless CUFFT has APIs that accept two arrays too, in which case you’d need to add the necessary wrappers using ::StructArray inputs. Another alternative is a native Julia FFT kernel, but that’s a lot of work too.