NAMD
ComputeNonbondedCUDA.h
Go to the documentation of this file.
1 #ifndef COMPUTENONBONDEDCUDA_H
2 #define COMPUTENONBONDEDCUDA_H
3 #include "ComputeNonbondedUtil.h"
4 #include "ComputeHomeTuples.h"
5 
6 class ComputeMgr;
7 
8 //class ComputeNonbondedCUDAKernel;
9 
10 class FinishWorkMsg;
11 
12 // WORKAROUND-HIP: vector types are "using", not struct, and cannot be forward-declared
13 #ifdef NAMD_HIP
14 #include <hip/hip_vector_types.h>
15 #else
16 class float4;
17 #endif
18 
19 int cuda_device_pe();
20 
21 bool cuda_device_shared_with_pe(int pe);
22 
24 
26 
27  public:
28 
29  struct compute_record {
33  };
34 
35  struct patch_record {
38  int numAtoms;
40  int refCount;
41  int isLocal;
45  int hostPe;
49  Patch *p;
52  Box<Patch,Real> *intRadBox; //5 GBIS Boxes
60  Force *f;
61  Real *intRad; //5 GBIS arrays
66 
68  };
69 
70 
72  ComputeNonbondedCUDA *m = 0, int idx = -1);
74 
75  void atomUpdate();
76  void doWork();
77  int noWork();
78  void skip();
79 
80  void recvYieldDevice(int pe);
82 
86  int step;
87  int finishWork(); // returns true when finished, false to continue
88  void finishReductions();
89  void finishPatch(int);
90  void messageFinishPatch(int);
91 
92  static void build_lj_table();
93  static void build_force_table();
94 
95  static void build_exclusions();
96 
97  void requirePatch(int pid);
98  void assignPatches();
99  void registerPatches();
105 
107  float4* forces;
108 
110  float4* slow_forces;
111 
114 
117 
118  //int gpu_is_mine;
119 
120  // GPU device ID that this non-bonded computation uses
121  int deviceID;
122 
126 
127  //ComputeNonbondedCUDAKernel *kernel;
128 
130  int masterPe;
133  int *slavePes;
135 
139 
144  float plcutoff2;
145 
148 
149  private:
150  void finishPatch(patch_record&);
151 
152 };
153 
154 #endif //COMPUTENONBONDEDCUDA_H
ResizeArray< int > remoteHostedPatches
ResizeArray< int > localActivePatches
ResizeArray< compute_record > computeRecords
int ComputeID
Definition: NamdTypes.h:183
int cuda_device_pe()
Definition: Vector.h:64
bool cuda_device_shared_with_pe(int pe)
float Real
Definition: common.h:109
SubmitReduction * reduction
Definition: Patch.h:35
bool one_cuda_device_per_node()
ComputeNonbondedCUDA ** slaves
ResizeArray< int > remoteActivePatches
int PatchID
Definition: NamdTypes.h:182
ComputeNonbondedCUDA * master
ResizeArray< compute_record > localComputeRecords
ResizeArray< compute_record > remoteComputeRecords
LocalWorkMsg * localWorkMsg2
ResizeArray< int > hostedPatches
ComputeNonbondedCUDA(ComputeID c, ComputeMgr *mgr, ComputeNonbondedCUDA *m=0, int idx=-1)
ResizeArray< int > activePatches
ResizeArray< int > localHostedPatches
ResizeArray< patch_record > patchRecords
Box< Patch, CompAtom > * positionBox
float GBReal
Definition: ComputeGBIS.inl:17