| version 1.1 | version 1.2 |
|---|
| |
| #define CUDACOMPUTENONBONDEDKERNEL_H | #define CUDACOMPUTENONBONDEDKERNEL_H |
| #include "CudaUtils.h" | #include "CudaUtils.h" |
| #include "CudaTileListKernel.h" | #include "CudaTileListKernel.h" |
| | #include "CudaNonbondedTables.h" |
| #ifdef NAMD_CUDA | #ifdef NAMD_CUDA |
| | |
| class CudaComputeNonbondedKernel { | class CudaComputeNonbondedKernel { |
| private: | private: |
| | |
| const int deviceID; | const int deviceID; |
| | CudaNonbondedTables& cudaNonbondedTables; |
| const bool doStreaming; | const bool doStreaming; |
| | |
| // Force and energy tables | |
| cudaArray_t forceArray; | |
| cudaArray_t energyArray; | |
| | |
| #ifndef DISABLE_CUDA_TEXTURE_OBJECTS | |
| bool forceTableTexActive; | |
| cudaTextureObject_t forceTableTex; | |
| | |
| bool energyTableTexActive; | |
| cudaTextureObject_t energyTableTex; | |
| #endif | |
| | |
| bool vdwCoefTableTextureBound; | |
| #ifdef DISABLE_CUDA_TEXTURE_OBJECTS | |
| bool force_table_bound; | |
| bool energy_table_bound; | |
| #endif | |
| | |
| // Exclusions | // Exclusions |
| unsigned int* overflowExclusions; | unsigned int* overflowExclusions; |
| int overflowExclusionsSize; | int overflowExclusionsSize; |
| |
| int* vdwTypes; | int* vdwTypes; |
| int vdwTypesSize; | int vdwTypesSize; |
| | |
| // VdW Lennard-Jones coefficient table. | |
| float2* vdwCoefTable; | |
| int vdwCoefTableSize; | |
| // Width (and height) of the VdW coeffient table | |
| int vdwCoefTableWidth; | |
| | |
| unsigned int* patchNumCount; | unsigned int* patchNumCount; |
| int patchNumCountSize; | int patchNumCountSize; |
| | |
| |
| int patchReadyQueueSize; | int patchReadyQueueSize; |
| | |
| public: | public: |
| CudaComputeNonbondedKernel(int deviceID, bool doStreaming); | CudaComputeNonbondedKernel(int deviceID, CudaNonbondedTables& cudaNonbondedTables, bool doStreaming); |
| ~CudaComputeNonbondedKernel(); | ~CudaComputeNonbondedKernel(); |
| | |
| void updateVdwTypesExcl(const int atomStorageSize, const int* h_vdwTypes, | void updateVdwTypesExcl(const int atomStorageSize, const int* h_vdwTypes, |
| |
| void nonbondedForce(CudaTileListKernel& tlKernel, | void nonbondedForce(CudaTileListKernel& tlKernel, |
| const int atomStorageSize, const bool doPairlist, | const int atomStorageSize, const bool doPairlist, |
| const bool doEnergy, const bool doVirial, const bool doSlow, | const bool doEnergy, const bool doVirial, const bool doSlow, |
| const float latticeX, const float latticeY, const float latticeZ, | const float3 lata, const float3 latb, const float3 latc, |
| const float4* h_xyzq, const float cutoff2, | const float4* h_xyzq, const float cutoff2, |
| float4* d_forces, float4* d_forcesSlow, | float4* d_forces, float4* d_forcesSlow, |
| float4* h_forces, float4* h_forcesSlow, | float4* h_forces, float4* h_forcesSlow, |
| |
| void getVirialEnergy(VirialEnergy* h_virialEnergy, cudaStream_t stream); | void getVirialEnergy(VirialEnergy* h_virialEnergy, cudaStream_t stream); |
| | |
| void bindExclusions(int numExclusions, unsigned int* exclusion_bits); | void bindExclusions(int numExclusions, unsigned int* exclusion_bits); |
| void bindVdwCoefTable(float2* h_vdwCoefTable, int vdwCoefTableWidthIn); | |
| | |
| #ifndef DISABLE_CUDA_TEXTURE_OBJECTS | |
| void bindTextureObject(int tableSize, float4* h_table, cudaArray_t& array, cudaTextureObject_t& tableTex); | |
| #endif | |
| | |
| void bindForceAndEnergyTable(int tableSize, | |
| float4* h_forceTable, | |
| float4* h_energyTable); | |
| | |
| int* getPatchReadyQueue(); | int* getPatchReadyQueue(); |
| }; | }; |