cannam@127: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> cannam@127: <html> cannam@127: <!-- This manual is for FFTW cannam@127: (version 3.3.5, 30 July 2016). cannam@127: cannam@127: Copyright (C) 2003 Matteo Frigo. cannam@127: cannam@127: Copyright (C) 2003 Massachusetts Institute of Technology. cannam@127: cannam@127: Permission is granted to make and distribute verbatim copies of this cannam@127: manual provided the copyright notice and this permission notice are cannam@127: preserved on all copies. cannam@127: cannam@127: Permission is granted to copy and distribute modified versions of this cannam@127: manual under the conditions for verbatim copying, provided that the cannam@127: entire resulting derived work is distributed under the terms of a cannam@127: permission notice identical to this one. cannam@127: cannam@127: Permission is granted to copy and distribute translations of this manual cannam@127: into another language, under the above conditions for modified versions, cannam@127: except that this permission notice may be stated in a translation cannam@127: approved by the Free Software Foundation. --> cannam@127: <!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ --> cannam@127: <head> cannam@127: <title>FFTW 3.3.5: Planner Flags</title> cannam@127: cannam@127: <meta name="description" content="FFTW 3.3.5: Planner Flags"> cannam@127: <meta name="keywords" content="FFTW 3.3.5: Planner Flags"> cannam@127: <meta name="resource-type" content="document"> cannam@127: <meta name="distribution" content="global"> cannam@127: <meta name="Generator" content="makeinfo"> cannam@127: <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> cannam@127: <link href="index.html#Top" rel="start" title="Top"> cannam@127: <link href="Concept-Index.html#Concept-Index" rel="index" title="Concept Index"> cannam@127: <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents"> cannam@127: <link href="Basic-Interface.html#Basic-Interface" rel="up" title="Basic Interface"> cannam@127: <link href="Real_002ddata-DFTs.html#Real_002ddata-DFTs" rel="next" title="Real-data DFTs"> cannam@127: <link href="Complex-DFTs.html#Complex-DFTs" rel="prev" title="Complex DFTs"> cannam@127: <style type="text/css"> cannam@127: <!-- cannam@127: a.summary-letter {text-decoration: none} cannam@127: blockquote.smallquotation {font-size: smaller} cannam@127: div.display {margin-left: 3.2em} cannam@127: div.example {margin-left: 3.2em} cannam@127: div.indentedblock {margin-left: 3.2em} cannam@127: div.lisp {margin-left: 3.2em} cannam@127: div.smalldisplay {margin-left: 3.2em} cannam@127: div.smallexample {margin-left: 3.2em} cannam@127: div.smallindentedblock {margin-left: 3.2em; font-size: smaller} cannam@127: div.smalllisp {margin-left: 3.2em} cannam@127: kbd {font-style:oblique} cannam@127: pre.display {font-family: inherit} cannam@127: pre.format {font-family: inherit} cannam@127: pre.menu-comment {font-family: serif} cannam@127: pre.menu-preformatted {font-family: serif} cannam@127: pre.smalldisplay {font-family: inherit; font-size: smaller} cannam@127: pre.smallexample {font-size: smaller} cannam@127: pre.smallformat {font-family: inherit; font-size: smaller} cannam@127: pre.smalllisp {font-size: smaller} cannam@127: span.nocodebreak {white-space:nowrap} cannam@127: span.nolinebreak {white-space:nowrap} cannam@127: span.roman {font-family:serif; font-weight:normal} cannam@127: span.sansserif {font-family:sans-serif; font-weight:normal} cannam@127: ul.no-bullet {list-style: none} cannam@127: --> cannam@127: </style> cannam@127: cannam@127: cannam@127: </head> cannam@127: cannam@127: <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000"> cannam@127: <a name="Planner-Flags"></a> cannam@127: <div class="header"> cannam@127: <p> cannam@127: Next: <a href="Real_002ddata-DFTs.html#Real_002ddata-DFTs" accesskey="n" rel="next">Real-data DFTs</a>, Previous: <a href="Complex-DFTs.html#Complex-DFTs" accesskey="p" rel="prev">Complex DFTs</a>, Up: <a href="Basic-Interface.html#Basic-Interface" accesskey="u" rel="up">Basic Interface</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p> cannam@127: </div> cannam@127: <hr> cannam@127: <a name="Planner-Flags-1"></a> cannam@127: <h4 class="subsection">4.3.2 Planner Flags</h4> cannam@127: cannam@127: <p>All of the planner routines in FFTW accept an integer <code>flags</code> cannam@127: argument, which is a bitwise OR (‘<samp>|</samp>’) of zero or more of the flag cannam@127: constants defined below. These flags control the rigor (and time) of cannam@127: the planning process, and can also impose (or lift) restrictions on the cannam@127: type of transform algorithm that is employed. cannam@127: </p> cannam@127: <p><em>Important:</em> the planner overwrites the input array during cannam@127: planning unless a saved plan (see <a href="Wisdom.html#Wisdom">Wisdom</a>) is available for that cannam@127: problem, so you should initialize your input data after creating the cannam@127: plan. The only exceptions to this are the <code>FFTW_ESTIMATE</code> and cannam@127: <code>FFTW_WISDOM_ONLY</code> flags, as mentioned below. cannam@127: </p> cannam@127: <p>In all cases, if wisdom is available for the given problem that was cannam@127: created with equal-or-greater planning rigor, then the more rigorous cannam@127: wisdom is used. For example, in <code>FFTW_ESTIMATE</code> mode any available cannam@127: wisdom is used, whereas in <code>FFTW_PATIENT</code> mode only wisdom created cannam@127: in patient or exhaustive mode can be used. See <a href="Words-of-Wisdom_002dSaving-Plans.html#Words-of-Wisdom_002dSaving-Plans">Words of Wisdom-Saving Plans</a>. cannam@127: </p> cannam@127: <a name="Planning_002drigor-flags"></a> cannam@127: <h4 class="subsubheading">Planning-rigor flags</h4> cannam@127: <ul> cannam@127: <li> <a name="index-FFTW_005fESTIMATE-2"></a> cannam@127: <code>FFTW_ESTIMATE</code> specifies that, instead of actual measurements of cannam@127: different algorithms, a simple heuristic is used to pick a (probably cannam@127: sub-optimal) plan quickly. With this flag, the input/output arrays are cannam@127: not overwritten during planning. cannam@127: cannam@127: </li><li> <a name="index-FFTW_005fMEASURE-2"></a> cannam@127: <code>FFTW_MEASURE</code> tells FFTW to find an optimized plan by actually cannam@127: <em>computing</em> several FFTs and measuring their execution time. cannam@127: Depending on your machine, this can take some time (often a few cannam@127: seconds). <code>FFTW_MEASURE</code> is the default planning option. cannam@127: cannam@127: </li><li> <a name="index-FFTW_005fPATIENT-2"></a> cannam@127: <code>FFTW_PATIENT</code> is like <code>FFTW_MEASURE</code>, but considers a wider cannam@127: range of algorithms and often produces a “more optimal” plan cannam@127: (especially for large transforms), but at the expense of several times cannam@127: longer planning time (especially for large transforms). cannam@127: cannam@127: </li><li> <a name="index-FFTW_005fEXHAUSTIVE-1"></a> cannam@127: <code>FFTW_EXHAUSTIVE</code> is like <code>FFTW_PATIENT</code>, but considers an cannam@127: even wider range of algorithms, including many that we think are cannam@127: unlikely to be fast, to produce the most optimal plan but with a cannam@127: substantially increased planning time. cannam@127: cannam@127: </li><li> <a name="index-FFTW_005fWISDOM_005fONLY"></a> cannam@127: <code>FFTW_WISDOM_ONLY</code> is a special planning mode in which the plan cannam@127: is only created if wisdom is available for the given problem, and cannam@127: otherwise a <code>NULL</code> plan is returned. This can be combined with cannam@127: other flags, e.g. ‘<samp>FFTW_WISDOM_ONLY | FFTW_PATIENT</samp>’ creates a cannam@127: plan only if wisdom is available that was created in cannam@127: <code>FFTW_PATIENT</code> or <code>FFTW_EXHAUSTIVE</code> mode. The cannam@127: <code>FFTW_WISDOM_ONLY</code> flag is intended for users who need to detect cannam@127: whether wisdom is available; for example, if wisdom is not available cannam@127: one may wish to allocate new arrays for planning so that user data is cannam@127: not overwritten. cannam@127: cannam@127: </li></ul> cannam@127: cannam@127: <a name="Algorithm_002drestriction-flags"></a> cannam@127: <h4 class="subsubheading">Algorithm-restriction flags</h4> cannam@127: <ul> cannam@127: <li> <a name="index-FFTW_005fDESTROY_005fINPUT"></a> cannam@127: <code>FFTW_DESTROY_INPUT</code> specifies that an out-of-place transform is cannam@127: allowed to <em>overwrite its input</em> array with arbitrary data; this cannam@127: can sometimes allow more efficient algorithms to be employed. cannam@127: <a name="index-out_002dof_002dplace"></a> cannam@127: cannam@127: </li><li> <a name="index-FFTW_005fPRESERVE_005fINPUT-1"></a> cannam@127: <code>FFTW_PRESERVE_INPUT</code> specifies that an out-of-place transform must cannam@127: <em>not change its input</em> array. This is ordinarily the cannam@127: <em>default</em>, except for c2r and hc2r (i.e. complex-to-real) cannam@127: transforms for which <code>FFTW_DESTROY_INPUT</code> is the default. In the cannam@127: latter cases, passing <code>FFTW_PRESERVE_INPUT</code> will attempt to use cannam@127: algorithms that do not destroy the input, at the expense of worse cannam@127: performance; for multi-dimensional c2r transforms, however, no cannam@127: input-preserving algorithms are implemented and the planner will return cannam@127: <code>NULL</code> if one is requested. cannam@127: <a name="index-c2r-1"></a> cannam@127: <a name="index-hc2r-1"></a> cannam@127: cannam@127: </li><li> <a name="index-FFTW_005fUNALIGNED"></a> cannam@127: <a name="index-alignment-1"></a> cannam@127: <a name="index-fftw_005fmalloc-4"></a> cannam@127: <a name="index-fftw_005falignment_005fof"></a> cannam@127: <code>FFTW_UNALIGNED</code> specifies that the algorithm may not impose any cannam@127: unusual alignment requirements on the input/output arrays (i.e. no cannam@127: SIMD may be used). This flag is normally <em>not necessary</em>, since cannam@127: the planner automatically detects misaligned arrays. The only use for cannam@127: this flag is if you want to use the new-array execute interface to cannam@127: execute a given plan on a different array that may not be aligned like cannam@127: the original. (Using <code>fftw_malloc</code> makes this flag unnecessary cannam@127: even then. You can also use <code>fftw_alignment_of</code> to detect cannam@127: whether two arrays are equivalently aligned.) cannam@127: cannam@127: </li></ul> cannam@127: cannam@127: <a name="Limiting-planning-time"></a> cannam@127: <h4 class="subsubheading">Limiting planning time</h4> cannam@127: cannam@127: <div class="example"> cannam@127: <pre class="example">extern void fftw_set_timelimit(double seconds); cannam@127: </pre></div> cannam@127: <a name="index-fftw_005fset_005ftimelimit"></a> cannam@127: cannam@127: <p>This function instructs FFTW to spend at most <code>seconds</code> seconds cannam@127: (approximately) in the planner. If <code>seconds == cannam@127: FFTW_NO_TIMELIMIT</code> (the default value, which is negative), then cannam@127: planning time is unbounded. Otherwise, FFTW plans with a cannam@127: progressively wider range of algorithms until the the given time limit cannam@127: is reached or the given range of algorithms is explored, returning the cannam@127: best available plan. cannam@127: <a name="index-FFTW_005fNO_005fTIMELIMIT"></a> cannam@127: </p> cannam@127: cannam@127: <p>For example, specifying <code>FFTW_PATIENT</code> first plans in cannam@127: <code>FFTW_ESTIMATE</code> mode, then in <code>FFTW_MEASURE</code> mode, then cannam@127: finally (time permitting) in <code>FFTW_PATIENT</code>. If cannam@127: <code>FFTW_EXHAUSTIVE</code> is specified instead, the planner will further cannam@127: progress to <code>FFTW_EXHAUSTIVE</code> mode. cannam@127: </p> cannam@127: <p>Note that the <code>seconds</code> argument specifies only a rough limit; in cannam@127: practice, the planner may use somewhat more time if the time limit is cannam@127: reached when the planner is in the middle of an operation that cannot cannam@127: be interrupted. At the very least, the planner will complete planning cannam@127: in <code>FFTW_ESTIMATE</code> mode (which is thus equivalent to a time limit cannam@127: of 0). cannam@127: </p> cannam@127: cannam@127: <hr> cannam@127: <div class="header"> cannam@127: <p> cannam@127: Next: <a href="Real_002ddata-DFTs.html#Real_002ddata-DFTs" accesskey="n" rel="next">Real-data DFTs</a>, Previous: <a href="Complex-DFTs.html#Complex-DFTs" accesskey="p" rel="prev">Complex DFTs</a>, Up: <a href="Basic-Interface.html#Basic-Interface" accesskey="u" rel="up">Basic Interface</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p> cannam@127: </div> cannam@127: cannam@127: cannam@127: cannam@127: </body> cannam@127: </html>