00001
00002 #ifndef eman__cuda_util_h__
00003 #define eman__cuda_util_h__ 1
00004
00005
00009 void device_init();
00010
00013 struct EMDataForCuda {
00014 float * data;
00015 int nx;
00016 int ny;
00017 int nz;
00018 };
00019
00020 struct CudaPeakInfo {
00021 int px;
00022 int py;
00023 int pz;
00024 float peak;
00025 };
00026
00027 bool copy_to_array(const float * data, cudaArray * array, const int nx, const int ny, const int n, const cudaMemcpyKind memkindz);
00028
00029
00030
00031
00032
00033 cudaArray* get_cuda_array(const int nx, const int ny, const int nz);
00034
00035 void bind_cuda_array_to_textureA( const cudaArray* const array, const int ndims, const bool interp_mode);
00036
00037 void unbind_cuda_textureA(const int ndims);
00038
00039 void bind_cuda_array_to_textureB( const cudaArray* const array, const int ndims, const bool interp_mode);
00040
00041 void unbind_cuda_textureB(const int ndims);
00042
00043 float get_edgemean_cuda(const float* data, const int nx, const int ny, const int nz);
00044
00045 void to_value_cuda(float* data, const float value, const int nx, const int ny, const int nz);
00046
00047 void to_zero_cuda(float* data, const int nx, const int ny, const int nz);
00048
00049 #endif // eman__cuda_util_h__
00050
00051
00052
00053