33 #ifndef CUDA_UTILS_CUH
34 #define CUDA_UTILS_CUH
59 return threadIdx.x + blockIdx.x * blockDim.x;
71 return blockDim.x * gridDim.x;
121 return make_float2(a.x * b.x, a.y * b.y);
136 return make_float2(a.x * b, a.y * b);
151 return make_float2(b * a.x, b * a.y);
202 return make_float2(a.x + b.x, a.y + b.y);
217 return make_float2(a.x + b, a.y + b);
232 return make_float2(b + a.x, b + a.y);
__device__ float2 operator+(const float2 a, const float2 b)
Operator + for float2 datatype (per element multiplication).
unsigned int nx
size of X dimension.
The header file for the class for storing constants residing in CUDA constant memory.
Structure for CUDA parameters to be placed in constant memory. Only 32b values are used...
unsigned int nxComplex
size of complex X dimension.
__device__ unsigned int GetIndex()
Get global 1D coordinate for 1D CUDA block.
__device__ float2 operator*(const float2 a, const float2 b)
Operator * for float2 datatype (per element multiplication).
__device__ dim3 GetReal3DCoords(const unsigned int i)
Get 3D coordinates for a real matrix form a 1D index.
__device__ void operator+=(float2 &a, const float2 b)
Operator += for float2 datatype (per element multiplication).
__device__ void operator*=(float2 &a, const float2 b)
Operator *= for float2 datatype (per element multiplication).
__device__ unsigned int GetStride()
Get x-stride for 3D CUDA block (for processing multiple grid points by a single thread).
__constant__ TCUDADeviceConstants cudaDeviceConstants
This variable holds basic simulation constants for GPU.
unsigned int nyComplex
size of complex Y dimension.
unsigned int ny
size of Y dimension.
__device__ dim3 GetComplex3DCoords(const unsigned int i)
Get a 3D coordinates for a complex matrix form a 1D index.