NAMD
CudaNonbondedTables.h
Go to the documentation of this file.
1 #ifndef CUDANONBONDEDTABLES_H
2 #define CUDANONBONDEDTABLES_H
3 
4 #ifdef NAMD_CUDA
5 #include <cuda.h>
6 
8 private:
9  const int deviceID;
10 
11  float2 *vdwCoefTable;
12  int vdwCoefTableWidth;
13  cudaTextureObject_t vdwCoefTableTex;
14 
15  // Non-bonded
16  cudaArray_t forceArray;
17  cudaTextureObject_t forceTableTex;
18 
19  cudaArray_t energyArray;
20  cudaTextureObject_t energyTableTex;
21 
22  // Modified exclusions
23  cudaArray_t modifiedExclusionForceArray;
24  cudaTextureObject_t modifiedExclusionForceTableTex;
25 
26  cudaArray_t modifiedExclusionEnergyArray;
27  cudaTextureObject_t modifiedExclusionEnergyTableTex;
28 
29  // Exclusions
30  float2 *exclusionVdwCoefTable;
31  cudaTextureObject_t exclusionVdwCoefTableTex;
32 
33  // cudaArray_t exclusionForceArray;
34  // cudaTextureObject_t exclusionForceTableTex;
35 
36  // cudaArray_t exclusionEnergyArray;
37  // cudaTextureObject_t exclusionEnergyTableTex;
38 
39  float4* exclusionTable;
40  float* r2_table;
41  cudaTextureObject_t exclusionTableTex;
42  cudaTextureObject_t r2_table_tex;
43 
44  void buildVdwCoefTable(bool update=false);
45  void buildForceAndEnergyTables(int tableSize);
46 
47 public:
48  CudaNonbondedTables(const int deviceID);
50 
51  float2* getVdwCoefTable() {return vdwCoefTable;}
52  int getVdwCoefTableWidth() {return vdwCoefTableWidth;}
53  cudaTextureObject_t getVdwCoefTableTex() {return vdwCoefTableTex;}
54  cudaTextureObject_t getForceTableTex() {return forceTableTex;}
55  cudaTextureObject_t getEnergyTableTex() {return energyTableTex;}
56 
57  void updateTables();
58 
59  float2* getExclusionVdwCoefTable() {return exclusionVdwCoefTable;}
60  cudaTextureObject_t getExclusionVdwCoefTableTex() {return exclusionVdwCoefTableTex;}
61  // cudaTextureObject_t getExclusionForceTableTex() {return exclusionForceTableTex;}
62  // cudaTextureObject_t getExclusionEnergyTableTex() {return exclusionEnergyTableTex;}
63  float4* getExclusionTable() {return exclusionTable;}
64  float* get_r2_table() {return r2_table;}
65  cudaTextureObject_t getExclusionTableTex() {return exclusionTableTex;}
66  cudaTextureObject_t get_r2_table_tex() {return r2_table_tex;}
67 
68  cudaTextureObject_t getModifiedExclusionForceTableTex() {return modifiedExclusionForceTableTex;}
69  cudaTextureObject_t getModifiedExclusionEnergyTableTex() {return modifiedExclusionEnergyTableTex;}
70 
71 };
72 
73 #endif // NAMD_CUDA
74 #endif // CUDANONBONDEDTABLES_H
cudaTextureObject_t getEnergyTableTex()
cudaTextureObject_t getModifiedExclusionForceTableTex()
cudaTextureObject_t get_r2_table_tex()
cudaTextureObject_t getModifiedExclusionEnergyTableTex()
cudaTextureObject_t getExclusionVdwCoefTableTex()
cudaTextureObject_t getExclusionTableTex()
cudaTextureObject_t getForceTableTex()
cudaTextureObject_t getVdwCoefTableTex()
float2 * getExclusionVdwCoefTable()
CudaNonbondedTables(const int deviceID)