"platforms/cuda-old/src/kernels/kForces.cu" did not exist on "5196c351f6c4b93970604e6180f8e94fc1f420d6"
GpuFreeEnergyCudaKernels.h 7.17 KB
Newer Older
Mark Friedrichs's avatar
Mark Friedrichs committed
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
#ifndef __GPU_FREE_ENERGY_KERNELS_H__
#define __GPU_FREE_ENERGY_KERNELS_H__

/* -------------------------------------------------------------------------- *
 *                                   OpenMM                                   *
 * -------------------------------------------------------------------------- *
 * This is part of the OpenMM molecular simulation toolkit originating from   *
 * Simbios, the NIH National Center for Physics-Based Simulation of           *
 * Biological Structures at Stanford, funded under the NIH Roadmap for        *
 * Medical Research, grant U54 GM072970. See https://simtk.org.               *
 *                                                                            *
 * Portions copyright (c) 2009 Stanford University and the Authors.           *
 * Authors: Scott Le Grand, Peter Eastman                                     *
 * Contributors:                                                              *
 *                                                                            *
 * This program is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU Lesser General Public License as published   *
 * by the Free Software Foundation, either version 3 of the License, or       *
 * (at your option) any later version.                                        *
 *                                                                            *
 * This program is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              *
 * GNU Lesser General Public License for more details.                        *
 *                                                                            *
 * You should have received a copy of the GNU Lesser General Public License   *
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.      *
 * -------------------------------------------------------------------------- */

#include "gputypes.h"
31
#include "freeEnergyGpuTypes.h"
Mark Friedrichs's avatar
Mark Friedrichs committed
32
33
#include "cudatypes.h"
#include <vector>
Mark Friedrichs's avatar
Mark Friedrichs committed
34
#include <cuda.h>
Mark Friedrichs's avatar
Mark Friedrichs committed
35
36
37
38
39
40
41
42

// Function prototypes

// CDLJ softcore

// setup methods called from CudaFreeEnergyKernels
// nonbonded and 1-4 ixns

43
extern "C" bool gpuIsAvailableSoftcore();
44

45
extern "C" void freeEnergyGpuSetPeriodicBoxSize( freeEnergyGpuContext gpu, float xsize, float ysize, float zsize);
Mark Friedrichs's avatar
Mark Friedrichs committed
46

47
48
49
50
51
extern "C" void gpuSetNonbondedSoftcoreParameters( freeEnergyGpuContext gpu, float epsfac, const std::vector<int>& atom, const std::vector<float>& c6,
                                                   const std::vector<float>& c12, const std::vector<float>& q,
                                                   const std::vector<float>& softcoreLJLambdaArray, const std::vector<char>& symbol,
                                                   const std::vector<std::vector<int> >& exclusions, CudaFreeEnergyNonbondedMethod method,
                                                   float cutoffDistance, float reactionFieldDielectric);
Mark Friedrichs's avatar
Mark Friedrichs committed
52

53
54
55
extern "C" void gpuSetLJ14SoftcoreParameters( freeEnergyGpuContext gpu, float epsfac, const std::vector<int>& atom1,
                                              const std::vector<int>& atom2, const std::vector<float>& c6, const std::vector<float>& c12,
                                              const std::vector<float>& qProd, const std::vector<float>& softcoreLJLambdaArray);
Mark Friedrichs's avatar
Mark Friedrichs committed
56
57
58

// write address's to device

59
extern "C" void SetCalculateCDLJSoftcoreGpuSim( freeEnergyGpuContext gpu );
Mark Friedrichs's avatar
Mark Friedrichs committed
60

61
extern "C" void SetCalculateLocalSoftcoreGpuSim( freeEnergyGpuContext gpu );
Mark Friedrichs's avatar
Mark Friedrichs committed
62
63
64

// kernel calls to device

65
extern "C" void kCalculateCDLJSoftcoreForces( freeEnergyGpuContext gpu );
Mark Friedrichs's avatar
Mark Friedrichs committed
66

67
extern "C" void kCalculateLocalSoftcoreForces( freeEnergyGpuContext gpu );
Mark Friedrichs's avatar
Mark Friedrichs committed
68
69
70
71
72

// GB/VI softcore

// setup method called from CudaFreeEnergyKernels

73
extern "C" void gpuSetGBVISoftcoreParameters( freeEnergyGpuContext gpu, float innerDielectric, float solventDielectric, const std::vector<int>& atom, const std::vector<float>& radius, 
Mark Friedrichs's avatar
Mark Friedrichs committed
74
75
76
77
78
                                              const std::vector<float>& gamma, const std::vector<float>& scaledRadii,
                                              const std::vector<float>& bornRadiusScaleFactors, const std::vector<float>& quinticSplineParameters);

// write address's to device

79
80
81
extern "C" void SetCalculateGBVISoftcoreForcesSim( gpuContext gpu, float* softCoreLJLambda);
extern "C" void SetCalculateGBVISoftcoreBornSumGpuSim( freeEnergyGpuContext gpu );
extern "C" void SetCalculateGBVISoftcoreForces2Sim( freeEnergyGpuContext gpu);
82

Mark Friedrichs's avatar
Mark Friedrichs committed
83
84
// kernel calls to device

85
86
87
88
89
90
91
extern void kReduceGBVIBornSumQuinticScaling( freeEnergyGpuContext gpu );
extern void kCalculateGBVISoftcoreBornSum( freeEnergyGpuContext gpu );
extern void kReduceGBVIBornForcesQuinticScaling( freeEnergyGpuContext gpu );
extern void kCalculateGBVISoftcoreForces2( freeEnergyGpuContext gpu );
extern void kReduceGBVISoftcoreBornForces( freeEnergyGpuContext gpu);
extern void kReduceGBVISoftcoreBornSum( freeEnergyGpuContext gpu);
extern void kPrintGBVISoftcore( freeEnergyGpuContext gpu, std::string callId, int call, FILE* log);
92
93

extern void kClearSoftcoreBornForces(gpuContext gpu);
Mark Friedrichs's avatar
Mark Friedrichs committed
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111

// Obc softcore

// setup method called from CudaFreeEnergyKernels

/** 
 * Initialize parameters for Cuda Obc softcore
 * 
 * @param gpu                  gpu context
 * @param innerDielectric      solute dielectric
 * @param solventDielectric    solvent dielectric
 * @param radius               intrinsic Born radii
 * @param scale                Obc scaling factors
 * @param charge               atomic charges (possibly overwritten by other methods?)
 * @param nonPolarScalingFactors non-polar scaling factors
 *
 */

112
113
114
extern "C" void gpuSetObcSoftcoreParameters( freeEnergyGpuContext gpu, float innerDielectric, float solventDielectric, float nonPolarPrefactor,
                                             const std::vector<float>& radius, const std::vector<float>& scale,
                                             const std::vector<float>& charge, const std::vector<float>& nonPolarScalingFactors);
Mark Friedrichs's avatar
Mark Friedrichs committed
115
116
117

// write address's to device

118
extern "C" void SetCalculateObcGbsaSoftcoreBornSumSim( freeEnergyGpuContext gpu );
119

Mark Friedrichs's avatar
Mark Friedrichs committed
120
121
// this method and kCalculateObcGbsaSoftcoreForces2() are being
// used until changes in OpenMM version are made 
122
extern "C" void SetCalculateObcGbsaSoftcoreForces2Sim( freeEnergyGpuContext gpu );
Mark Friedrichs's avatar
Mark Friedrichs committed
123
124
125

// kernel calls to device

126
extern void kClearObcGbsaSoftcoreBornSum( gpuContext gpu );
127
extern void kReduceObcGbsaSoftcoreBornForces( gpuContext gpu );
128
extern void kCalculateObcGbsaSoftcoreBornSum( freeEnergyGpuContext gpu );
129
130
extern void kReduceObcGbsaSoftcoreBornSum( gpuContext gpu );

Mark Friedrichs's avatar
Mark Friedrichs committed
131
// this method is not needed; the OpenMM version can be used
132
133
extern void kCalculateObcGbsaSoftcoreForces2( freeEnergyGpuContext gpu );
extern void kPrintObcGbsaSoftcore( freeEnergyGpuContext gpu, std::string callId, int call, FILE* log);
Mark Friedrichs's avatar
Mark Friedrichs committed
134
135
136

// shared

137
138
extern "C" void SetCalculateCDLJObcGbsaSoftcoreGpu1Sim( freeEnergyGpuContext gpu );
extern void kCalculateCDLJObcGbsaSoftcoreForces1( freeEnergyGpuContext gpu );
Mark Friedrichs's avatar
Mark Friedrichs committed
139

140
extern "C" void showWorkUnitsFreeEnergy( freeEnergyGpuContext freeEnergyGpu, int interactingWorkUnit );
Mark Friedrichs's avatar
Mark Friedrichs committed
141
142

#endif //__GPU_FREE_ENERGY_KERNELS_H__