EMAN2
cuda_util.h
Go to the documentation of this file.
1
2#ifndef eman__cuda_util_h__
3#define eman__cuda_util_h__ 1
4
5//This is the template for the CUDA lock files
6const char* const cudalockfile="/tmp/cuda";
7
8// Various utility functions
13int getCudaDeviceManually(const int deviceCount);
14int getCudaDeviceAuto(const int deviceCount);
15
19 float * data; // Cuda device pointer
20 int nx; // Number of pixels in the x dimension
21 int ny; // Number of pixels in the y dimension
22 int nz; // Number of pixels in the z dimension
23};
24
26 int px;
27 int py;
28 int pz;
29 float peak;
30};
31
33 float xintp;
34 float yintp;
35 float zintp;
36 float peak;
37};
38
39bool copy_to_array(const float * data, cudaArray * array, const int nx, const int ny, const int n, const cudaMemcpyKind memkindz);
40
41//int* calc_max_location_wrap_cuda(const EMDataForCuda* data, const int maxdx, const int maxdy, const int maxdz);
42
43//void cut_slice_cuda_(const EMDataForCuda* data,const float* const);
44
45cudaArray* get_cuda_array(const int nx, const int ny, const int nz);
46
47void bind_cuda_array_to_textureA( const cudaArray* const array, const int ndims, const bool interp_mode);
48
49void unbind_cuda_textureA(const int ndims);
50
51void bind_cuda_array_to_textureB( const cudaArray* const array, const int ndims, const bool interp_mode);
52
53void unbind_cuda_textureB(const int ndims);
54
55float get_edgemean_cuda(const float* data, const int nx, const int ny, const int nz);
56
57void to_value_cuda(float* data, const float value, const int nx, const int ny, const int nz);
58
59void to_zero_cuda(float* data, const int nx, const int ny, const int nz);
60
61#endif // eman__cuda_util_h__
62
63
64
65
float get_edgemean_cuda(const float *data, const int nx, const int ny, const int nz)
bool copy_to_array(const float *data, cudaArray *array, const int nx, const int ny, const int n, const cudaMemcpyKind memkindz)
int getCudaDeviceManually(const int deviceCount)
cudaArray * get_cuda_array(const int nx, const int ny, const int nz)
int device_init()
Initialize the cuda device Can be called any number of times but the actual initialization occurs onl...
void to_zero_cuda(float *data, const int nx, const int ny, const int nz)
void unbind_cuda_textureA(const int ndims)
void bind_cuda_array_to_textureB(const cudaArray *const array, const int ndims, const bool interp_mode)
void to_value_cuda(float *data, const float value, const int nx, const int ny, const int nz)
const char *const cudalockfile
Definition: cuda_util.h:6
void unbind_cuda_textureB(const int ndims)
int getCudaDeviceAuto(const int deviceCount)
void bind_cuda_array_to_textureA(const cudaArray *const array, const int ndims, const bool interp_mode)
float peak
Definition: cuda_util.h:29
A struct for passing EMData objects to and from things like processors.
Definition: cuda_util.h:18
float * data
Definition: cuda_util.h:19