HologramDepthmap Library
Macros | Functions | Variables
HologramGenerator_GPU.cpp File Reference
#include "Hologram/HologramGenerator.h"
#include "graphics/sys.h"
#include <cuda_runtime.h>
#include <cufft.h>

Go to the source code of this file.

Macros

#define HANDLE_ERROR(err)   (HandleError( err, __FILE__, __LINE__ ))
 
#define HANDLE_NULL(a)
 

Functions

static void HandleError (cudaError_t err, const char *file, int line)
 
void cudaFFT (CUstream_st *stream, int nx, int ny, cufftDoubleComplex *in_filed, cufftDoubleComplex *output_field, int direction, bool bNormailized=false)
 Convert data from the spatial domain to the frequency domain using 2D FFT on GPU. More...
 
void cudaCropFringe (CUstream_st *stream, int nx, int ny, cufftDoubleComplex *in_field, cufftDoubleComplex *out_field, int cropx1, int cropx2, int cropy1, int cropy2)
 Crop input data according to x, y coordinates on GPU. More...
 
void cudaDepthHoloKernel (CUstream_st *stream, int pnx, int pny, cufftDoubleComplex *u_o_gpu_, unsigned char *img_src_gpu_, unsigned char *dimg_src_gpu_, double *depth_index_gpu_, int dtr, double rand_phase_val_a, double rand_phase_val_b, double carrier_phase_delay_a, double carrier_phase_delay_b, int flag_change_depth_quan, unsigned int default_depth_quan)
 Find each depth plane of the input image and apply carrier phase delay to it on GPU. More...
 
void cudaPropagation_AngularSpKernel (CUstream_st *stream_, int pnx, int pny, cufftDoubleComplex *input_d, cufftDoubleComplex *u_complex, double ppx, double ppy, double ssx, double ssy, double lambda, double params_k, double propagation_dist)
 Angular spectrum propagation method for GPU implementation. More...
 
void cudaGetFringe (CUstream_st *stream, int pnx, int pny, cufftDoubleComplex *in_field, cufftDoubleComplex *out_field, int sig_locationx, int sig_locationy, double ssx, double ssy, double ppx, double ppy, double PI)
 Encode the CGH according to a signal location parameter on the GPU. More...
 
void cudaChangeDepthQuanKernel (CUstream_st *stream_, int pnx, int pny, double *depth_index_gpu, unsigned char *dimg_src_gpu, int dtr, double d1, double d2, double params_num_of_depth, double params_far_depthmap, double params_near_depthmap)
 Quantize depth map on the GPU, only when the number of depth quantization is not the default value (i.e. FLAG_CHANGE_DEPTH_QUANTIZATION == 1 ). More...
 

Variables

cufftDoubleComplex * u_o_gpu_
 
cufftDoubleComplex * u_complex_gpu_
 
cufftDoubleComplex * k_temp_d_
 
cudaStream_t stream_
 
cudaEvent_t start
 
cudaEvent_t stop
 

Macro Definition Documentation

◆ HANDLE_ERROR

#define HANDLE_ERROR (   err)    (HandleError( err, __FILE__, __LINE__ ))

Definition at line 16 of file HologramGenerator_GPU.cpp.

◆ HANDLE_NULL

#define HANDLE_NULL (   a)
Value:
{if (a == NULL) { \
printf( "Host memory failed in %s at line %d\n", \
__FILE__, __LINE__ ); \
exit( EXIT_FAILURE );}}

Definition at line 19 of file HologramGenerator_GPU.cpp.

Function Documentation

◆ HandleError()

static void HandleError ( cudaError_t  err,
const char *  file,
int  line 
)
static

Definition at line 7 of file HologramGenerator_GPU.cpp.

Variable Documentation

◆ k_temp_d_

cufftDoubleComplex* k_temp_d_

Definition at line 26 of file HologramGenerator_GPU.cpp.

◆ start

cudaEvent_t start

Definition at line 29 of file HologramGenerator_GPU.cpp.

◆ stop

cudaEvent_t stop

Definition at line 29 of file HologramGenerator_GPU.cpp.

◆ stream_

cudaStream_t stream_

Definition at line 28 of file HologramGenerator_GPU.cpp.

◆ u_complex_gpu_

cufftDoubleComplex* u_complex_gpu_

Definition at line 25 of file HologramGenerator_GPU.cpp.

◆ u_o_gpu_

cufftDoubleComplex* u_o_gpu_

Definition at line 24 of file HologramGenerator_GPU.cpp.