53 #ifndef __ophPointCloud_GPU_h 54 #define __ophPointCloud_GPU_h 58 #define __DEBUG_LOG_GPU_SPEC_ 61 #include <cuda_runtime_api.h> 62 #include <cuComplex.h> 64 #define __CUDA_INTERNAL_COMPILATION__ //for CUDA Math Module 65 #include <math_constants.h> 67 #include <vector_functions.h> 68 #undef __CUDA_INTERNAL_COMPILATION__ 70 #define OPH_CUDA_N_STREAM 100 71 static void HandleError(cudaError_t err,
74 if (err != cudaSuccess) {
75 printf(
"%s in %s at line %d\n", cudaGetErrorString(err),
80 #define HANDLE_ERROR( err ) (HandleError( err, __FILE__, __LINE__ )) 83 #define HANDLE_NULL( a ) {if (a == NULL) { \ 84 printf( "Host memory failed in %s at line %d\n", \ 85 __FILE__, __LINE__ ); \ 86 exit( EXIT_FAILURE );}} 116 const vec3 &scale_factor,
118 const ivec2 &pixel_number,
120 const vec2 &pixel_pitch,
128 this->scale_X = scale_factor[
_X];
129 this->scale_Y = scale_factor[
_Y];
130 this->scale_Z = scale_factor[
_Z];
134 this->pn_X = pixel_number[
_X];
135 this->pn_Y = pixel_number[
_Y];
138 this->offset_X = offset[
_X];
139 this->offset_Y = offset[
_Y];
142 this->pp_X = pixel_pitch[
_X];
143 this->pp_Y = pixel_pitch[
_Y];
146 this->half_ss_X = ss[
_X] / 2;
147 this->half_ss_Y = ss[
_Y] / 2;
163 const vec3 &scale_factor,
165 const ivec2 &pixel_number,
167 const vec2 &pixel_pitch,
177 this->det_tx =
tx / sqrt(1 -
tx *
tx);
178 this->det_ty =
ty / sqrt(1 -
ty *
ty);
187 this->det_tx =
tx / sqrt(1 -
tx *
tx);
188 this->det_ty =
ty / sqrt(1 -
ty *
ty);
201 const vec3 &scale_factor,
203 const ivec2 &pixel_number,
205 const vec2 &pixel_pitch,
212 this->tx =
lambda / (2 * pixel_pitch[
_X]);
213 this->ty =
lambda / (2 * pixel_pitch[
_Y]);
228 const int& nBlocks,
const int& nThreads,
const int& n_pts_per_stream,
230 cuDoubleComplex* cuda_dst,
235 const int& nBlocks,
const int& nThreads,
const int& n_pts_per_stream,
237 cuDoubleComplex* cuda_dst,
KernelConst_NotEncodedFrsn(GpuConst &cuda_config)
KernelConst_NotEncodedFrsn(const int &n_points, const int &n_streams, const vec3 &scale_factor, const Real &offset_depth, const ivec2 &pixel_number, const ivec2 &offset, const vec2 &pixel_pitch, const vec2 &ss, const Real &k, const Real &lambda)
ty = lambda / (2 * pp_Y)
int offset_X
Number of pixel of SLM in y direction.
double lambda
Wave Number = (2 * PI) / lambda;.
double half_ss_Y
(pixel_x * nx) / 2
struct KernelConst GpuConst
KernelConst_NotEncodedRS(const int &n_points, const int &n_streams, const vec3 &scale_factor, const Real &offset_depth, const ivec2 &pixel_number, const ivec2 &offset, const vec2 &pixel_pitch, const vec2 &ss, const Real &k, const Real &lambda)
ty / sqrt(1 - ty^2), ty = lambda / (2 * pp_Y)
double pp_Y
Pixel pitch of SLM in x direction.
KernelConst_NotEncodedRS(GpuConst &cuda_config)
double offset_depth
Scaling factor of z coordinate of point cloud.
structure for 2-dimensional integer vector and its arithmetic.
double det_ty
tx / sqrt(1 - tx^2), tx = lambda / (2 * pp_X)
void cudaPointCloud_RS(const int &nBlocks, const int &nThreads, const int &n_pts_per_stream, Vertex *cuda_vertex_data, cuDoubleComplex *cuda_dst, const GpuConstNERS *cuda_config, const uint &iChannel, const uint &mode)
double pp_X
Number of pixel of SLM in y direction.
double scale_Y
Scaling factor of x coordinate of point cloud.
KernelConst(const int &n_points, const int &n_streams, const vec3 &scale_factor, const Real &offset_depth, const ivec2 &pixel_number, const ivec2 &offset, const vec2 &pixel_pitch, const vec2 &ss, const Real &k, const Real &lambda)
KernelConst_NotEncodedFrsn GpuConstNEFR
double scale_Z
Scaling factor of y coordinate of point cloud.
KernelConst_NotEncodedRS GpuConstNERS
double half_ss_X
Pixel pitch of SLM in y direction.
structure for 2-dimensional Real type vector and its arithmetic.
int n_streams
number of point cloud
int pn_X
Offset value of point cloud in z direction.
structure for 3-dimensional Real type vector and its arithmetic.
double scale_X
number of streams
int pn_Y
Number of pixel of SLM in x direction.
void cudaPointCloud_Fresnel(const int &nBlocks, const int &nThreads, const int &n_pts_per_stream, Vertex *cuda_vertex_data, cuDoubleComplex *cuda_dst, const GpuConstNEFR *cuda_config, const uint &iChannel, const uint &mode)
double k
(pixel_y * ny) / 2
double ty
tx = lambda / (2 * pp_X)