Question

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.

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top