22 #include <lal/LALDatatypes.h>
23 #include <lal/LALMalloc.h>
24 #include <lal/XLALError.h>
25 #include <lal/ComplexFFT.h>
26 #include <lal/FFTWMutex.h>
34 #define UNUSED __attribute__ ((unused))
48 COMPLEX8FFTPlan *plan;
70 if( size == 1 ) createSize = 2;
71 else createSize = size;
72 cufftPlan1d( &plan->plan, createSize, CUFFT_C2C, 1 );
88 plan->sign = ( fwdflg ? -1 : 1 );
96 COMPLEX8FFTPlan *plan;
106 COMPLEX8FFTPlan *plan;
123 cufftDestroy( plan->plan );
127 memset( plan, 0,
sizeof( *plan ) );
135 if ( !
output || ! input || ! plan )
142 if ( !
output->data || ! input->data ||
output->data == input->data )
144 if (
output->length != plan->size || input->length != plan->size )
148 if( plan->size == 1 )
150 output->data[0] = input->data[0];
154 (cufftComplex *)(
output->data), (cufftComplex *)(input->data),
155 (cufftComplex *)plan->d_output, (cufftComplex *)plan->d_input,
156 plan->sign, plan->size );
171 COMPLEX16FFTPlan *plan;
174 int flags = FFTW_UNALIGNED;
181 switch ( measurelvl )
184 flags |= FFTW_ESTIMATE;
187 flags |= FFTW_EXHAUSTIVE;
190 flags |= FFTW_PATIENT;
193 flags |= FFTW_MEASURE;
201 if ( ! plan || ! tmp1 || ! tmp2 )
211 plan->plan = fftw_plan_dft_1d( size,
212 (fftw_complex *)tmp1, (fftw_complex *)tmp2,
213 fwdflg ? FFTW_FORWARD : FFTW_BACKWARD, flags );
230 plan->sign = ( fwdflg ? -1 : 1 );
238 COMPLEX16FFTPlan *plan;
248 COMPLEX16FFTPlan *plan;
265 fftw_destroy_plan( plan->plan );
267 memset( plan, 0,
sizeof( *plan ) );
275 if ( !
output || ! input || ! plan )
282 if ( !
output->data || ! input->data ||
output->data == input->data )
284 if (
output->length != plan->size || input->length != plan->size )
290 (fftw_complex *)input->data,
291 (fftw_complex *)
output->data
COMPLEX8FFTPlan * XLALCreateCOMPLEX8FFTPlan(UINT4 size, int fwdflg, UNUSED int measurelvl)
int cudafft_execute_c2c(cufftHandle plan, cufftComplex *output, const cufftComplex *input, cufftComplex *d_output, cufftComplex *d_input, INT4 direction, UINT4 size)
COMPLEX8 * XLALCudaMallocComplex(UINT4 size)
void XLALCudaFree(void *d_data)
#define LAL_FFTW_WISDOM_UNLOCK
#define LAL_FFTW_WISDOM_LOCK
COMPLEX8FFTPlan * XLALCreateReverseCOMPLEX8FFTPlan(UINT4 size, int measurelvl)
Returns a new COMPLEX8FFTPlan for a reverse transform.
int XLALCOMPLEX8VectorFFT(COMPLEX8Vector *_LAL_RESTRICT_ output, const COMPLEX8Vector *_LAL_RESTRICT_ input, const COMPLEX8FFTPlan *plan)
Perform a COMPLEX8Vector to COMPLEX8Vector FFT.
void XLALDestroyCOMPLEX16FFTPlan(COMPLEX16FFTPlan *plan)
Destroys a COMPLEX16FFTPlan.
COMPLEX8FFTPlan * XLALCreateForwardCOMPLEX8FFTPlan(UINT4 size, int measurelvl)
Returns a new COMPLEX8FFTPlan for a forward transform.
COMPLEX16FFTPlan * XLALCreateForwardCOMPLEX16FFTPlan(UINT4 size, int measurelvl)
Returns a new COMPLEX16FFTPlan for a forward transform.
int XLALCOMPLEX16VectorFFT(COMPLEX16Vector *_LAL_RESTRICT_ output, const COMPLEX16Vector *_LAL_RESTRICT_ input, const COMPLEX16FFTPlan *plan)
Perform a COMPLEX16Vector to COMPLEX16Vector FFT.
void XLALDestroyCOMPLEX8FFTPlan(COMPLEX8FFTPlan *plan)
Destroys a COMPLEX8FFTPlan.
COMPLEX16FFTPlan * XLALCreateCOMPLEX16FFTPlan(UINT4 size, int fwdflg, int measurelvl)
Returns a new COMPLEX16FFTPlan.
COMPLEX16FFTPlan * XLALCreateReverseCOMPLEX16FFTPlan(UINT4 size, int measurelvl)
Returns a new COMPLEX16FFTPlan for a reverse transform.
double complex COMPLEX16
Double-precision floating-point complex number (16 bytes total)
uint32_t UINT4
Four-byte unsigned integer.
#define XLAL_ERROR_VOID(...)
Macro to invoke a failure from a XLAL routine returning void.
#define XLAL_ERROR_NULL(...)
Macro to invoke a failure from a XLAL routine returning a pointer.
#define XLAL_ERROR(...)
Macro to invoke a failure from a XLAL routine returning an integer.
@ XLAL_EBADLEN
Inconsistent or invalid length.
@ XLAL_ENOMEM
Memory allocation error.
@ XLAL_EFAULT
Invalid pointer.
@ XLAL_EFUNC
Internal function call failed bit: "or" this with existing error number.
@ XLAL_EINVAL
Invalid argument.
Vector of type COMPLEX16, see DATATYPE-Vector types for more details.
Vector of type COMPLEX8, see DATATYPE-Vector types for more details.
void output(int gps_sec, int output_type)