Basic functions used in MD simulations
[Tools]

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.

Detailed Description

This module contains some basic inline functions for convenient programming.


Function Documentation

__device__ void gpuCumulateVec ( FLOAT_ARRAY_TYPE *  dVec,
FLOAT_ARRAY_TYPE *  dVecToAdd 
) [inline]

Cumulate vector components.

Parameters:
[in,out] dVec Cumulative vector
[in] dVecToAdd Vector to add to /p vec
Returns:
void

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 .

Parameters:
[in] N Number of particles
[in,out] dVel Velocity array
[in] compSum component-wise summed velocites
Returns:
Returns CUDA error information

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.

Parameters:
[in] b Floating point number
Returns:
Returns rounded integer of 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.

Parameters:
[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
Returns:
No return value.

Definition at line 213 of file gpu_tools.cu.

References checkCudaError(), and componentSumReduction().

Referenced by main().

 All Files Functions Defines

Generated on Thu Jun 17 14:22:54 2010 for mdgpu - a molecular dynamic simulation program using GPUs by  doxygen 1.6.1