comparison Lib/fftw-3.2.1/doc/html/.svn/text-base/SIMD-alignment-and-fftw_005fmalloc.html.svn-base @ 0:25bf17994ef1

First commit. VS2013, Codeblocks and Mac OSX configuration
author Geogaddi\David <d.m.ronan@qmul.ac.uk>
date Thu, 09 Jul 2015 01:12:16 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:25bf17994ef1
1 <html lang="en">
2 <head>
3 <title>SIMD alignment and fftw_malloc - FFTW 3.2.1</title>
4 <meta http-equiv="Content-Type" content="text/html">
5 <meta name="description" content="FFTW 3.2.1">
6 <meta name="generator" content="makeinfo 4.8">
7 <link title="Top" rel="start" href="index.html#Top">
8 <link rel="up" href="Data-Alignment.html#Data-Alignment" title="Data Alignment">
9 <link rel="prev" href="Data-Alignment.html#Data-Alignment" title="Data Alignment">
10 <link rel="next" href="Stack-alignment-on-x86.html#Stack-alignment-on-x86" title="Stack alignment on x86">
11 <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
12 <!--
13 This manual is for FFTW
14 (version 3.2.1, 5 February 2009).
15
16 Copyright (C) 2003 Matteo Frigo.
17
18 Copyright (C) 2003 Massachusetts Institute of Technology.
19
20 Permission is granted to make and distribute verbatim copies of
21 this manual provided the copyright notice and this permission
22 notice are preserved on all copies.
23
24 Permission is granted to copy and distribute modified versions of
25 this manual under the conditions for verbatim copying, provided
26 that the entire resulting derived work is distributed under the
27 terms of a permission notice identical to this one.
28
29 Permission is granted to copy and distribute translations of this
30 manual into another language, under the above conditions for
31 modified versions, except that this permission notice may be
32 stated in a translation approved by the Free Software Foundation.
33 -->
34 <meta http-equiv="Content-Style-Type" content="text/css">
35 <style type="text/css"><!--
36 pre.display { font-family:inherit }
37 pre.format { font-family:inherit }
38 pre.smalldisplay { font-family:inherit; font-size:smaller }
39 pre.smallformat { font-family:inherit; font-size:smaller }
40 pre.smallexample { font-size:smaller }
41 pre.smalllisp { font-size:smaller }
42 span.sc { font-variant:small-caps }
43 span.roman { font-family:serif; font-weight:normal; }
44 span.sansserif { font-family:sans-serif; font-weight:normal; }
45 --></style>
46 </head>
47 <body>
48 <div class="node">
49 <p>
50 <a name="SIMD-alignment-and-fftw_malloc"></a>
51 <a name="SIMD-alignment-and-fftw_005fmalloc"></a>
52 Next:&nbsp;<a rel="next" accesskey="n" href="Stack-alignment-on-x86.html#Stack-alignment-on-x86">Stack alignment on x86</a>,
53 Previous:&nbsp;<a rel="previous" accesskey="p" href="Data-Alignment.html#Data-Alignment">Data Alignment</a>,
54 Up:&nbsp;<a rel="up" accesskey="u" href="Data-Alignment.html#Data-Alignment">Data Alignment</a>
55 <hr>
56 </div>
57
58 <h4 class="subsection">3.1.1 SIMD alignment and fftw_malloc</h4>
59
60 <p>SIMD, which stands for &ldquo;Single Instruction Multiple Data,&rdquo; is a set of
61 special operations supported by some processors to perform a single
62 operation on several numbers (usually 2 or 4) simultaneously. SIMD
63 floating-point instructions are available on several popular CPUs:
64 SSE/SSE2 (single/double precision) on Pentium III and higher and on
65 AMD64, AltiVec (single precision) on some PowerPCs (Apple G4 and
66 higher), and MIPS Paired Single. FFTW can be compiled to support the
67 SIMD instructions on any of these systems.
68 <a name="index-SIMD-102"></a><a name="index-SSE-103"></a><a name="index-SSE2-104"></a><a name="index-AltiVec-105"></a><a name="index-MIPS-PS-106"></a><a name="index-precision-107"></a>
69 A program linking to an FFTW library compiled with SIMD support can
70 obtain a nonnegligible speedup for most complex and r2c/c2r
71 transforms. In order to obtain this speedup, however, the arrays of
72 complex (or real) data passed to FFTW must be specially aligned in
73 memory (typically 16-byte aligned), and often this alignment is more
74 stringent than that provided by the usual <code>malloc</code> (etc.)
75 allocation routines.
76
77 <p><a name="index-portability-108"></a>In order to guarantee proper alignment for SIMD, therefore, in case
78 your program is ever linked against a SIMD-using FFTW, we recommend
79 allocating your transform data with <code>fftw_malloc</code> and
80 de-allocating it with <code>fftw_free</code>.
81 <a name="index-fftw_005fmalloc-109"></a><a name="index-fftw_005ffree-110"></a>These have exactly the same interface and behavior as
82 <code>malloc</code>/<code>free</code>, except that for a SIMD FFTW they ensure
83 that the returned pointer has the necessary alignment (by calling
84 <code>memalign</code> or its equivalent on your OS).
85
86 <p>You are not <em>required</em> to use <code>fftw_malloc</code>. You can
87 allocate your data in any way that you like, from <code>malloc</code> to
88 <code>new</code> (in C++) to a fixed-size array declaration. If the array
89 happens not to be properly aligned, FFTW will not use the SIMD
90 extensions.
91 <a name="index-C_002b_002b-111"></a>
92 <!-- =========> -->
93
94 </body></html>
95