DTolm / VkFFT

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

The Z2D interface of vkfft is quite different from the result of fftw. #133

Open zhaohaifei opened 10 months ago

zhaohaifei commented 10 months ago

I want to call Z2D to calculate the fft of multiple batches. Is there any problem with this call? Why is the result so different from fftw? Also, I'm using version 1.2.12.

VkFFTConfiguration configuration = {}; VkFFTApplication app_outplace = {};

hipDevice_t device; uint64_t bufferSize = 0; uint64_t inputbufferSize = 0;

...

configuration.device = &plan->device; configuration.FFTdim = 1; configuration.size[0] = 3; configuration.numberBatches = 4; configuration.bufferNum = 1; configuration.inputBufferNum = 1;

configuration.inputBufferStride[dim - 1] = xxx; configuration.bufferStride[dim - 1] = xxx;

configuration.inputbufferSize = xxx; configuration.bufferSize = xxx;

configuration.doublePrecision = true; configuration.performR2C = true; configuration.inverseReturnToInputBuffer = true;

configuration.isInputFormatted = true; VkFFTResult fftResult = initializeVkFFT(&plan->app_outplace, plan->configuration);

VkFFTLaunchParams launchParams = {}; launchParams.inputBuffer = (void)&odata; launchParams.buffer = (void)&idata;

VkFFTResult resVkFFT = VKFFT_SUCCESS; resVkFFT = VkFFTAppend(&plan->app_outplace, 1, &launchParams);

DTolm commented 10 months ago

Hello,

can you post the full code of FFTW initialization and the full code of VkFFT initialization? It is impossible to judge what is wrong otherwise.

Best regards, Dmitrii