How Can I calculate the 1D Fourier transform in not-the-first dimension in multidimensional matrix?

CUFFT provides cufftPlanMany to do 1D Fourier transform along the arbitrary axis, but now it doesn’t support the setting-up of non-contiguous input data. I want to transform a 2D matrix data[ny][ix] or *data (the matrix assembled in a C-style format) along the y-axis, if I don’t want to do so in a loop way, how can I program it by CUFFT or there is an alternative software to turn to which is compatible with FFTW?

I think that you can transpose your matrix first, call CUFFT, then transpose back.

Transpose operation is memory-bound and you can find a good solution in SDK.

You are right, actually I have done it in my program. But this method is hard to extend to 3D.

you can transpose any two dimensions in 3-D data, the same idea as transpose example in SDK.

suppose you have a 3-D array A[y][z] where x, y, z are nothing but index,

FFT on z is good,

FFT on y, you need to transpose (x,y,z) --> (x,z,y)

FFT on x, you need to transpose (x,y,z) --> (z,y,x)

both transpose operations have the same performance.