defs.h 1.53 KB
Newer Older
1
2
3
#ifndef BIOEM_DEFS_H
#define BIOEM_DEFS_H

4
5
//#define BIOEM_USE_DOUBLE

6
#ifndef BIOEM_USE_DOUBLE
7
typedef float myfloat_t;
8
9
10
11
#define myfftw_malloc fftwf_malloc
#define myfftw_free fftwf_free
#define myfftw_destroy_plan fftwf_destroy_plan
#define myfftw_execute fftwf_execute
12
#define myfftw_execute_dft fftwf_execute_dft
13
14
15
16
17
18
19
20
#define myfftw_plan_dft_2d fftwf_plan_dft_2d
#define myfftw_plan fftwf_plan
#else
typedef double myfloat_t;
#define myfftw_malloc fftw_malloc
#define myfftw_free fftw_free
#define myfftw_destroy_plan fftw_destroy_plan
#define myfftw_execute fftw_execute
21
#define myfftw_execute_dft fftw_execute_dft
22
23
24
25
#define myfftw_plan_dft_2d fftw_plan_dft_2d
#define myfftw_plan fftw_plan
#endif
typedef myfloat_t mycomplex_t[2];
26
27
28
29
30
31
32
33

#define BIOEM_FLOAT_3_PHYSICAL_SIZE 3	//Possible set to 4 for GPU
#define BIOEM_MAP_SIZE_X 224
#define BIOEM_MAP_SIZE_Y 224
#define BIOEM_MODEL_SIZE 120000
#define BIOEM_MAX_MAPS 12000
#define MAX_REF_CTF 200
#define MAX_ORIENT 20000
34
#define MAX_DISPLACE 224
35
36
37

struct myfloat3_t
{
38
	myfloat_t pos[BIOEM_FLOAT_3_PHYSICAL_SIZE];
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
};

#ifdef BIOEM_GPUCODE
#define myThreadIdxX threadIdx.x
#define myThreadIdxY threadIdx.y
#define myBlockDimX blockDim.x
#define myBlockDimY blockDim.y
#define myBlockIdxX blockIdx.x
#define myBlockIdxY blockIdx.y
#else
#define __device__
#define __host__
#define myThreadIdxX 0
#define myThreadIdxY 0
#define myBlockDimX 1
#define myBlockDimY 1
#define myBlockIdxX 0
#define myBlockIdxY 0
#endif

#define CUDA_THREAD_COUNT 256
#define CUDA_BLOCK_COUNT 1024 * 16
#define CUDA_MAX_SHIFT_REDUCE 1024

#endif