annotate src/fftw-3.3.3/doc/html/Planner-Flags.html @ 95:89f5e221ed7b

Add FFTW3
author Chris Cannam <cannam@all-day-breakfast.com>
date Wed, 20 Mar 2013 15:35:50 +0000
parents
children
rev   line source
cannam@95 1 <html lang="en">
cannam@95 2 <head>
cannam@95 3 <title>Planner Flags - FFTW 3.3.3</title>
cannam@95 4 <meta http-equiv="Content-Type" content="text/html">
cannam@95 5 <meta name="description" content="FFTW 3.3.3">
cannam@95 6 <meta name="generator" content="makeinfo 4.13">
cannam@95 7 <link title="Top" rel="start" href="index.html#Top">
cannam@95 8 <link rel="up" href="Basic-Interface.html#Basic-Interface" title="Basic Interface">
cannam@95 9 <link rel="prev" href="Complex-DFTs.html#Complex-DFTs" title="Complex DFTs">
cannam@95 10 <link rel="next" href="Real_002ddata-DFTs.html#Real_002ddata-DFTs" title="Real-data DFTs">
cannam@95 11 <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
cannam@95 12 <!--
cannam@95 13 This manual is for FFTW
cannam@95 14 (version 3.3.3, 25 November 2012).
cannam@95 15
cannam@95 16 Copyright (C) 2003 Matteo Frigo.
cannam@95 17
cannam@95 18 Copyright (C) 2003 Massachusetts Institute of Technology.
cannam@95 19
cannam@95 20 Permission is granted to make and distribute verbatim copies of
cannam@95 21 this manual provided the copyright notice and this permission
cannam@95 22 notice are preserved on all copies.
cannam@95 23
cannam@95 24 Permission is granted to copy and distribute modified versions of
cannam@95 25 this manual under the conditions for verbatim copying, provided
cannam@95 26 that the entire resulting derived work is distributed under the
cannam@95 27 terms of a permission notice identical to this one.
cannam@95 28
cannam@95 29 Permission is granted to copy and distribute translations of this
cannam@95 30 manual into another language, under the above conditions for
cannam@95 31 modified versions, except that this permission notice may be
cannam@95 32 stated in a translation approved by the Free Software Foundation.
cannam@95 33 -->
cannam@95 34 <meta http-equiv="Content-Style-Type" content="text/css">
cannam@95 35 <style type="text/css"><!--
cannam@95 36 pre.display { font-family:inherit }
cannam@95 37 pre.format { font-family:inherit }
cannam@95 38 pre.smalldisplay { font-family:inherit; font-size:smaller }
cannam@95 39 pre.smallformat { font-family:inherit; font-size:smaller }
cannam@95 40 pre.smallexample { font-size:smaller }
cannam@95 41 pre.smalllisp { font-size:smaller }
cannam@95 42 span.sc { font-variant:small-caps }
cannam@95 43 span.roman { font-family:serif; font-weight:normal; }
cannam@95 44 span.sansserif { font-family:sans-serif; font-weight:normal; }
cannam@95 45 --></style>
cannam@95 46 </head>
cannam@95 47 <body>
cannam@95 48 <div class="node">
cannam@95 49 <a name="Planner-Flags"></a>
cannam@95 50 <p>
cannam@95 51 Next:&nbsp;<a rel="next" accesskey="n" href="Real_002ddata-DFTs.html#Real_002ddata-DFTs">Real-data DFTs</a>,
cannam@95 52 Previous:&nbsp;<a rel="previous" accesskey="p" href="Complex-DFTs.html#Complex-DFTs">Complex DFTs</a>,
cannam@95 53 Up:&nbsp;<a rel="up" accesskey="u" href="Basic-Interface.html#Basic-Interface">Basic Interface</a>
cannam@95 54 <hr>
cannam@95 55 </div>
cannam@95 56
cannam@95 57 <h4 class="subsection">4.3.2 Planner Flags</h4>
cannam@95 58
cannam@95 59 <p>All of the planner routines in FFTW accept an integer <code>flags</code>
cannam@95 60 argument, which is a bitwise OR (&lsquo;<samp><span class="samp">|</span></samp>&rsquo;) of zero or more of the flag
cannam@95 61 constants defined below. These flags control the rigor (and time) of
cannam@95 62 the planning process, and can also impose (or lift) restrictions on the
cannam@95 63 type of transform algorithm that is employed.
cannam@95 64
cannam@95 65 <p><em>Important:</em> the planner overwrites the input array during
cannam@95 66 planning unless a saved plan (see <a href="Wisdom.html#Wisdom">Wisdom</a>) is available for that
cannam@95 67 problem, so you should initialize your input data after creating the
cannam@95 68 plan. The only exceptions to this are the <code>FFTW_ESTIMATE</code> and
cannam@95 69 <code>FFTW_WISDOM_ONLY</code> flags, as mentioned below.
cannam@95 70
cannam@95 71 <p>In all cases, if wisdom is available for the given problem that was
cannam@95 72 created with equal-or-greater planning rigor, then the more rigorous
cannam@95 73 wisdom is used. For example, in <code>FFTW_ESTIMATE</code> mode any available
cannam@95 74 wisdom is used, whereas in <code>FFTW_PATIENT</code> mode only wisdom created
cannam@95 75 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@95 76
cannam@95 77 <h5 class="subsubheading">Planning-rigor flags</h5>
cannam@95 78
cannam@95 79 <ul>
cannam@95 80 <li><a name="index-FFTW_005fESTIMATE-171"></a><code>FFTW_ESTIMATE</code> specifies that, instead of actual measurements of
cannam@95 81 different algorithms, a simple heuristic is used to pick a (probably
cannam@95 82 sub-optimal) plan quickly. With this flag, the input/output arrays are
cannam@95 83 not overwritten during planning.
cannam@95 84
cannam@95 85 <li><a name="index-FFTW_005fMEASURE-172"></a><code>FFTW_MEASURE</code> tells FFTW to find an optimized plan by actually
cannam@95 86 <em>computing</em> several FFTs and measuring their execution time.
cannam@95 87 Depending on your machine, this can take some time (often a few
cannam@95 88 seconds). <code>FFTW_MEASURE</code> is the default planning option.
cannam@95 89
cannam@95 90 <li><a name="index-FFTW_005fPATIENT-173"></a><code>FFTW_PATIENT</code> is like <code>FFTW_MEASURE</code>, but considers a wider
cannam@95 91 range of algorithms and often produces a &ldquo;more optimal&rdquo; plan
cannam@95 92 (especially for large transforms), but at the expense of several times
cannam@95 93 longer planning time (especially for large transforms).
cannam@95 94
cannam@95 95 <li><a name="index-FFTW_005fEXHAUSTIVE-174"></a><code>FFTW_EXHAUSTIVE</code> is like <code>FFTW_PATIENT</code>, but considers an
cannam@95 96 even wider range of algorithms, including many that we think are
cannam@95 97 unlikely to be fast, to produce the most optimal plan but with a
cannam@95 98 substantially increased planning time.
cannam@95 99
cannam@95 100 <li><a name="index-FFTW_005fWISDOM_005fONLY-175"></a><code>FFTW_WISDOM_ONLY</code> is a special planning mode in which the plan
cannam@95 101 is only created if wisdom is available for the given problem, and
cannam@95 102 otherwise a <code>NULL</code> plan is returned. This can be combined with
cannam@95 103 other flags, e.g. &lsquo;<samp><span class="samp">FFTW_WISDOM_ONLY | FFTW_PATIENT</span></samp>&rsquo; creates a
cannam@95 104 plan only if wisdom is available that was created in
cannam@95 105 <code>FFTW_PATIENT</code> or <code>FFTW_EXHAUSTIVE</code> mode. The
cannam@95 106 <code>FFTW_WISDOM_ONLY</code> flag is intended for users who need to detect
cannam@95 107 whether wisdom is available; for example, if wisdom is not available
cannam@95 108 one may wish to allocate new arrays for planning so that user data is
cannam@95 109 not overwritten.
cannam@95 110
cannam@95 111 </ul>
cannam@95 112
cannam@95 113 <h5 class="subsubheading">Algorithm-restriction flags</h5>
cannam@95 114
cannam@95 115 <ul>
cannam@95 116 <li><a name="index-FFTW_005fDESTROY_005fINPUT-176"></a><code>FFTW_DESTROY_INPUT</code> specifies that an out-of-place transform is
cannam@95 117 allowed to <em>overwrite its input</em> array with arbitrary data; this
cannam@95 118 can sometimes allow more efficient algorithms to be employed.
cannam@95 119 <a name="index-out_002dof_002dplace-177"></a>
cannam@95 120 <li><a name="index-FFTW_005fPRESERVE_005fINPUT-178"></a><code>FFTW_PRESERVE_INPUT</code> specifies that an out-of-place transform must
cannam@95 121 <em>not change its input</em> array. This is ordinarily the
cannam@95 122 <em>default</em>, except for c2r and hc2r (i.e. complex-to-real)
cannam@95 123 transforms for which <code>FFTW_DESTROY_INPUT</code> is the default. In the
cannam@95 124 latter cases, passing <code>FFTW_PRESERVE_INPUT</code> will attempt to use
cannam@95 125 algorithms that do not destroy the input, at the expense of worse
cannam@95 126 performance; for multi-dimensional c2r transforms, however, no
cannam@95 127 input-preserving algorithms are implemented and the planner will return
cannam@95 128 <code>NULL</code> if one is requested.
cannam@95 129 <a name="index-c2r-179"></a><a name="index-hc2r-180"></a>
cannam@95 130 <li><a name="index-FFTW_005fUNALIGNED-181"></a><a name="index-alignment-182"></a><code>FFTW_UNALIGNED</code> specifies that the algorithm may not impose any
cannam@95 131 unusual alignment requirements on the input/output arrays (i.e. no
cannam@95 132 SIMD may be used). This flag is normally <em>not necessary</em>, since
cannam@95 133 the planner automatically detects misaligned arrays. The only use for
cannam@95 134 this flag is if you want to use the new-array execute interface to
cannam@95 135 execute a given plan on a different array that may not be aligned like
cannam@95 136 the original. (Using <code>fftw_malloc</code> makes this flag unnecessary
cannam@95 137 even then.)
cannam@95 138
cannam@95 139 </ul>
cannam@95 140
cannam@95 141 <h5 class="subsubheading">Limiting planning time</h5>
cannam@95 142
cannam@95 143 <pre class="example"> extern void fftw_set_timelimit(double seconds);
cannam@95 144 </pre>
cannam@95 145 <p><a name="index-fftw_005fset_005ftimelimit-183"></a>
cannam@95 146 This function instructs FFTW to spend at most <code>seconds</code> seconds
cannam@95 147 (approximately) in the planner. If <code>seconds ==
cannam@95 148 FFTW_NO_TIMELIMIT</code> (the default value, which is negative), then
cannam@95 149 planning time is unbounded. Otherwise, FFTW plans with a
cannam@95 150 progressively wider range of algorithms until the the given time limit
cannam@95 151 is reached or the given range of algorithms is explored, returning the
cannam@95 152 best available plan.
cannam@95 153 <a name="index-FFTW_005fNO_005fTIMELIMIT-184"></a>
cannam@95 154
cannam@95 155 <p>For example, specifying <code>FFTW_PATIENT</code> first plans in
cannam@95 156 <code>FFTW_ESTIMATE</code> mode, then in <code>FFTW_MEASURE</code> mode, then
cannam@95 157 finally (time permitting) in <code>FFTW_PATIENT</code>. If
cannam@95 158 <code>FFTW_EXHAUSTIVE</code> is specified instead, the planner will further
cannam@95 159 progress to <code>FFTW_EXHAUSTIVE</code> mode.
cannam@95 160
cannam@95 161 <p>Note that the <code>seconds</code> argument specifies only a rough limit; in
cannam@95 162 practice, the planner may use somewhat more time if the time limit is
cannam@95 163 reached when the planner is in the middle of an operation that cannot
cannam@95 164 be interrupted. At the very least, the planner will complete planning
cannam@95 165 in <code>FFTW_ESTIMATE</code> mode (which is thus equivalent to a time limit
cannam@95 166 of 0).
cannam@95 167
cannam@95 168 <!-- =========> -->
cannam@95 169 </body></html>
cannam@95 170