NAMD
TupleTypesCUDA.h
Go to the documentation of this file.
1 //
2 // Tuple types that enable fast evaluation on GPU
3 //
4 #ifndef TUPLETYPESCUDA_H
5 #define TUPLETYPESCUDA_H
6 
7 #if defined(NAMD_CUDA) || defined(NAMD_HIP)
8 #ifdef NAMD_CUDA
9 #include <cuda_runtime.h> // float3
10 #endif
11 #ifdef NAMD_HIP
12 #include <hip/hip_runtime.h>
13 #endif
14 struct CudaBond {
15  int i, j, itype;
16  // int ivir;
17  float scale;
18  float3 ioffsetXYZ;
19 };
20 
21 struct CudaAngle {
22  int i, j, k, itype;
23  // int ivir, kvir;
24  float scale;
25  float3 ioffsetXYZ;
26  float3 koffsetXYZ;
27 };
28 
29 struct CudaDihedral {
30  int i, j, k, l, itype;
31  // int ivir, jvir, lvir;
32  float scale;
33  float3 ioffsetXYZ;
34  float3 joffsetXYZ;
35  float3 loffsetXYZ;
36 };
37 
38 struct CudaExclusion {
39  int i, j, vdwtypei, vdwtypej;
40  // int ivir;
41  float3 ioffsetXYZ;
42 };
43 
44 struct CudaCrossterm {
45  int i1, i2, i3, i4, i5, i6, i7, i8, itype;
46  float scale;
47  float3 offset12XYZ;
48  float3 offset23XYZ;
49  float3 offset34XYZ;
50  float3 offset56XYZ;
51  float3 offset67XYZ;
52  float3 offset78XYZ;
53 };
54 
55 struct CudaBondValue {
56  float k; // Force constant for the bond
57  float x0; // Rest distance for the bond
58  float x1; // Upper wall for harmonic wall potential (with x0 lower wall)
59 };
60 
62  float k; // Force constant for angle
63  float theta0; // Rest angle for angle
64  float k_ub; // Urey-Bradley force constant
65  float r_ub; // Urey-Bradley distance
66  int normal; // Whether we use harmonic (0) or cos-based (1) angle terms
67 };
68 
70  float k; // Force constant
71  float delta; // Phase shift
72  int n; // Periodicity*2, if n low bit is set to 0, this is the last in multiplicity
73 };
74 
75 // struct CudaCrosstermData { float d00,d01,d10,d11; };
76 
78  enum {dim=24};
79  float4 c[dim][dim][4]; // bicubic interpolation coefficients
80 };
81 
82 #endif
83 
84 #endif // TUPLETYPESCUDA_H
float scale
float3 offset12XYZ
float3 ioffsetXYZ
float3 offset78XYZ
float3 joffsetXYZ
float3 offset67XYZ
float3 offset23XYZ
float3 koffsetXYZ
float3 ioffsetXYZ
float3 offset56XYZ
float4 c[dim][dim][4]
float3 ioffsetXYZ
float3 loffsetXYZ
float3 offset34XYZ