DTolm / VkFFT

Vulkan/CUDA/HIP/OpenCL/Level Zero/Metal Fast Fourier Transform library
MIT License
1.52k stars 91 forks source link

r2c+c2r question #132

Closed zhaohaifei closed 1 year ago

zhaohaifei commented 1 year ago

I used the outplace mode when doing r2c+c2r calculations. Refer to sample-15, when r2c, assign r to inputBuffer, and assign c to buffer. If c2r is calculated, shouldn't c be assigned to inputBuffer and r assigned to buffer? Why in the example, c is still assigned to buffer and r is assigned to inputbuffer? I don't quite understand the underlying principle. Can you tell me what happened in detail?

DTolm commented 1 year ago

Sample 15 uses inverseReturnToInputBuffer flag in the configuration that makes the order of buffers reversed, meaning c2r code created by the application will return to the inputBuffer.

zhaohaifei commented 1 year ago

If I don't use inverseReturnToInputBuffer flag, should the order be that c is assigned to inputbuffer and r is assigned to buffer?

DTolm commented 1 year ago

Yes, this will be the case.