#include <cuda.h>#include "define.h"#include <iostream>#include <fstream>#include <iomanip>#include <string>#include <sstream>#include <limits>Go to the source code of this file.
| Functions | |
| void | checkCudaError (const char *identifier) | 
| Prints detailed error information of failed cuda functions/kernels. | |
| __host__ __device__ void | checkPBC (FLOAT_ARRAY_TYPE *pos, float *boxSize) | 
| Confine a particle into the simulation box according to the periodic boundary conditions. | |
| void | componentSumReduction (FLOAT_ARRAY_TYPE *dInData, FLOAT_ARRAY_TYPE *dInterData, int numInterData, int numThreads, int N) | 
| Parallel component wise sum procedure. | |
| __global__ void | copyDevToDev (FLOAT_ARRAY_TYPE *dA, FLOAT_ARRAY_TYPE *dB, int N) | 
| Copy an array of vectors on the device. | |
| bool | generateRestartScript (std::string exeName, std::string basename, int dim, int N, int numNN, float T, float k, float boxSize, float dt, int NOffset, int NSim, int NOut, int NAdjust, int gpuDevNo) | 
| Generates a startup script to continue the simulation. | |
| bool | generateScript (std::string scriptname, std::string exeName, std::string inputfile, std::string basename, int dim, int N, int numNN, float T, float k, float boxSize, float dt, int NOffset, int NSim, int NOut, int NAdjust, int gpuDevNo) | 
| Generic startup script generator. | |
| bool | generateStartScript (std::string exeName) | 
| Generates a generic startup script. | |
| float | getHarmonicPotentialEnergy (float *dEpot, FLOAT_ARRAY_TYPE *dPos, float *sum, int *cnn, size_t &pitch, int &N, int &numNN, float &k, float &boxSize, dim3 &dimGrid, dim3 &dimBlock, int &maxThreads, int &maxBlocks) | 
| Calculates total harmonic potential energy. | |
| float | getKineticEnergy (FLOAT_ARRAY_TYPE *dVel, int &N, float *sumSq, int &maxThreads, int &maxBlocks) | 
| Calculates total kinetic energy. | |
| float | getLJCutPotentialEnergy (FLOAT_ARRAY_TYPE *dPos, float *dEpot, float *sum, int &N, float &boxSize, float &rCutSq, dim3 &dimGrid, dim3 &dimBlock, int &maxThreads, int &maxBlocks) | 
| Calculates the total Lennard-Jones energy of the system. | |
| __global__ void | gpuComponentSumReduce1 (FLOAT_ARRAY_TYPE *dInData, FLOAT_ARRAY_TYPE *dInterData, int numInterData, int numThreads, int N) | 
| Kernel for first component wise reduction step. | |
| __global__ void | gpuComponentSumReduce2 (FLOAT_ARRAY_TYPE *dInterData, int numInterData, int numThreads) | 
| Kernel for second component wise reduction step. | |
| __device__ void | gpuCumulateVec (FLOAT_ARRAY_TYPE *dVec, FLOAT_ARRAY_TYPE *dVecToAdd) | 
| Cumulate vector components. | |
| __device__ void | gpuDistPBC (FLOAT_ARRAY_TYPE *dDist, FLOAT_ARRAY_TYPE *dA, FLOAT_ARRAY_TYPE *dB, float *boxSize) | 
| Calculates particle distance according to the nearest image convention. | |
| __global__ void | gpuGenerateVerletList (FLOAT_ARRAY_TYPE *dPos, int *dVlists, size_t pitchDVlists, int *dVcount, float *dmax, float rListSq, int N, float boxSize, bool *doUpdate) | 
| Kernel function to generate Verlet lists for all particles. | |
| __global__ void | gpuGenerateVerletListSmem (FLOAT_ARRAY_TYPE *dPos, int *dVlists, size_t pitchDVlists, int *dVcount, float *dmax, float rListSq, int N, float boxSize, bool *doUpdate) | 
| Kernel function to generate Verlet lists for all particles - using registers and shared memory. | |
| __global__ void | gpuGenerateVerletListSmemVar1 (FLOAT_ARRAY_TYPE *dPos, int *dVlists, size_t pitchDVlists, int *dVcount, float *dmax, float rListSq, int N, float boxSize, bool *doUpdate) | 
| Kernel function to generate Verlet lists for all particles - using shared memory. | |
| __global__ void | gpuGenerateVerletListVar1 (FLOAT_ARRAY_TYPE *dPos, int *dVlists, size_t pitchDVlists, int *dVcount, float *dmax, float rListSq, int N, float boxSize, bool *doUpdate) | 
| Kernel function to generate Verlet lists for all particles - using registers. | |
| __global__ void | gpuGetHarmonicPotentialEnergyKernel (float *dEpot, FLOAT_ARRAY_TYPE *dPos, int *cnn, size_t pitch, int N, int numNN, float k, float boxSize) | 
| Kernel for harmonic potential. | |
| __global__ void | gpuGetVelOnTime (FLOAT_ARRAY_TYPE *dVel, FLOAT_ARRAY_TYPE *dVt, FLOAT_ARRAY_TYPE *dForce, int N, float dt) | 
| Calculates velocities on timestep. | |
| __global__ void | gpuLJCutPotentialEnergyKernel (FLOAT_ARRAY_TYPE *dPos, float *dEpot, int N, float boxSize, float rCutSq) | 
| Calculates Lennard-Jones potential within a certrain cutoff. | |
| __global__ void | gpuReduce1 (float *dInData, float *dInterData, int numInterData, int numThreads, int N) | 
| Kernel for first sum reduction step. | |
| __global__ void | gpuReduce2 (float *dInterData, int numInterData, int numThreads) | 
| Kernel for second rsum eduction step. | |
| void __global__ | gpuRemoveDriftKernel (int N, FLOAT_ARRAY_TYPE *dVel, FLOAT_ARRAY_TYPE *compSum) | 
| System drift removal kernel. | |
| __global__ void | gpuRescaleTKernel (int N, int dim, float T, FLOAT_ARRAY_TYPE *dVel, float *vSumSq) | 
| Temperature rescale kernel function. | |
| __device__ int | gpuRnd (float b) | 
| Round float to integer. | |
| __global__ void | gpuSimpleComponentSum (FLOAT_ARRAY_TYPE *dVal, FLOAT_ARRAY_TYPE *sum, int N) | 
| One thread kernel for summation. | |
| __global__ void | gpuSimpleSqSum (FLOAT_ARRAY_TYPE *dVal, float *sqSum, int N) | 
| One thread kernel for squared summation. | |
| __global__ void | gpuSqSumReduce1 (FLOAT_ARRAY_TYPE *dInData, float *dInterData, int numInterData, int numThreads, int N) | 
| Kernel for first squared reduction step. | |
| bool | memInfo () | 
| Prints GPU memory usage onto the screen. | |
| void | removeDrift (int N, int numInterData, int numThreads, int maxThreads, int maxBlocks, FLOAT_ARRAY_TYPE *dVel, FLOAT_ARRAY_TYPE *compSum) | 
| Remove system drift. | |
| void | rescaleT (int N, int dim, int numInterData, int numThreads, float T, int maxThreads, int maxBlocks, FLOAT_ARRAY_TYPE *dVel, float *sumSq) | 
| Rescale the system temperature. | |
| bool | setCudaDevice (int gpuDevNo) | 
| Set the GPU device. | |
| void | showDeviceArray (FLOAT_ARRAY_TYPE *dArray, int N) | 
| Prints device vector array onto the screen. | |
| void | showForces (FLOAT_ARRAY_TYPE *hForce, int &N) | 
| Prints particle forces onto the screen. | |
| void | showNeareastNeighborList (int *dNNListArray, int &N, int &numNN) | 
| Prints device neareast neighbor list array onto the screen. | |
| void | showPositions (FLOAT_ARRAY_TYPE *hPos, int N) | 
| Prints particle positions onto the screen. | |
| void | showVelocities (FLOAT_ARRAY_TYPE *hVel, int &N) | 
| Prints particle velocities onto the screen. | |
| void | showVerletList (int *dVlists, size_t pitchVlists, int *dVcount, int N, int NList) | 
| Prints device Verlet list array onto the screen. | |
| void | SqVecSumReduction (FLOAT_ARRAY_TYPE *dInData, float *dInterData, int numInterData, int numThreads, int N) | 
| Parallel squared vector sum procedure. | |
| void | sumReduction (float *dInData, float *dInterData, int numInterData, int numThreads, int N) | 
| Parallel summation procedure. | |
mdgpu - a molecular dynamic simulation program using GPUs
 Copyright (C) 2010 Julian P. Engel
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Definition in file gpu_tools.cuh.
 1.6.1
 1.6.1