2 * This file is part of the GROMACS molecular simulation package.
4 * Copyright (c) 2012,2013,2014,2016,2018,2019, by the GROMACS development team, led by
5 * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
6 * and including many others, as listed in the AUTHORS file in the
7 * top-level source directory and at http://www.gromacs.org.
9 * GROMACS is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public License
11 * as published by the Free Software Foundation; either version 2.1
12 * of the License, or (at your option) any later version.
14 * GROMACS is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with GROMACS; if not, see
21 * http://www.gnu.org/licenses, or write to the Free Software Foundation,
22 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 * If you want to redistribute modifications to GROMACS, please
25 * consider that scientific software is very special. Version
26 * control is crucial - bugs must be traceable. We will be happy to
27 * consider code for inclusion in the official distribution, but
28 * derived work must not be called official GROMACS. Details are found
29 * in the README & COPYING files - if they are missing, get the
30 * official version at http://www.gromacs.org.
32 * To help us fund GROMACS development, we humbly ask that you cite
33 * the research papers on the package. Check out http://www.gromacs.org.
37 * This header has the sole purpose of generating kernels for the combinations of
38 * supported electrostatics types (cut-off, reaction-field, analytical and
39 * tabulated Ewald) and VDW types (cut-off + V shift, LJ-Ewald with
40 * geometric or Lorentz-Berthelot combination rule, F switch, V switch).
42 * The Ewald kernels have twin-range cut-off versions with rcoul != rvdw which
43 * require an extra distance check to enable PP-PME load balancing
44 * (otherwise, by default rcoul == rvdw).
46 * NOTE: No include fence as it is meant to be included multiple times.
49 #include "nbnxm_ocl_kernel_utils.clh"
51 /* Analytical plain cut-off electrostatics kernels
55 /* cut-off + V shift LJ */
56 #define NB_KERNEL_FUNC_NAME(x, y) x ## _ElecCut_VdwLJ ## y
57 #include "nbnxm_ocl_kernel.clh"
58 #undef NB_KERNEL_FUNC_NAME
59 /* cut-off + V shift LJ w geometric combination rules */
61 #define NB_KERNEL_FUNC_NAME(x, y) x ## _ElecCut_VdwLJCombGeom ## y
62 #include "nbnxm_ocl_kernel.clh"
64 #undef NB_KERNEL_FUNC_NAME
65 /* cut-off + V shift LJ w LB combination rules */
67 #define NB_KERNEL_FUNC_NAME(x, y) x ## _ElecCut_VdwLJCombLB ## y
68 #include "nbnxm_ocl_kernel.clh"
70 #undef NB_KERNEL_FUNC_NAME
71 /* LJ-Ewald w geometric combination rules */
72 #define LJ_EWALD_COMB_GEOM
73 #define NB_KERNEL_FUNC_NAME(x, y) x ## _ElecCut_VdwLJEwCombGeom ## y
74 #include "nbnxm_ocl_kernel.clh"
75 #undef LJ_EWALD_COMB_GEOM
76 #undef NB_KERNEL_FUNC_NAME
77 /* LJ-Ewald w LB combination rules */
78 #define LJ_EWALD_COMB_LB
79 #define NB_KERNEL_FUNC_NAME(x, y) x ## _ElecCut_VdwLJEwCombLB ## y
80 #include "nbnxm_ocl_kernel.clh"
81 #undef LJ_EWALD_COMB_LB
82 #undef NB_KERNEL_FUNC_NAME
84 #define LJ_FORCE_SWITCH
85 #define NB_KERNEL_FUNC_NAME(x, y) x ## _ElecCut_VdwLJFsw ## y
86 #include "nbnxm_ocl_kernel.clh"
87 #undef LJ_FORCE_SWITCH
88 #undef NB_KERNEL_FUNC_NAME
91 #define NB_KERNEL_FUNC_NAME(x, y) x ## _ElecCut_VdwLJPsw ## y
92 #include "nbnxm_ocl_kernel.clh"
94 #undef NB_KERNEL_FUNC_NAME
99 /* Analytical reaction-field kernels
103 /* cut-off + V shift LJ */
104 #define NB_KERNEL_FUNC_NAME(x, y) x ## _ElecRF_VdwLJ ## y
105 #include "nbnxm_ocl_kernel.clh"
106 #undef NB_KERNEL_FUNC_NAME
107 /* cut-off + V shift LJ w geometric combination rules */
109 #define NB_KERNEL_FUNC_NAME(x, y) x ## _ElecRF_VdwLJCombGeom ## y
110 #include "nbnxm_ocl_kernel.clh"
112 #undef NB_KERNEL_FUNC_NAME
113 /* cut-off + V shift LJ w LB combination rules */
115 #define NB_KERNEL_FUNC_NAME(x, y) x ## _ElecRF_VdwLJCombLB ## y
116 #include "nbnxm_ocl_kernel.clh"
118 #undef NB_KERNEL_FUNC_NAME
119 /* LJ-Ewald w geometric combination rules */
120 #define LJ_EWALD_COMB_GEOM
121 #define NB_KERNEL_FUNC_NAME(x, y) x ## _ElecRF_VdwLJEwCombGeom ## y
122 #include "nbnxm_ocl_kernel.clh"
123 #undef LJ_EWALD_COMB_GEOM
124 #undef NB_KERNEL_FUNC_NAME
125 /* LJ-Ewald w LB combination rules */
126 #define LJ_EWALD_COMB_LB
127 #define NB_KERNEL_FUNC_NAME(x, y) x ## _ElecRF_VdwLJEwCombLB ## y
128 #include "nbnxm_ocl_kernel.clh"
129 #undef LJ_EWALD_COMB_LB
130 #undef NB_KERNEL_FUNC_NAME
132 #define LJ_FORCE_SWITCH
133 #define NB_KERNEL_FUNC_NAME(x, y) x ## _ElecRF_VdwLJFsw ## y
134 #include "nbnxm_ocl_kernel.clh"
135 #undef LJ_FORCE_SWITCH
136 #undef NB_KERNEL_FUNC_NAME
138 #define LJ_POT_SWITCH
139 #define NB_KERNEL_FUNC_NAME(x, y) x ## _ElecRF_VdwLJPsw ## y
140 #include "nbnxm_ocl_kernel.clh"
142 #undef NB_KERNEL_FUNC_NAME
147 /* Analytical Ewald interaction kernels
151 /* cut-off + V shift LJ */
152 #define NB_KERNEL_FUNC_NAME(x, y) x ## _ElecEw_VdwLJ ## y
153 #include "nbnxm_ocl_kernel.clh"
154 #undef NB_KERNEL_FUNC_NAME
155 /* cut-off + V shift LJ w geometric combination rules */
157 #define NB_KERNEL_FUNC_NAME(x, y) x ## _ElecEw_VdwLJCombGeom ## y
158 #include "nbnxm_ocl_kernel.clh"
160 #undef NB_KERNEL_FUNC_NAME
161 /* cut-off + V shift LJ w LB combination rules */
163 #define NB_KERNEL_FUNC_NAME(x, y) x ## _ElecEw_VdwLJCombLB ## y
164 #include "nbnxm_ocl_kernel.clh"
166 #undef NB_KERNEL_FUNC_NAME
167 /* LJ-Ewald w geometric combination rules */
168 #define LJ_EWALD_COMB_GEOM
169 #define NB_KERNEL_FUNC_NAME(x, y) x ## _ElecEw_VdwLJEwCombGeom ## y
170 #include "nbnxm_ocl_kernel.clh"
171 #undef LJ_EWALD_COMB_GEOM
172 #undef NB_KERNEL_FUNC_NAME
173 /* LJ-Ewald w LB combination rules */
174 #define LJ_EWALD_COMB_LB
175 #define NB_KERNEL_FUNC_NAME(x, y) x ## _ElecEw_VdwLJEwCombLB ## y
176 #include "nbnxm_ocl_kernel.clh"
177 #undef LJ_EWALD_COMB_LB
178 #undef NB_KERNEL_FUNC_NAME
180 #define LJ_FORCE_SWITCH
181 #define NB_KERNEL_FUNC_NAME(x, y) x ## _ElecEw_VdwLJFsw ## y
182 #include "nbnxm_ocl_kernel.clh"
183 #undef LJ_FORCE_SWITCH
184 #undef NB_KERNEL_FUNC_NAME
186 #define LJ_POT_SWITCH
187 #define NB_KERNEL_FUNC_NAME(x, y) x ## _ElecEw_VdwLJPsw ## y
188 #include "nbnxm_ocl_kernel.clh"
190 #undef NB_KERNEL_FUNC_NAME
195 /* Analytical Ewald interaction kernels with twin-range cut-off
198 #define VDW_CUTOFF_CHECK
200 /* cut-off + V shift LJ */
201 #define NB_KERNEL_FUNC_NAME(x, y) x ## _ElecEwTwinCut_VdwLJ ## y
202 #include "nbnxm_ocl_kernel.clh"
203 #undef NB_KERNEL_FUNC_NAME
204 /* cut-off + V shift LJ w geometric combination rules */
206 #define NB_KERNEL_FUNC_NAME(x, y) x ## _ElecEwTwinCut_VdwLJCombGeom ## y
207 #include "nbnxm_ocl_kernel.clh"
209 #undef NB_KERNEL_FUNC_NAME
210 /* cut-off + V shift LJ w LB combination rules */
212 #define NB_KERNEL_FUNC_NAME(x, y) x ## _ElecEwTwinCut_VdwLJCombLB ## y
213 #include "nbnxm_ocl_kernel.clh"
215 #undef NB_KERNEL_FUNC_NAME
216 /* LJ-Ewald w geometric combination rules */
217 #define LJ_EWALD_COMB_GEOM
218 #define NB_KERNEL_FUNC_NAME(x, y) x ## _ElecEwTwinCut_VdwLJEwCombGeom ## y
219 #include "nbnxm_ocl_kernel.clh"
220 #undef LJ_EWALD_COMB_GEOM
221 #undef NB_KERNEL_FUNC_NAME
222 /* LJ-Ewald w LB combination rules */
223 #define LJ_EWALD_COMB_LB
224 #define NB_KERNEL_FUNC_NAME(x, y) x ## _ElecEwTwinCut_VdwLJEwCombLB ## y
225 #include "nbnxm_ocl_kernel.clh"
226 #undef LJ_EWALD_COMB_LB
227 #undef NB_KERNEL_FUNC_NAME
229 #define LJ_FORCE_SWITCH
230 #define NB_KERNEL_FUNC_NAME(x, y) x ## _ElecEwTwinCut_VdwLJFsw ## y
231 #include "nbnxm_ocl_kernel.clh"
232 #undef LJ_FORCE_SWITCH
233 #undef NB_KERNEL_FUNC_NAME
235 #define LJ_POT_SWITCH
236 #define NB_KERNEL_FUNC_NAME(x, y) x ## _ElecEwTwinCut_VdwLJPsw ## y
237 #include "nbnxm_ocl_kernel.clh"
239 #undef NB_KERNEL_FUNC_NAME
242 #undef VDW_CUTOFF_CHECK
245 /* Tabulated Ewald interaction kernels */
248 /* cut-off + V shift LJ */
249 #define NB_KERNEL_FUNC_NAME(x, y) x ## _ElecEwQSTab_VdwLJ ## y
250 #include "nbnxm_ocl_kernel.clh"
251 #undef NB_KERNEL_FUNC_NAME
252 /* cut-off + V shift LJ w geometric combination rules */
254 #define NB_KERNEL_FUNC_NAME(x, y) x ## _ElecEwQSTab_VdwLJCombGeom ## y
255 #include "nbnxm_ocl_kernel.clh"
257 #undef NB_KERNEL_FUNC_NAME
258 /* cut-off + V shift LJ w LB combination rules */
260 #define NB_KERNEL_FUNC_NAME(x, y) x ## _ElecEwQSTab_VdwLJCombLB ## y
261 #include "nbnxm_ocl_kernel.clh"
263 #undef NB_KERNEL_FUNC_NAME
264 /* LJ-Ewald w geometric combination rules */
265 #define LJ_EWALD_COMB_GEOM
266 #define NB_KERNEL_FUNC_NAME(x, y) x ## _ElecEwQSTab_VdwLJEwCombGeom ## y
267 #include "nbnxm_ocl_kernel.clh"
268 #undef LJ_EWALD_COMB_GEOM
269 #undef NB_KERNEL_FUNC_NAME
270 /* LJ-Ewald w LB combination rules */
271 #define LJ_EWALD_COMB_LB
272 #define NB_KERNEL_FUNC_NAME(x, y) x ## _ElecEwQSTab_VdwLJEwCombLB ## y
273 #include "nbnxm_ocl_kernel.clh"
274 #undef LJ_EWALD_COMB_LB
275 #undef NB_KERNEL_FUNC_NAME
277 #define LJ_FORCE_SWITCH
278 #define NB_KERNEL_FUNC_NAME(x, y) x ## _ElecEwQSTab_VdwLJFsw ## y
279 #include "nbnxm_ocl_kernel.clh"
280 #undef LJ_FORCE_SWITCH
281 #undef NB_KERNEL_FUNC_NAME
283 #define LJ_POT_SWITCH
284 #define NB_KERNEL_FUNC_NAME(x, y) x ## _ElecEwQSTab_VdwLJPsw ## y
285 #include "nbnxm_ocl_kernel.clh"
287 #undef NB_KERNEL_FUNC_NAME
292 /* Tabulated Ewald interaction kernels with twin-range cut-off */
294 #define VDW_CUTOFF_CHECK
296 /* cut-off + V shift LJ */
297 #define NB_KERNEL_FUNC_NAME(x, y) x ## _ElecEwQSTabTwinCut_VdwLJ ## y
298 #include "nbnxm_ocl_kernel.clh"
299 #undef NB_KERNEL_FUNC_NAME
300 /* cut-off + V shift LJ w geometric combination rules */
302 #define NB_KERNEL_FUNC_NAME(x, y) x ## _ElecEwQSTabTwin_VdwLJCombGeom ## y
303 #include "nbnxm_ocl_kernel.clh"
305 #undef NB_KERNEL_FUNC_NAME
306 /* cut-off + V shift LJ w LB combination rules */
308 #define NB_KERNEL_FUNC_NAME(x, y) x ## _ElecEwQSTabTwin_VdwLJCombLB ## y
309 #include "nbnxm_ocl_kernel.clh"
311 #undef NB_KERNEL_FUNC_NAME
312 /* LJ-Ewald w geometric combination rules */
313 #define LJ_EWALD_COMB_GEOM
314 #define NB_KERNEL_FUNC_NAME(x, y) x ## _ElecEwQSTabTwinCut_VdwLJEwCombGeom ## y
315 #include "nbnxm_ocl_kernel.clh"
316 #undef LJ_EWALD_COMB_GEOM
317 #undef NB_KERNEL_FUNC_NAME
318 /* LJ-Ewald w LB combination rules */
319 #define LJ_EWALD_COMB_LB
320 #define NB_KERNEL_FUNC_NAME(x, y) x ## _ElecEwQSTabTwinCut_VdwLJEwCombLB ## y
321 #include "nbnxm_ocl_kernel.clh"
322 #undef LJ_EWALD_COMB_LB
323 #undef NB_KERNEL_FUNC_NAME
325 #define LJ_FORCE_SWITCH
326 #define NB_KERNEL_FUNC_NAME(x, y) x ## _ElecEwQSTabTwinCut_VdwLJFsw ## y
327 #include "nbnxm_ocl_kernel.clh"
328 #undef LJ_FORCE_SWITCH
329 #undef NB_KERNEL_FUNC_NAME
331 #define LJ_POT_SWITCH
332 #define NB_KERNEL_FUNC_NAME(x, y) x ## _ElecEwQSTabTwinCut_VdwLJPsw ## y
333 #include "nbnxm_ocl_kernel.clh"
335 #undef NB_KERNEL_FUNC_NAME
338 #undef VDW_CUTOFF_CHECK