53 #ifndef __ophDepthMap_GPU_h 54 #define __ophDepthMap_GPU_h 58 #define __DEBUG_LOG_GPU_SPEC_ 61 #include <cuda_runtime_api.h> 63 static void HandleError(cudaError_t err,
66 if (err != cudaSuccess) {
67 printf(
"%s in %s at line %d\n", cudaGetErrorString(err),
72 #define HANDLE_ERROR( err ) (HandleError( err, __FILE__, __LINE__ )) 75 #define HANDLE_NULL( a ) {if (a == NULL) { \ 76 printf( "Host memory failed in %s at line %d\n", \ 77 __FILE__, __LINE__ ); \ 78 exit( EXIT_FAILURE );}} 93 const ivec2& pixel_number,
94 const vec2& pixel_pitch,
101 this->pn_X = pixel_number[
_X];
102 this->pn_Y = pixel_number[
_Y];
105 this->pp_X = pixel_pitch[
_X];
106 this->pp_Y = pixel_pitch[
_Y];
153 void cudaDepthHoloKernel(CUstream_st* stream,
int nx,
int ny, cufftDoubleComplex* u_o_gpu_,
unsigned char* img_src_gpu,
unsigned char* dimg_src_gpu,
Real* depth_index_gpu,
154 int dtr, cuDoubleComplex rand_phase_val, cuDoubleComplex carrier_phase_delay,
int flag_change_depth_quan,
unsigned int default_depth_quan,
const unsigned int& mode);
176 const int& nBlocks,
const int& nThreads, CUstream_st* stream_, cufftDoubleComplex* input_d, cufftDoubleComplex* u_complex,
199 int dtr,
Real d1,
Real d2,
Real params_num_of_depth,
Real params_far_depthmap,
Real params_near_depthmap);
void cudaDepthHoloKernel(CUstream_st *stream, int nx, int ny, cufftDoubleComplex *u_o_gpu_, unsigned char *img_src_gpu, unsigned char *dimg_src_gpu, Real *depth_index_gpu, int dtr, cuDoubleComplex rand_phase_val, cuDoubleComplex carrier_phase_delay, int flag_change_depth_quan, unsigned int default_depth_quan, const unsigned int &mode)
Convert data from the spatial domain to the frequency domain using 2D FFT on GPU. ...
struct DMKernelConfig DMKernelConfig
double ss_Y
(pixel_x * nx) / 2
double lambda
Wave Number = (2 * PI) / lambda;.
double k
(pixel_y * ny) / 2
int pn_Y
Number of pixel of SLM in x direction.
double pp_X
Number of pixel of SLM in y direction.
structure for 2-dimensional integer vector and its arithmetic.
DMKernelConfig(const ivec2 &pixel_number, const vec2 &pixel_pitch, const vec2 &ss, const Real &k, const Real &lambda)
void cudaChangeDepthQuanKernel(CUstream_st *stream_, int pnx, int pny, Real *depth_index_gpu, unsigned char *dimg_src_gpu, int dtr, Real d1, Real d2, Real params_num_of_depth, Real params_far_depthmap, Real params_near_depthmap)
Quantize depth map on the GPU, only when the number of depth quantization is not the default value (i...
double pp_Y
Pixel pitch of SLM in x direction.
structure for 2-dimensional Real type vector and its arithmetic.
void cudaPropagation_AngularSpKernel(const int &nBlocks, const int &nThreads, CUstream_st *stream_, cufftDoubleComplex *input_d, cufftDoubleComplex *u_complex, const DMKernelConfig *cuda_config, Real propagation_dist)
Angular spectrum propagation method for GPU implementation.
double ss_X
Pixel pitch of SLM in y direction.