defs.h 2.05 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
#define myfftw_execute_dft_r2c fftwf_execute_dft_r2c
#define myfftw_execute_dft_c2r fftwf_execute_dft_c2r
15
#define myfftw_plan_dft_2d fftwf_plan_dft_2d
16 17
#define myfftw_plan_dft_r2c_2d fftwf_plan_dft_r2c_2d
#define myfftw_plan_dft_c2r_2d fftwf_plan_dft_c2r_2d
18
#define myfftw_plan fftwf_plan
19 20
#define mycufftExecC2R cufftExecC2R
#define mycuComplex_t cuComplex
21 22 23 24 25 26
#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
27
#define myfftw_execute_dft fftw_execute_dft
28 29
#define myfftw_execute_dft_r2c fftw_execute_dft_r2c
#define myfftw_execute_dft_c2r fftw_execute_dft_c2r
30
#define myfftw_plan_dft_2d fftw_plan_dft_2d
31 32
#define myfftw_plan_dft_r2c_2d fftw_plan_dft_r2c_2d
#define myfftw_plan_dft_c2r_2d fftw_plan_dft_c2r_2d
33
#define myfftw_plan fftw_plan
34 35
#define mycufftExecC2R cufftExecZ2D
#define mycuComplex_t cuDoubleComplex
36 37
#endif
typedef myfloat_t mycomplex_t[2];
38 39 40 41 42

#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
43
#define BIOEM_MAX_MAPS 4000
44 45 46 47
#define MAX_ORIENT 20000

struct myfloat3_t
{
48
	myfloat_t pos[BIOEM_FLOAT_3_PHYSICAL_SIZE];
49 50 51 52 53 54 55 56 57
};

#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
58
#define myGridDimX gridDim.x
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
#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