LAL  7.5.0.1-ec27e42
IntelRealFFT.c
Go to the documentation of this file.
1 /*
2 * Copyright (C) 2007 Jolien Creighton, Kipp Cannon, Josh Willis, Duncan Brown
3 * (C) 2014 Larne Pekowsky
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with with program; see the file COPYING. If not, write to the
17 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18 * MA 02110-1301 USA
19 */
20 
21 #include <config.h>
22 
23 #include <complex.h>
24 #include <mkl_dfti.h>
25 
26 #include <lal/SeqFactories.h>
27 #include <lal/RealFFT.h>
28 #include <lal/LALMalloc.h>
29 #include <lal/XLALError.h>
30 
31 /** \cond DONT_DOXYGEN */
32 
33 
34 #define CHECKINTELFFTSTATUS( fstat ) \
35  if ( (fstat) != DFTI_NO_ERROR ) \
36  { \
37  char *errmsg = DftiErrorMessage( fftStat ); \
38  XLAL_ERROR( REALFFTH_EINTL, "%s", errmsg ); \
39  } \
40  else (void)(0)
41 
42 #define CHECKINTELFFTSTATUS_NULL( fstat ) \
43  if ( (fstat) != DFTI_NO_ERROR ) \
44  { \
45  char *errmsg = DftiErrorMessage( fftStat ); \
46  XLAL_ERROR_NULL( REALFFTH_EINTL, "%s", errmsg ); \
47  } \
48  else (void)(0)
49 
50 #define CHECKINTELFFTSTATUS_VOID( fstat ) \
51  if ( (fstat) != DFTI_NO_ERROR ) \
52  { \
53  char *errmsg = DftiErrorMessage( fftStat ); \
54  XLAL_ERROR_VOID( REALFFTH_EINTL, "%s", errmsg ); \
55  } \
56  else (void)(0)
57 
58 /*
59  * Plan to perform FFT of REAL4 data.
60  */
61 struct
63 {
64  INT4 sign; /* sign in transform exponential, -1 for forward, +1 for reverse */
65  UINT4 size; /* length of the real data vector for this plan */
66  DFTI_DESCRIPTOR *plan; /* the MKL plan */
67  REAL4 *tmp;
68 };
69 
70 /*
71  * Plan to perform FFT of REAL8 data.
72  */
73 struct
75 {
76  INT4 sign; /* sign in transform exponential, -1 for forward, +1 for reverse */
77  UINT4 size; /* length of the real data vector for this plan */
78  DFTI_DESCRIPTOR *plan; /* the MKL plan */
79  REAL8 *tmp;
80 };
81 
82 
83 
84 /* single- and double-precision routines */
85 
86 #define SINGLE_PRECISION
87 #include "IntelRealFFT_source.c"
88 #undef SINGLE_PRECISION
89 #include "IntelRealFFT_source.c"
90 
91 
92 /** \endcond */
static int sign(int s)
Definition: LALStringTest.c:27
double REAL8
Double precision real floating-point number (8 bytes).
uint32_t UINT4
Four-byte unsigned integer.
int32_t INT4
Four-byte signed integer.
float REAL4
Single precision real floating-point number (4 bytes).
Plan to perform FFT of REAL4 data.
Definition: CudaRealFFT.c:40
Plan to perform FFT of REAL8 data.
Definition: CudaRealFFT.c:50