51 #include <cuda_runtime_api.h> 54 #define __CUDA_INTERNAL_COMPILATION__ //for CUDA Math Module 55 #include <math_constants.h> 57 #include <vector_functions.h> 58 #undef __CUDA_INTERNAL_COMPILATION__ 60 static void HandleError(cudaError_t err,
63 if (err != cudaSuccess) {
64 printf(
"%s in %s at line %d\n", cudaGetErrorString(err),
69 #define HANDLE_ERROR( err ) (HandleError( err, __FILE__, __LINE__ )) 72 #define HANDLE_NULL( a ) {if (a == NULL) { \ 73 printf( "Host memory failed in %s at line %d\n", \ 74 __FILE__, __LINE__ ); \ 75 exit( EXIT_FAILURE );}} 114 const Real &propagation_distance,
117 const bool &random_phase
133 this->distance = propagation_distance;
141 this->bRandomPhase = random_phase;
143 this->pi2 =
M_PI * 2;
164 const int &nBlocks,
const int &nThreads,
const int &nx,
const int &ny,
165 cuDoubleComplex *src, cuDoubleComplex *dst,
Real *encode,
const RecGpuConst* cuda_config);
int pnY
Number of pixel of SLM in x direction.
bool bRandomPhase
wave length = lambda;
double lambda
Wave Number = (2 * PI) / lambda;.
KernelConst(const int &channel, const int &n_streams, const int &pnX, const int &pnY, const Real &ppX, const Real &ppY, const Real &propagation_distance, const Real &k, const Real &lambda, const bool &random_phase)
struct KernelConst RecGpuConst
Real distance
number of streams
void cudaASMPropagation(const int &nBlocks, const int &nThreads, const int &nx, const int &ny, cuDoubleComplex *src, cuDoubleComplex *dst, Real *encode, const RecGpuConst *cuda_config)
double ppY
Pixel pitch of SLM in x direction.
double ppX
Number of pixel of SLM in y direction.
int n_streams
number of colors per point cloud
double k
Pixel pitch of SLM in y direction.