VkFFT icon indicating copy to clipboard operation
VkFFT copied to clipboard

initializeVkFFT only once?

Open geekac opened this issue 2 years ago • 3 comments

Hi, DTolm. Thank you for this great work. I'm using VkFFT for iOS development, so it's metal backend. My problem is that the same size data to perform FFT costs so much time on initializeVkFFT! so, I want to just call initializeVkFFT once (keep VkFFTConfiguration configuration && VkFFTApplication app), and send different data (but same size) to app. What should I do? Thank you.

geekac avatar Aug 11 '23 04:08 geekac

Hello,

Thanks for your interest in VkFFT! Of course, for the same size of system you don't need to initialize the application again. There is a VkFFTLaunchParams struct that is consumed by VkFFTAppend call which can be used to specify different data and offsets.

Best regards, Dmitrii

DTolm avatar Aug 11 '23 07:08 DTolm

Thank you, Dmitrii. Base on your guidance, I wrote the right code for the same size of data. But, to learn more, does that means for diffierent size of inputs, I have to initialize the application again and again? Best wishes

geekac avatar Aug 14 '23 09:08 geekac

Yes, different sizes require different codepaths, mainly based on the prime decomposition of the number. There is an option to save the binaries after compilation that works in all backends but Metal, as Metal seems to have its own caching mechanism implemented in it, so secondary initializations should be faster.

DTolm avatar Aug 14 '23 10:08 DTolm