-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCudaPMEDirectForceBlock.h
67 lines (52 loc) · 1.85 KB
/
CudaPMEDirectForceBlock.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#ifndef CUDAPMEDIRECTFORCEBLOCK_H
#define CUDAPMEDIRECTFORCEBLOCK_H
#include <cuda.h>
#include "CudaPMEDirectForce.h"
#include "CudaBlock.h"
//
// Calculates direct non-bonded interactions on GPU using BLOCK
//
// (c) Antti-Pekka Hynninen, 2014, [email protected]
//
// AT = accumulation type
// CT = calculation type
//
template <typename AT, typename CT>
class CudaPMEDirectForceBlock : public CudaPMEDirectForce<AT,CT> {
private:
CudaBlock &cudaBlock;
// Local (fixed precision versions) force coefficients (size numBlock each)
int biflamLen;
AT *biflam;
int biflam2Len;
AT *biflam2;
// Arrays (size nblock*(nblock+1)/2) for storing temporary results in calc_14_force
// This is the main buffer that contains the actual allocated pointer
double *energy14BlockBuffer;
// These are pointers into the main buffer
double *energyVdw14Block;
double *energyElec14Block;
double *energyExcl14Block;
// Array that contains lower triangle matrix i and j indices (size nblock*(nblock+1)/2)
// lowTriangleIJ = (jb << 16) | ib
int *lowTriangleIJ;
// Block table positions for 1-4 calculations (size nblock*(nblock+1)/2+1)
int *h_in14TblBlockPos;
int *h_ex14TblBlockPos;
public:
CudaPMEDirectForceBlock(CudaEnergyVirial &energyVirial,
const char *nameVdw, const char *nameElec, const char *nameExcl,
CudaBlock &cudaBlock);
~CudaPMEDirectForceBlock();
void set14BlockPos(int *h_in14TblBlockPos_in, int *h_ex14TblBlockPos_in);
void calc_14_force(const float4 *xyzq,
const bool calc_energy, const bool calc_virial,
const int stride, AT *force, cudaStream_t stream=0);
void calc_force(const float4 *xyzq,
const CudaNeighborListBuild<32>& nlist,
const bool calc_energy,
const bool calc_virial,
const int stride, AT *force,
cudaStream_t stream=0);
};
#endif // CUDAPMEDIRECTFORCEBLOCK_H