Openholo
v5.0
Open Source Digital Holographic Library
|
Openholo Point Cloud based CGH generation with CUDA GPGPU. More...
Go to the source code of this file.
Classes | |
struct | DMKernelConfig |
Macros | |
#define | __DEBUG_LOG_GPU_SPEC_ |
#define | HANDLE_ERROR(err) (HandleError( err, __FILE__, __LINE__ )) |
#define | HANDLE_NULL(a) |
Typedefs | |
typedef struct DMKernelConfig | DMKernelConfig |
Functions | |
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. More... | |
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. More... | |
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.e. change_depth_quantization == 1 ). More... | |
Openholo Point Cloud based CGH generation with CUDA GPGPU.
Definition in file ophDepthMap_GPU.h.
#define __DEBUG_LOG_GPU_SPEC_ |
Definition at line 58 of file ophDepthMap_GPU.h.
#define HANDLE_ERROR | ( | err | ) | (HandleError( err, __FILE__, __LINE__ )) |
Definition at line 72 of file ophDepthMap_GPU.h.
#define HANDLE_NULL | ( | a | ) |
Definition at line 75 of file ophDepthMap_GPU.h.
typedef struct DMKernelConfig DMKernelConfig |
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.e. change_depth_quantization == 1 ).
Calculate the value of 'depth_index_gpu'.
stream | : CUDA Stream |
pnx | : the number of column of the input data |
pny | : the number of row of the input data |
depth_index_gpu | : output variable |
dimg_src_gpu | : input depth map data |
dtr | : the current working depth level |
d1 | : the starting physical point of each depth level |
d2 | : the ending physical point of each depth level |
params_num_of_depth | : the number of depth level |
params_far_depthmap | : NEAR_OF_DEPTH_MAP at config file |
params_near_depthmap | : FAR_OF_DEPTH_MAP at config file |
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.
call CUDA Kernel - fftShift and CUFFT Library.
stream | : CUDA Stream |
nx | : the number of column of the input data |
ny | : the number of row of the input data |
in_field | : input complex data variable |
output_field | : output complex data variable |
direction | : If direction == -1, forward FFT, if type == 1, inverse FFT. |
call CUDA Kernel - depth_sources_kernel.
stream | : CUDA Stream |
nx | : the number of column of the input data |
ny | : the number of row of the input data |
u_o_gpu_ | : output variable |
img_src_gpu | : input image data |
dimg_src_gpu | : input depth map data |
depth_index_gpu | : input quantized depth map data |
dtr | : current working depth level |
rand_phase_val | : the random phase value |
carrier_phase_delay | : the carrier phase delay |
flag_change_depth_quan | : if true, change the depth quantization from the default value. |
default_depth_quan | : default value of the depth quantization - 256 |
mode | : float/double precision, use fastmath |
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.
The propagation results of all depth levels are accumulated in the variable 'u_complex_gpu_'.
nBlcoks | : the number of blocks |
nThreads | : the number of threads per block |
stream | : CUDA Stream |
nx | : the number of column of the input data |
ny | : the number of row of the input data |
input_d | : input data |
u_complex | : output data |
ppx | : pixel pitch of x-axis |
ppy | : pixel pitch of y-axis |
ssx | : pnx * ppx |
ssy | : pny * ppy |
lambda | : wavelength |
params_k | : 2 * PI / lambda |
propagation_dist | : the distance from the object to the hologram plane |