How do I reuse a plan with different input / output data in FFTW 3?
I am transforming a large number of small arrays, mostly of the same size, and plan creation is currently the bottleneck.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There are two options – either create your original plan with a “scratch” set of input/output arrays that you copy each successive data set into and each result out of, or, use the “guru” interface to execute a plan (which normally contains the addresses of the arrays it was created for) with a different set of arrays. There is a section in the fftw manual that describes exactly this scenario, along with the additional restrictions on alignment, size, etc. that must be followed in order for that to work. As another possibility, if all the small arrays are e.g. the rows of a matrix/image or something like that, that would be separated by a predictable stride, you can use the “advanced” interface to perform them all at once.