DTolm / VkFFT

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

How to call c2r alone? #130

Closed zhaohaifei closed 10 months ago

zhaohaifei commented 10 months ago

I know that by specifying VkFFTConfiguration.performR2C=1, R2C+C2R can be calculated. I want to calculate C2R separately, how should I do it?

DTolm commented 10 months ago

performR2C specifies that the transform is using Real data as input in forward transform and as output in inverse. It doesn't do r2c+c2r, that is done in benchmarks. To do c2r you have to call VkFFTAppend(app, 1, launchParams); - here 1 specifies the inverse direction, -1 would do r2c.

zhaohaifei commented 10 months ago

Thank you.

zhaohaifei commented 10 months ago

Why does the benchmark put c2r+r2c together? Is the performance of c2r and r2c the same? Is it the same for d2z and z2d?

DTolm commented 10 months ago

The performance of forward and inverse transforms is roughly the same for all algorithms. Having them both in the benchmark was the choice I made originally to keep track of it being the same after changes.