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

4
#ifndef BIOEM_USE_DOUBLE
5
typedef float myfloat_t;
6 7 8 9
#define myfftw_malloc fftwf_malloc
#define myfftw_free fftwf_free
#define myfftw_destroy_plan fftwf_destroy_plan
#define myfftw_execute fftwf_execute
10
#define myfftw_execute_dft fftwf_execute_dft
11 12 13 14 15 16 17 18
#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
19
#define myfftw_execute_dft fftw_execute_dft
20 21 22 23
#define myfftw_plan_dft_2d fftw_plan_dft_2d
#define myfftw_plan fftw_plan
#endif
typedef myfloat_t mycomplex_t[2];
24 25 26 27 28 29 30 31

#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
32
#define MAX_DISPLACE 224
33 34 35

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

#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