COMPASS  5.0.0
End-to-end AO simulation tool using GPU acceleration
convolutionFFT2D_common.h
1 /*
2  * Copyright 1993-2010 NVIDIA Corporation. All rights reserved.
3  *
4  * Please refer to the NVIDIA end user license agreement (EULA) associated
5  * with this source code for terms and conditions that govern your use of
6  * this software. Any use, reproduction, disclosure, or distribution of
7  * this software and related documentation outside the terms of the EULA
8  * is strictly prohibited.
9  *
10  */
11 
12 #ifndef CONVOLUTIONFFT2D_COMMON_H
13 #define CONVOLUTIONFFT2D_COMMON_H
14 
15 typedef unsigned int uint;
16 
17 #ifdef __CUDACC__
18 typedef float2 fComplex;
19 #else
20 typedef struct {
21  float x;
22  float y;
23 } fComplex;
24 #endif
25 
27 // Helper functions
29 // Round a / b to nearest higher integer value
30 inline int i_div_up(int a, int b) { return (a % b != 0) ? (a / b + 1) : (a / b); }
31 
32 // Align a to nearest higher multiple of b
33 inline int i_align_up(int a, int b) { return (a % b != 0) ? (a - a % b + b) : a; }
34 
35 extern "C" {
36 
37 void pad_kernel(float *d_PaddedKernel, float *d_Kernel, int fftH, int fftW,
38  int kernelH, int kernelW, int kernelY, int kernelX);
39 
40 void pad_kernel_3d(float *d_PaddedKernel, float *d_Kernel, int fftH, int fftW,
41  int kernelH, int kernelW, int kernelY, int kernelX, int nim);
42 
43 void pad_data_clamp_to_border(float *d_PaddedData, float *d_Data, int fftH,
44  int fftW, int dataH, int dataW, int kernelH,
45  int kernelW, int kernelY, int kernelX);
46 
47 void pad_data_clamp_to_border_3d(float *d_PaddedData, float *d_Data, int fftH,
48  int fftW, int dataH, int dataW, int kernelH,
49  int kernelW, int kernelY, int kernelX, int nim);
50 
51 void modulate_and_normalize(fComplex *d_Dst, fComplex *d_Src, int fftH, int fftW,
52  int padding, int nim);
53 
54 void sp_postprocess_2d(void *d_Dst, void *d_Src, uint DY, uint DX, uint padding,
55  int dir);
56 
57 void sp_preprocess_2d(void *d_Dst, void *d_Src, uint DY, uint DX, uint padding,
58  int dir);
59 
60 void sp_process_2d(void *d_Data, void *d_Data0, void *d_Kernel0, uint DY, uint DX,
61  int dir);
62 }
63 #endif // CONVOLUTIONFFT2D_COMMON_H
fComplex
Definition: convolutionFFT2D_common.h:20
fComplex::x
float x
Definition: convolutionFFT2D_common.h:21
fComplex::y
float y
Definition: convolutionFFT2D_common.h:22
test_rtc_standalone.a
a
Definition: test_rtc_standalone.py:69