NAMD
Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
ComputeBondedCUDAKernel Class Reference

#include <ComputeBondedCUDAKernel.h>

Classes

struct  BondedVirial
 

Public Types

enum  {
  energyIndex_BOND =0, energyIndex_ANGLE, energyIndex_DIHEDRAL, energyIndex_IMPROPER,
  energyIndex_ELECT, energyIndex_LJ, energyIndex_ELECT_SLOW, energyIndex_CROSSTERM,
  energyIndex_BOND_F, energyIndex_BOND_TI_1, energyIndex_BOND_TI_2, energyIndex_ANGLE_F,
  energyIndex_ANGLE_TI_1, energyIndex_ANGLE_TI_2, energyIndex_DIHEDRAL_F, energyIndex_DIHEDRAL_TI_1,
  energyIndex_DIHEDRAL_TI_2, energyIndex_IMPROPER_F, energyIndex_IMPROPER_TI_1, energyIndex_IMPROPER_TI_2,
  energyIndex_ELECT_F, energyIndex_ELECT_TI_1, energyIndex_ELECT_TI_2, energyIndex_LJ_F,
  energyIndex_LJ_TI_1, energyIndex_LJ_TI_2, energyIndex_ELECT_SLOW_F, energyIndex_ELECT_SLOW_TI_1,
  energyIndex_ELECT_SLOW_TI_2, energyIndex_CROSSTERM_F, energyIndex_CROSSTERM_TI_1, energyIndex_CROSSTERM_TI_2,
  normalVirialIndex_XX, normalVirialIndex_XY, normalVirialIndex_XZ, normalVirialIndex_YX,
  normalVirialIndex_YY, normalVirialIndex_YZ, normalVirialIndex_ZX, normalVirialIndex_ZY,
  normalVirialIndex_ZZ, nbondVirialIndex_XX, nbondVirialIndex_XY, nbondVirialIndex_XZ,
  nbondVirialIndex_YX, nbondVirialIndex_YY, nbondVirialIndex_YZ, nbondVirialIndex_ZX,
  nbondVirialIndex_ZY, nbondVirialIndex_ZZ, slowVirialIndex_XX, slowVirialIndex_XY,
  slowVirialIndex_XZ, slowVirialIndex_YX, slowVirialIndex_YY, slowVirialIndex_YZ,
  slowVirialIndex_ZX, slowVirialIndex_ZY, slowVirialIndex_ZZ, amdDiheVirialIndex_XX,
  amdDiheVirialIndex_XY, amdDiheVirialIndex_XZ, amdDiheVirialIndex_YX, amdDiheVirialIndex_YY,
  amdDiheVirialIndex_YZ, amdDiheVirialIndex_ZX, amdDiheVirialIndex_ZY, amdDiheVirialIndex_ZZ,
  energies_virials_SIZE
}
 

Public Member Functions

double * getForces ()
 
 ComputeBondedCUDAKernel (int deviceID, CudaNonbondedTables &cudaNonbondedTables)
 
 ~ComputeBondedCUDAKernel ()
 
void update (const int numBondsIn, const int numAnglesIn, const int numDihedralsIn, const int numImpropersIn, const int numModifiedExclusionsIn, const int numExclusionsIn, const int numCrosstermsIn, const char *h_tupleData, cudaStream_t stream)
 
void setTupleCounts (const TupleCounts count)
 
size_t reallocateTupleBuffer (const TupleCounts countIn, cudaStream_t stream)
 
void updateAtomBuffer (const int atomStorageSize, cudaStream_t stream)
 
TupleCounts getTupleCounts ()
 
TupleData getData ()
 
void setupBondValues (int numBondValues, CudaBondValue *h_bondValues)
 
void setupAngleValues (int numAngleValues, CudaAngleValue *h_angleValues)
 
void setupDihedralValues (int numDihedralValues, CudaDihedralValue *h_dihedralValues)
 
void setupImproperValues (int numImproperValues, CudaDihedralValue *h_improperValues)
 
void setupCrosstermValues (int numCrosstermValues, CudaCrosstermValue *h_crosstermValues)
 
int getForceStride (const int atomStorageSize)
 
int getForceSize (const int atomStorageSize)
 
int getAllForceSize (const int atomStorageSize, const bool doSlow)
 
float4 * getAtomBuffer ()
 
void bondedForce (const double scale14, const int atomStorageSize, const bool doEnergy, const bool doVirial, const bool doSlow, const bool doTable, const float3 lata, const float3 latb, const float3 latc, const float cutoff2, const float r2_delta, const int r2_delta_expc, const CudaNBConstants nbConstants, const float4 *h_xyzq, double *h_forces, double *h_energies, bool atomsChanged, bool CUDASOAintegratorOn, bool useDeviceMigration, cudaStream_t stream)
 
void updateCudaAlchFlags (const CudaAlchFlags &h_cudaAlchFlags)
 
void updateCudaAlchParameters (const CudaAlchParameters *h_cudaAlchParameters, cudaStream_t stream)
 
void updateCudaAlchLambdas (const CudaAlchLambdas *h_cudaAlchLambdas, cudaStream_t stream)
 

Static Public Member Functions

static int warpAlign (const int n)
 

Static Public Attributes

static constexpr float kTupleOveralloc = 1.4f
 

Detailed Description

Definition at line 21 of file ComputeBondedCUDAKernel.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
energyIndex_BOND 
energyIndex_ANGLE 
energyIndex_DIHEDRAL 
energyIndex_IMPROPER 
energyIndex_ELECT 
energyIndex_LJ 
energyIndex_ELECT_SLOW 
energyIndex_CROSSTERM 
energyIndex_BOND_F 
energyIndex_BOND_TI_1 
energyIndex_BOND_TI_2 
energyIndex_ANGLE_F 
energyIndex_ANGLE_TI_1 
energyIndex_ANGLE_TI_2 
energyIndex_DIHEDRAL_F 
energyIndex_DIHEDRAL_TI_1 
energyIndex_DIHEDRAL_TI_2 
energyIndex_IMPROPER_F 
energyIndex_IMPROPER_TI_1 
energyIndex_IMPROPER_TI_2 
energyIndex_ELECT_F 
energyIndex_ELECT_TI_1 
energyIndex_ELECT_TI_2 
energyIndex_LJ_F 
energyIndex_LJ_TI_1 
energyIndex_LJ_TI_2 
energyIndex_ELECT_SLOW_F 
energyIndex_ELECT_SLOW_TI_1 
energyIndex_ELECT_SLOW_TI_2 
energyIndex_CROSSTERM_F 
energyIndex_CROSSTERM_TI_1 
energyIndex_CROSSTERM_TI_2 
normalVirialIndex_XX 
normalVirialIndex_XY 
normalVirialIndex_XZ 
normalVirialIndex_YX 
normalVirialIndex_YY 
normalVirialIndex_YZ 
normalVirialIndex_ZX 
normalVirialIndex_ZY 
normalVirialIndex_ZZ 
nbondVirialIndex_XX 
nbondVirialIndex_XY 
nbondVirialIndex_XZ 
nbondVirialIndex_YX 
nbondVirialIndex_YY 
nbondVirialIndex_YZ 
nbondVirialIndex_ZX 
nbondVirialIndex_ZY 
nbondVirialIndex_ZZ 
slowVirialIndex_XX 
slowVirialIndex_XY 
slowVirialIndex_XZ 
slowVirialIndex_YX 
slowVirialIndex_YY 
slowVirialIndex_YZ 
slowVirialIndex_ZX 
slowVirialIndex_ZY 
slowVirialIndex_ZZ 
amdDiheVirialIndex_XX 
amdDiheVirialIndex_XY 
amdDiheVirialIndex_XZ 
amdDiheVirialIndex_YX 
amdDiheVirialIndex_YY 
amdDiheVirialIndex_YZ 
amdDiheVirialIndex_ZX 
amdDiheVirialIndex_ZY 
amdDiheVirialIndex_ZZ 
energies_virials_SIZE 

Definition at line 25 of file ComputeBondedCUDAKernel.h.

Constructor & Destructor Documentation

◆ ComputeBondedCUDAKernel()

ComputeBondedCUDAKernel::ComputeBondedCUDAKernel ( int  deviceID,
CudaNonbondedTables cudaNonbondedTables 
)

◆ ~ComputeBondedCUDAKernel()

ComputeBondedCUDAKernel::~ComputeBondedCUDAKernel ( )

Member Function Documentation

◆ bondedForce()

void ComputeBondedCUDAKernel::bondedForce ( const double  scale14,
const int  atomStorageSize,
const bool  doEnergy,
const bool  doVirial,
const bool  doSlow,
const bool  doTable,
const float3  lata,
const float3  latb,
const float3  latc,
const float  cutoff2,
const float  r2_delta,
const int  r2_delta_expc,
const CudaNBConstants  nbConstants,
const float4 *  h_xyzq,
double *  h_forces,
double *  h_energies,
bool  atomsChanged,
bool  CUDASOAintegratorOn,
bool  useDeviceMigration,
cudaStream_t  stream 
)

◆ getAllForceSize()

int ComputeBondedCUDAKernel::getAllForceSize ( const int  atomStorageSize,
const bool  doSlow 
)

◆ getAtomBuffer()

float4* ComputeBondedCUDAKernel::getAtomBuffer ( )
inline

Definition at line 176 of file ComputeBondedCUDAKernel.h.

176 { return xyzq;}

◆ getData()

TupleData ComputeBondedCUDAKernel::getData ( )

◆ getForces()

double* ComputeBondedCUDAKernel::getForces ( )
inline

Definition at line 69 of file ComputeBondedCUDAKernel.h.

69  {
70  return forces;
71  }

◆ getForceSize()

int ComputeBondedCUDAKernel::getForceSize ( const int  atomStorageSize)

◆ getForceStride()

int ComputeBondedCUDAKernel::getForceStride ( const int  atomStorageSize)

◆ getTupleCounts()

TupleCounts ComputeBondedCUDAKernel::getTupleCounts ( )

◆ reallocateTupleBuffer()

size_t ComputeBondedCUDAKernel::reallocateTupleBuffer ( const TupleCounts  countIn,
cudaStream_t  stream 
)

◆ setTupleCounts()

void ComputeBondedCUDAKernel::setTupleCounts ( const TupleCounts  count)

◆ setupAngleValues()

void ComputeBondedCUDAKernel::setupAngleValues ( int  numAngleValues,
CudaAngleValue h_angleValues 
)

◆ setupBondValues()

void ComputeBondedCUDAKernel::setupBondValues ( int  numBondValues,
CudaBondValue h_bondValues 
)

◆ setupCrosstermValues()

void ComputeBondedCUDAKernel::setupCrosstermValues ( int  numCrosstermValues,
CudaCrosstermValue h_crosstermValues 
)

◆ setupDihedralValues()

void ComputeBondedCUDAKernel::setupDihedralValues ( int  numDihedralValues,
CudaDihedralValue h_dihedralValues 
)

◆ setupImproperValues()

void ComputeBondedCUDAKernel::setupImproperValues ( int  numImproperValues,
CudaDihedralValue h_improperValues 
)

◆ update()

void ComputeBondedCUDAKernel::update ( const int  numBondsIn,
const int  numAnglesIn,
const int  numDihedralsIn,
const int  numImpropersIn,
const int  numModifiedExclusionsIn,
const int  numExclusionsIn,
const int  numCrosstermsIn,
const char *  h_tupleData,
cudaStream_t  stream 
)

◆ updateAtomBuffer()

void ComputeBondedCUDAKernel::updateAtomBuffer ( const int  atomStorageSize,
cudaStream_t  stream 
)

◆ updateCudaAlchFlags()

void ComputeBondedCUDAKernel::updateCudaAlchFlags ( const CudaAlchFlags h_cudaAlchFlags)

◆ updateCudaAlchLambdas()

void ComputeBondedCUDAKernel::updateCudaAlchLambdas ( const CudaAlchLambdas h_cudaAlchLambdas,
cudaStream_t  stream 
)

◆ updateCudaAlchParameters()

void ComputeBondedCUDAKernel::updateCudaAlchParameters ( const CudaAlchParameters h_cudaAlchParameters,
cudaStream_t  stream 
)

◆ warpAlign()

static int ComputeBondedCUDAKernel::warpAlign ( const int  n)
inlinestatic

Definition at line 142 of file ComputeBondedCUDAKernel.h.

References WARPSIZE.

142 {return ((n + WARPSIZE - 1)/WARPSIZE)*WARPSIZE;}
#define WARPSIZE
Definition: CudaUtils.h:17

Member Data Documentation

◆ kTupleOveralloc

constexpr float ComputeBondedCUDAKernel::kTupleOveralloc = 1.4f
static

Definition at line 141 of file ComputeBondedCUDAKernel.h.


The documentation for this class was generated from the following file: