2 * This file is part of the GROMACS molecular simulation package.
4 * Copyright (c) 2012,2013,2014,2016,2018 by the GROMACS development team.
5 * Copyright (c) 2019,2020, by the GROMACS development team, led by
6 * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
7 * and including many others, as listed in the AUTHORS file in the
8 * top-level source directory and at http://www.gromacs.org.
10 * GROMACS is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public License
12 * as published by the Free Software Foundation; either version 2.1
13 * of the License, or (at your option) any later version.
15 * GROMACS is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Lesser General Public License for more details.
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with GROMACS; if not, see
22 * http://www.gnu.org/licenses, or write to the Free Software Foundation,
23 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25 * If you want to redistribute modifications to GROMACS, please
26 * consider that scientific software is very special. Version
27 * control is crucial - bugs must be traceable. We will be happy to
28 * consider code for inclusion in the official distribution, but
29 * derived work must not be called official GROMACS. Details are found
30 * in the README & COPYING files - if they are missing, get the
31 * official version at http://www.gromacs.org.
33 * To help us fund GROMACS development, we humbly ask that you cite
34 * the research papers on the package. Check out http://www.gromacs.org.
38 * This header has the sole purpose of generating kernels for the combinations of
39 * supported electrostatics types (cut-off, reaction-field, analytical and
40 * tabulated Ewald) and VDW types (cut-off + V shift, LJ-Ewald with
41 * geometric or Lorentz-Berthelot combination rule, F switch, V switch).
43 * The Ewald kernels have twin-range cut-off versions with rcoul != rvdw which
44 * require an extra distance check to enable PP-PME load balancing
45 * (otherwise, by default rcoul == rvdw).
47 * NOTE: No include fence as it is meant to be included multiple times.
50 #include "nbnxm_ocl_kernel_utils.clh"
52 /* Analytical plain cut-off electrostatics kernels
56 /* cut-off + V shift LJ */
57 #define NB_KERNEL_FUNC_NAME(x, y) x##_ElecCut_VdwLJ##y
58 #include "nbnxm_ocl_kernel.clh"
59 #undef NB_KERNEL_FUNC_NAME
60 /* cut-off + V shift LJ w geometric combination rules */
62 #define NB_KERNEL_FUNC_NAME(x, y) x##_ElecCut_VdwLJCombGeom##y
63 #include "nbnxm_ocl_kernel.clh"
65 #undef NB_KERNEL_FUNC_NAME
66 /* cut-off + V shift LJ w LB combination rules */
68 #define NB_KERNEL_FUNC_NAME(x, y) x##_ElecCut_VdwLJCombLB##y
69 #include "nbnxm_ocl_kernel.clh"
71 #undef NB_KERNEL_FUNC_NAME
72 /* LJ-Ewald w geometric combination rules */
73 #define LJ_EWALD_COMB_GEOM
74 #define NB_KERNEL_FUNC_NAME(x, y) x##_ElecCut_VdwLJEwCombGeom##y
75 #include "nbnxm_ocl_kernel.clh"
76 #undef LJ_EWALD_COMB_GEOM
77 #undef NB_KERNEL_FUNC_NAME
78 /* LJ-Ewald w LB combination rules */
79 #define LJ_EWALD_COMB_LB
80 #define NB_KERNEL_FUNC_NAME(x, y) x##_ElecCut_VdwLJEwCombLB##y
81 #include "nbnxm_ocl_kernel.clh"
82 #undef LJ_EWALD_COMB_LB
83 #undef NB_KERNEL_FUNC_NAME
85 #define LJ_FORCE_SWITCH
86 #define NB_KERNEL_FUNC_NAME(x, y) x##_ElecCut_VdwLJFsw##y
87 #include "nbnxm_ocl_kernel.clh"
88 #undef LJ_FORCE_SWITCH
89 #undef NB_KERNEL_FUNC_NAME
92 #define NB_KERNEL_FUNC_NAME(x, y) x##_ElecCut_VdwLJPsw##y
93 #include "nbnxm_ocl_kernel.clh"
95 #undef NB_KERNEL_FUNC_NAME
100 /* Analytical reaction-field kernels
104 /* cut-off + V shift LJ */
105 #define NB_KERNEL_FUNC_NAME(x, y) x##_ElecRF_VdwLJ##y
106 #include "nbnxm_ocl_kernel.clh"
107 #undef NB_KERNEL_FUNC_NAME
108 /* cut-off + V shift LJ w geometric combination rules */
110 #define NB_KERNEL_FUNC_NAME(x, y) x##_ElecRF_VdwLJCombGeom##y
111 #include "nbnxm_ocl_kernel.clh"
113 #undef NB_KERNEL_FUNC_NAME
114 /* cut-off + V shift LJ w LB combination rules */
116 #define NB_KERNEL_FUNC_NAME(x, y) x##_ElecRF_VdwLJCombLB##y
117 #include "nbnxm_ocl_kernel.clh"
119 #undef NB_KERNEL_FUNC_NAME
120 /* LJ-Ewald w geometric combination rules */
121 #define LJ_EWALD_COMB_GEOM
122 #define NB_KERNEL_FUNC_NAME(x, y) x##_ElecRF_VdwLJEwCombGeom##y
123 #include "nbnxm_ocl_kernel.clh"
124 #undef LJ_EWALD_COMB_GEOM
125 #undef NB_KERNEL_FUNC_NAME
126 /* LJ-Ewald w LB combination rules */
127 #define LJ_EWALD_COMB_LB
128 #define NB_KERNEL_FUNC_NAME(x, y) x##_ElecRF_VdwLJEwCombLB##y
129 #include "nbnxm_ocl_kernel.clh"
130 #undef LJ_EWALD_COMB_LB
131 #undef NB_KERNEL_FUNC_NAME
133 #define LJ_FORCE_SWITCH
134 #define NB_KERNEL_FUNC_NAME(x, y) x##_ElecRF_VdwLJFsw##y
135 #include "nbnxm_ocl_kernel.clh"
136 #undef LJ_FORCE_SWITCH
137 #undef NB_KERNEL_FUNC_NAME
139 #define LJ_POT_SWITCH
140 #define NB_KERNEL_FUNC_NAME(x, y) x##_ElecRF_VdwLJPsw##y
141 #include "nbnxm_ocl_kernel.clh"
143 #undef NB_KERNEL_FUNC_NAME
148 /* Analytical Ewald interaction kernels
152 /* cut-off + V shift LJ */
153 #define NB_KERNEL_FUNC_NAME(x, y) x##_ElecEw_VdwLJ##y
154 #include "nbnxm_ocl_kernel.clh"
155 #undef NB_KERNEL_FUNC_NAME
156 /* cut-off + V shift LJ w geometric combination rules */
158 #define NB_KERNEL_FUNC_NAME(x, y) x##_ElecEw_VdwLJCombGeom##y
159 #include "nbnxm_ocl_kernel.clh"
161 #undef NB_KERNEL_FUNC_NAME
162 /* cut-off + V shift LJ w LB combination rules */
164 #define NB_KERNEL_FUNC_NAME(x, y) x##_ElecEw_VdwLJCombLB##y
165 #include "nbnxm_ocl_kernel.clh"
167 #undef NB_KERNEL_FUNC_NAME
168 /* LJ-Ewald w geometric combination rules */
169 #define LJ_EWALD_COMB_GEOM
170 #define NB_KERNEL_FUNC_NAME(x, y) x##_ElecEw_VdwLJEwCombGeom##y
171 #include "nbnxm_ocl_kernel.clh"
172 #undef LJ_EWALD_COMB_GEOM
173 #undef NB_KERNEL_FUNC_NAME
174 /* LJ-Ewald w LB combination rules */
175 #define LJ_EWALD_COMB_LB
176 #define NB_KERNEL_FUNC_NAME(x, y) x##_ElecEw_VdwLJEwCombLB##y
177 #include "nbnxm_ocl_kernel.clh"
178 #undef LJ_EWALD_COMB_LB
179 #undef NB_KERNEL_FUNC_NAME
181 #define LJ_FORCE_SWITCH
182 #define NB_KERNEL_FUNC_NAME(x, y) x##_ElecEw_VdwLJFsw##y
183 #include "nbnxm_ocl_kernel.clh"
184 #undef LJ_FORCE_SWITCH
185 #undef NB_KERNEL_FUNC_NAME
187 #define LJ_POT_SWITCH
188 #define NB_KERNEL_FUNC_NAME(x, y) x##_ElecEw_VdwLJPsw##y
189 #include "nbnxm_ocl_kernel.clh"
191 #undef NB_KERNEL_FUNC_NAME
196 /* Analytical Ewald interaction kernels with twin-range cut-off
199 #define VDW_CUTOFF_CHECK
201 /* cut-off + V shift LJ */
202 #define NB_KERNEL_FUNC_NAME(x, y) x##_ElecEwTwinCut_VdwLJ##y
203 #include "nbnxm_ocl_kernel.clh"
204 #undef NB_KERNEL_FUNC_NAME
205 /* cut-off + V shift LJ w geometric combination rules */
207 #define NB_KERNEL_FUNC_NAME(x, y) x##_ElecEwTwinCut_VdwLJCombGeom##y
208 #include "nbnxm_ocl_kernel.clh"
210 #undef NB_KERNEL_FUNC_NAME
211 /* cut-off + V shift LJ w LB combination rules */
213 #define NB_KERNEL_FUNC_NAME(x, y) x##_ElecEwTwinCut_VdwLJCombLB##y
214 #include "nbnxm_ocl_kernel.clh"
216 #undef NB_KERNEL_FUNC_NAME
217 /* LJ-Ewald w geometric combination rules */
218 #define LJ_EWALD_COMB_GEOM
219 #define NB_KERNEL_FUNC_NAME(x, y) x##_ElecEwTwinCut_VdwLJEwCombGeom##y
220 #include "nbnxm_ocl_kernel.clh"
221 #undef LJ_EWALD_COMB_GEOM
222 #undef NB_KERNEL_FUNC_NAME
223 /* LJ-Ewald w LB combination rules */
224 #define LJ_EWALD_COMB_LB
225 #define NB_KERNEL_FUNC_NAME(x, y) x##_ElecEwTwinCut_VdwLJEwCombLB##y
226 #include "nbnxm_ocl_kernel.clh"
227 #undef LJ_EWALD_COMB_LB
228 #undef NB_KERNEL_FUNC_NAME
230 #define LJ_FORCE_SWITCH
231 #define NB_KERNEL_FUNC_NAME(x, y) x##_ElecEwTwinCut_VdwLJFsw##y
232 #include "nbnxm_ocl_kernel.clh"
233 #undef LJ_FORCE_SWITCH
234 #undef NB_KERNEL_FUNC_NAME
236 #define LJ_POT_SWITCH
237 #define NB_KERNEL_FUNC_NAME(x, y) x##_ElecEwTwinCut_VdwLJPsw##y
238 #include "nbnxm_ocl_kernel.clh"
240 #undef NB_KERNEL_FUNC_NAME
243 #undef VDW_CUTOFF_CHECK
246 /* Tabulated Ewald interaction kernels */
249 /* cut-off + V shift LJ */
250 #define NB_KERNEL_FUNC_NAME(x, y) x##_ElecEwQSTab_VdwLJ##y
251 #include "nbnxm_ocl_kernel.clh"
252 #undef NB_KERNEL_FUNC_NAME
253 /* cut-off + V shift LJ w geometric combination rules */
255 #define NB_KERNEL_FUNC_NAME(x, y) x##_ElecEwQSTab_VdwLJCombGeom##y
256 #include "nbnxm_ocl_kernel.clh"
258 #undef NB_KERNEL_FUNC_NAME
259 /* cut-off + V shift LJ w LB combination rules */
261 #define NB_KERNEL_FUNC_NAME(x, y) x##_ElecEwQSTab_VdwLJCombLB##y
262 #include "nbnxm_ocl_kernel.clh"
264 #undef NB_KERNEL_FUNC_NAME
265 /* LJ-Ewald w geometric combination rules */
266 #define LJ_EWALD_COMB_GEOM
267 #define NB_KERNEL_FUNC_NAME(x, y) x##_ElecEwQSTab_VdwLJEwCombGeom##y
268 #include "nbnxm_ocl_kernel.clh"
269 #undef LJ_EWALD_COMB_GEOM
270 #undef NB_KERNEL_FUNC_NAME
271 /* LJ-Ewald w LB combination rules */
272 #define LJ_EWALD_COMB_LB
273 #define NB_KERNEL_FUNC_NAME(x, y) x##_ElecEwQSTab_VdwLJEwCombLB##y
274 #include "nbnxm_ocl_kernel.clh"
275 #undef LJ_EWALD_COMB_LB
276 #undef NB_KERNEL_FUNC_NAME
278 #define LJ_FORCE_SWITCH
279 #define NB_KERNEL_FUNC_NAME(x, y) x##_ElecEwQSTab_VdwLJFsw##y
280 #include "nbnxm_ocl_kernel.clh"
281 #undef LJ_FORCE_SWITCH
282 #undef NB_KERNEL_FUNC_NAME
284 #define LJ_POT_SWITCH
285 #define NB_KERNEL_FUNC_NAME(x, y) x##_ElecEwQSTab_VdwLJPsw##y
286 #include "nbnxm_ocl_kernel.clh"
288 #undef NB_KERNEL_FUNC_NAME
293 /* Tabulated Ewald interaction kernels with twin-range cut-off */
295 #define VDW_CUTOFF_CHECK
297 /* cut-off + V shift LJ */
298 #define NB_KERNEL_FUNC_NAME(x, y) x##_ElecEwQSTabTwinCut_VdwLJ##y
299 #include "nbnxm_ocl_kernel.clh"
300 #undef NB_KERNEL_FUNC_NAME
301 /* cut-off + V shift LJ w geometric combination rules */
303 #define NB_KERNEL_FUNC_NAME(x, y) x##_ElecEwQSTabTwin_VdwLJCombGeom##y
304 #include "nbnxm_ocl_kernel.clh"
306 #undef NB_KERNEL_FUNC_NAME
307 /* cut-off + V shift LJ w LB combination rules */
309 #define NB_KERNEL_FUNC_NAME(x, y) x##_ElecEwQSTabTwin_VdwLJCombLB##y
310 #include "nbnxm_ocl_kernel.clh"
312 #undef NB_KERNEL_FUNC_NAME
313 /* LJ-Ewald w geometric combination rules */
314 #define LJ_EWALD_COMB_GEOM
315 #define NB_KERNEL_FUNC_NAME(x, y) x##_ElecEwQSTabTwinCut_VdwLJEwCombGeom##y
316 #include "nbnxm_ocl_kernel.clh"
317 #undef LJ_EWALD_COMB_GEOM
318 #undef NB_KERNEL_FUNC_NAME
319 /* LJ-Ewald w LB combination rules */
320 #define LJ_EWALD_COMB_LB
321 #define NB_KERNEL_FUNC_NAME(x, y) x##_ElecEwQSTabTwinCut_VdwLJEwCombLB##y
322 #include "nbnxm_ocl_kernel.clh"
323 #undef LJ_EWALD_COMB_LB
324 #undef NB_KERNEL_FUNC_NAME
326 #define LJ_FORCE_SWITCH
327 #define NB_KERNEL_FUNC_NAME(x, y) x##_ElecEwQSTabTwinCut_VdwLJFsw##y
328 #include "nbnxm_ocl_kernel.clh"
329 #undef LJ_FORCE_SWITCH
330 #undef NB_KERNEL_FUNC_NAME
332 #define LJ_POT_SWITCH
333 #define NB_KERNEL_FUNC_NAME(x, y) x##_ElecEwQSTabTwinCut_VdwLJPsw##y
334 #include "nbnxm_ocl_kernel.clh"
336 #undef NB_KERNEL_FUNC_NAME
339 #undef VDW_CUTOFF_CHECK