NAMD
GBData.h
Go to the documentation of this file.
1 #ifdef GPUBUF_H
2 #define GPUBUF_H
3 #include "cudaUtils.h"
4 #include "DeviceCUDA.h"
5 
6 /* Nodewide global variable definitions */
7 
8 class GBData(){
9 public:
10  double* _gpos_x;
11  double* _gpos_y;
12  double* _gpos_z;
13 
14  double* _gvel_x;
15  double* _gvel_y;
16  double* _gvel_z;
17 
18  double* _gf_normal_x;
19  double* _gf_normal_y;
20  double* _gf_normal_z;
21 
22  double* _gf_nbond_x;
23  double* _gf_nbond_y;
24  double* _gf_nbond_z;
25 
26  double* _gf_slow_x;
27  double* _gf_slow_y;
28  double* _gf_slow_z;
29 
30  int *offsets;
31  int *peList;
32 
33  GBData(){}
34 
35  GBData(int deviceID, int natoms){
36  cudaCheck(cudaSetDevice(deviceID));
37 
38  // allocates everything here
39  allocate_device<double>(&_gpos_x, natoms);
40  allocate_device<double>(&_gpos_y, natoms);
41  allocate_device<double>(&_gpos_z, natoms);
42  allocate_device<double>(&_gvel_x, natoms);
43  allocate_device<double>(&_gvel_y, natoms);
44  allocate_device<double>(&_gvel_z, natoms);
45 
46  allocate_device<double>(&_gf_normal_x, natoms);
47  allocate_device<double>(&_gf_normal_y, natoms);
48  allocate_device<double>(&_gf_normal_z, natoms);
49 
50  allocate_device<double>(&_gf_nbond_x, natoms);
51  allocate_device<double>(&_gf_nbond_y, natoms);
52  allocate_device<double>(&_gf_nbond_z, natoms);
53 
54  allocate_device<double>(&_gf_slow_x, natoms);
55  allocate_device<double>(&_gf_slow_y, natoms);
56  allocate_device<double>(&_gf_slow_z, natoms);
57  }
58 
59 };
60 
61 #endif
#define cudaCheck(stmt)
Definition: CudaUtils.h:233