Functions | |
| __device__ void | gpuCumulateVec (FLOAT_ARRAY_TYPE *dVec, FLOAT_ARRAY_TYPE *dVecToAdd) |
| Cumulate vector components. | |
| void __global__ | gpuRemoveDriftKernel (int N, FLOAT_ARRAY_TYPE *dVel, FLOAT_ARRAY_TYPE *compSum) |
| System drift removal kernel. | |
| __device__ int | gpuRnd (float b) |
| Round float to integer. | |
| void | removeDrift (int N, int numInterData, int numThreads, int maxThreads, int maxBlocks, FLOAT_ARRAY_TYPE *dVel, FLOAT_ARRAY_TYPE *compSum) |
| Remove system drift. | |
This module contains some basic inline functions for convenient programming.
| __device__ void gpuCumulateVec | ( | FLOAT_ARRAY_TYPE * | dVec, | |
| FLOAT_ARRAY_TYPE * | dVecToAdd | |||
| ) | [inline] |
Cumulate vector components.
| [in,out] | dVec | Cumulative vector |
| [in] | dVecToAdd | Vector to add to /p vec |
Definition at line 111 of file gpu_tools.cuh.
Referenced by gpuLJForces(), gpuLJForcesCut(), gpuLJForcesCutRSmem(), gpuLJForcesCutSmem(), gpuLJForcesCutSmemSmem(), gpuLJForcesCutVar1(), gpuLJForcesSmem(), gpuLJForcesSmemSmem(), and gpuLJForcesVerletList().
| void __global__ gpuRemoveDriftKernel | ( | int | N, | |
| FLOAT_ARRAY_TYPE * | dVel, | |||
| FLOAT_ARRAY_TYPE * | compSum | |||
| ) |
The GPU kernel applies the drift removal factor to all velocities. The kernel is called from removeDrift .
| [in] | N | Number of particles |
| [in,out] | dVel | Velocity array |
| [in] | compSum | component-wise summed velocites |
Definition at line 223 of file gpu_tools.cu.
References FLOAT_ARRAY_TYPE.
| __device__ int gpuRnd | ( | float | b | ) | [inline] |
Given b, the nearest integer is returned.
| [in] | b | Floating point number |
b . Definition at line 98 of file gpu_tools.cuh.
Referenced by gpuDistPBC().
| void removeDrift | ( | int | N, | |
| int | numInterData, | |||
| int | numThreads, | |||
| int | maxThreads, | |||
| int | maxBlocks, | |||
| FLOAT_ARRAY_TYPE * | dVel, | |||
| FLOAT_ARRAY_TYPE * | compSum | |||
| ) |
To ged rid of the system drift, the component-wise total velocity is computed and substracted from the whole system.
| [in] | N | Number of particles |
| [in] | numInterData | Intermediate data size for the reduction |
| [in] | numThreads | Number of threads used for reduction |
| [in] | maxThreads | Maximum number of allowed threads |
| [in] | maxBlocks | Maximum number of allowed blocks |
| [in,out] | dVel | Velocity array |
| [in] | compSum | Helper variable, content will be overwritten |
Definition at line 213 of file gpu_tools.cu.
References checkCudaError(), and componentSumReduction().
Referenced by main().
1.6.1