user835943
user835943

Reputation: 191

Reusing Plan with FFTW3

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.

Upvotes: 4

Views: 1162

Answers (1)

twalberg
twalberg

Reputation: 62469

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.

Upvotes: 8

Related Questions