-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathFFTGPU_Kernels.cuh
70 lines (56 loc) · 1004 Bytes
/
FFTGPU_Kernels.cuh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# pragma once
// Include CUDA runtime and CUFFT
#include <cuda_runtime.h>
#include <cufft.h>
#include <cufftXt.h>
// Helper functions for CUDA
#include <helper_functions.h>
#include <helper_cuda.h>
typedef float2 fComplex;
__constant__ float2 dZero;
__global__ void lowPassFilter(
fComplex *dData,
int fftH,
int fftW,
int imageW,
int imageH,
const size_t sqradius
);
__global__ void highPassFilter(
fComplex *dData,
int fftH,
int fftW,
int imageW,
int imageH,
const size_t sqradius
);
__device__ void cutFrequencies(
fComplex *dData,
int fftH,
int fftW,
int imageW,
int imageH,
const size_t sqradius,
bool(*func)(int, int, size_t)
);
__global__ void fftShift(
fComplex *dData,
int fftH,
int fftW
);
// for cufft callback
struct ImageInfo
{
size_t width;
size_t height;
size_t centerX;
size_t centerY;
};
__device__ void cufftCallbackShift(
void *dataOut,
size_t offset,
cufftComplex element,
void *callerInfo,
void *sharedPointer
);
//#include "kernels.cu"