Chris@42: Chris@42: Chris@42: Chris@42: Chris@42:
Chris@42:Chris@42: Next: Real-data DFTs, Previous: Complex DFTs, Up: Basic Interface [Contents][Index]
Chris@42:All of the planner routines in FFTW accept an integer flags
Chris@42: argument, which is a bitwise OR (‘|’) of zero or more of the flag
Chris@42: constants defined below. These flags control the rigor (and time) of
Chris@42: the planning process, and can also impose (or lift) restrictions on the
Chris@42: type of transform algorithm that is employed.
Chris@42:
Important: the planner overwrites the input array during
Chris@42: planning unless a saved plan (see Wisdom) is available for that
Chris@42: problem, so you should initialize your input data after creating the
Chris@42: plan. The only exceptions to this are the FFTW_ESTIMATE
and
Chris@42: FFTW_WISDOM_ONLY
flags, as mentioned below.
Chris@42:
In all cases, if wisdom is available for the given problem that was
Chris@42: created with equal-or-greater planning rigor, then the more rigorous
Chris@42: wisdom is used. For example, in FFTW_ESTIMATE
mode any available
Chris@42: wisdom is used, whereas in FFTW_PATIENT
mode only wisdom created
Chris@42: in patient or exhaustive mode can be used. See Words of Wisdom-Saving Plans.
Chris@42:
FFTW_ESTIMATE
specifies that, instead of actual measurements of
Chris@42: different algorithms, a simple heuristic is used to pick a (probably
Chris@42: sub-optimal) plan quickly. With this flag, the input/output arrays are
Chris@42: not overwritten during planning.
Chris@42:
Chris@42: FFTW_MEASURE
tells FFTW to find an optimized plan by actually
Chris@42: computing several FFTs and measuring their execution time.
Chris@42: Depending on your machine, this can take some time (often a few
Chris@42: seconds). FFTW_MEASURE
is the default planning option.
Chris@42:
Chris@42: FFTW_PATIENT
is like FFTW_MEASURE
, but considers a wider
Chris@42: range of algorithms and often produces a “more optimal” plan
Chris@42: (especially for large transforms), but at the expense of several times
Chris@42: longer planning time (especially for large transforms).
Chris@42:
Chris@42: FFTW_EXHAUSTIVE
is like FFTW_PATIENT
, but considers an
Chris@42: even wider range of algorithms, including many that we think are
Chris@42: unlikely to be fast, to produce the most optimal plan but with a
Chris@42: substantially increased planning time.
Chris@42:
Chris@42: FFTW_WISDOM_ONLY
is a special planning mode in which the plan
Chris@42: is only created if wisdom is available for the given problem, and
Chris@42: otherwise a NULL
plan is returned. This can be combined with
Chris@42: other flags, e.g. ‘FFTW_WISDOM_ONLY | FFTW_PATIENT’ creates a
Chris@42: plan only if wisdom is available that was created in
Chris@42: FFTW_PATIENT
or FFTW_EXHAUSTIVE
mode. The
Chris@42: FFTW_WISDOM_ONLY
flag is intended for users who need to detect
Chris@42: whether wisdom is available; for example, if wisdom is not available
Chris@42: one may wish to allocate new arrays for planning so that user data is
Chris@42: not overwritten.
Chris@42:
Chris@42: FFTW_DESTROY_INPUT
specifies that an out-of-place transform is
Chris@42: allowed to overwrite its input array with arbitrary data; this
Chris@42: can sometimes allow more efficient algorithms to be employed.
Chris@42:
Chris@42:
Chris@42: FFTW_PRESERVE_INPUT
specifies that an out-of-place transform must
Chris@42: not change its input array. This is ordinarily the
Chris@42: default, except for c2r and hc2r (i.e. complex-to-real)
Chris@42: transforms for which FFTW_DESTROY_INPUT
is the default. In the
Chris@42: latter cases, passing FFTW_PRESERVE_INPUT
will attempt to use
Chris@42: algorithms that do not destroy the input, at the expense of worse
Chris@42: performance; for multi-dimensional c2r transforms, however, no
Chris@42: input-preserving algorithms are implemented and the planner will return
Chris@42: NULL
if one is requested.
Chris@42:
Chris@42:
Chris@42:
Chris@42: FFTW_UNALIGNED
specifies that the algorithm may not impose any
Chris@42: unusual alignment requirements on the input/output arrays (i.e. no
Chris@42: SIMD may be used). This flag is normally not necessary, since
Chris@42: the planner automatically detects misaligned arrays. The only use for
Chris@42: this flag is if you want to use the new-array execute interface to
Chris@42: execute a given plan on a different array that may not be aligned like
Chris@42: the original. (Using fftw_malloc
makes this flag unnecessary
Chris@42: even then. You can also use fftw_alignment_of
to detect
Chris@42: whether two arrays are equivalently aligned.)
Chris@42:
Chris@42: extern void fftw_set_timelimit(double seconds); Chris@42:
This function instructs FFTW to spend at most seconds
seconds
Chris@42: (approximately) in the planner. If seconds ==
Chris@42: FFTW_NO_TIMELIMIT
(the default value, which is negative), then
Chris@42: planning time is unbounded. Otherwise, FFTW plans with a
Chris@42: progressively wider range of algorithms until the the given time limit
Chris@42: is reached or the given range of algorithms is explored, returning the
Chris@42: best available plan.
Chris@42:
Chris@42:
For example, specifying FFTW_PATIENT
first plans in
Chris@42: FFTW_ESTIMATE
mode, then in FFTW_MEASURE
mode, then
Chris@42: finally (time permitting) in FFTW_PATIENT
. If
Chris@42: FFTW_EXHAUSTIVE
is specified instead, the planner will further
Chris@42: progress to FFTW_EXHAUSTIVE
mode.
Chris@42:
Note that the seconds
argument specifies only a rough limit; in
Chris@42: practice, the planner may use somewhat more time if the time limit is
Chris@42: reached when the planner is in the middle of an operation that cannot
Chris@42: be interrupted. At the very least, the planner will complete planning
Chris@42: in FFTW_ESTIMATE
mode (which is thus equivalent to a time limit
Chris@42: of 0).
Chris@42:
Chris@42: Next: Real-data DFTs, Previous: Complex DFTs, Up: Basic Interface [Contents][Index]
Chris@42: