2 * This file is part of the GROMACS molecular simulation package.
4 * Copyright (c) 2012,2013,2014, 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 /* Analytical plain cut-off electrostatics kernels
53 /* cut-off + V shift LJ */
54 #define NB_KERNEL_FUNC_NAME(x, ...) x ## _ElecCut_VdwLJ ## __VA_ARGS__
55 #include "nbnxn_cuda_kernel.cuh"
56 #undef NB_KERNEL_FUNC_NAME
57 /* LJ-Ewald w geometric combination rules */
58 #define LJ_EWALD_COMB_GEOM
59 #define NB_KERNEL_FUNC_NAME(x, ...) x ## _ElecCut_VdwLJEwCombGeom ## __VA_ARGS__
60 #include "nbnxn_cuda_kernel.cuh"
61 #undef LJ_EWALD_COMB_GEOM
62 #undef NB_KERNEL_FUNC_NAME
63 /* LJ-Ewald w LB combination rules */
64 #define LJ_EWALD_COMB_LB
65 #define NB_KERNEL_FUNC_NAME(x, ...) x ## _ElecCut_VdwLJEwCombLB ## __VA_ARGS__
66 #include "nbnxn_cuda_kernel.cuh"
67 #undef LJ_EWALD_COMB_LB
68 #undef NB_KERNEL_FUNC_NAME
70 #define LJ_FORCE_SWITCH
71 #define NB_KERNEL_FUNC_NAME(x, ...) x ## _ElecCut_VdwLJFsw ## __VA_ARGS__
72 #include "nbnxn_cuda_kernel.cuh"
73 #undef LJ_FORCE_SWITCH
74 #undef NB_KERNEL_FUNC_NAME
77 #define NB_KERNEL_FUNC_NAME(x, ...) x ## _ElecCut_VdwLJPsw ## __VA_ARGS__
78 #include "nbnxn_cuda_kernel.cuh"
80 #undef NB_KERNEL_FUNC_NAME
85 /* Analytical reaction-field kernels
89 /* cut-off + V shift LJ */
90 #define NB_KERNEL_FUNC_NAME(x, ...) x ## _ElecRF_VdwLJ ## __VA_ARGS__
91 #include "nbnxn_cuda_kernel.cuh"
92 #undef NB_KERNEL_FUNC_NAME
93 /* LJ-Ewald w geometric combination rules */
94 #define LJ_EWALD_COMB_GEOM
95 #define NB_KERNEL_FUNC_NAME(x, ...) x ## _ElecRF_VdwLJEwCombGeom ## __VA_ARGS__
96 #include "nbnxn_cuda_kernel.cuh"
97 #undef LJ_EWALD_COMB_GEOM
98 #undef NB_KERNEL_FUNC_NAME
99 /* LJ-Ewald w LB combination rules */
100 #define LJ_EWALD_COMB_LB
101 #define NB_KERNEL_FUNC_NAME(x, ...) x ## _ElecRF_VdwLJEwCombLB ## __VA_ARGS__
102 #include "nbnxn_cuda_kernel.cuh"
103 #undef LJ_EWALD_COMB_LB
104 #undef NB_KERNEL_FUNC_NAME
106 #define LJ_FORCE_SWITCH
107 #define NB_KERNEL_FUNC_NAME(x, ...) x ## _ElecRF_VdwLJFsw ## __VA_ARGS__
108 #include "nbnxn_cuda_kernel.cuh"
109 #undef LJ_FORCE_SWITCH
110 #undef NB_KERNEL_FUNC_NAME
112 #define LJ_POT_SWITCH
113 #define NB_KERNEL_FUNC_NAME(x, ...) x ## _ElecRF_VdwLJPsw ## __VA_ARGS__
114 #include "nbnxn_cuda_kernel.cuh"
116 #undef NB_KERNEL_FUNC_NAME
121 /* Analytical Ewald interaction kernels
125 /* cut-off + V shift LJ */
126 #define NB_KERNEL_FUNC_NAME(x, ...) x ## _ElecEw_VdwLJ ## __VA_ARGS__
127 #include "nbnxn_cuda_kernel.cuh"
128 #undef NB_KERNEL_FUNC_NAME
129 /* LJ-Ewald w geometric combination rules */
130 #define LJ_EWALD_COMB_GEOM
131 #define NB_KERNEL_FUNC_NAME(x, ...) x ## _ElecEw_VdwLJEwCombGeom ## __VA_ARGS__
132 #include "nbnxn_cuda_kernel.cuh"
133 #undef LJ_EWALD_COMB_GEOM
134 #undef NB_KERNEL_FUNC_NAME
135 /* LJ-Ewald w LB combination rules */
136 #define LJ_EWALD_COMB_LB
137 #define NB_KERNEL_FUNC_NAME(x, ...) x ## _ElecEw_VdwLJEwCombLB ## __VA_ARGS__
138 #include "nbnxn_cuda_kernel.cuh"
139 #undef LJ_EWALD_COMB_LB
140 #undef NB_KERNEL_FUNC_NAME
142 #define LJ_FORCE_SWITCH
143 #define NB_KERNEL_FUNC_NAME(x, ...) x ## _ElecEw_VdwLJFsw ## __VA_ARGS__
144 #include "nbnxn_cuda_kernel.cuh"
145 #undef LJ_FORCE_SWITCH
146 #undef NB_KERNEL_FUNC_NAME
148 #define LJ_POT_SWITCH
149 #define NB_KERNEL_FUNC_NAME(x, ...) x ## _ElecEw_VdwLJPsw ## __VA_ARGS__
150 #include "nbnxn_cuda_kernel.cuh"
152 #undef NB_KERNEL_FUNC_NAME
157 /* Analytical Ewald interaction kernels with twin-range cut-off
160 #define VDW_CUTOFF_CHECK
162 /* cut-off + V shift LJ */
163 #define NB_KERNEL_FUNC_NAME(x, ...) x ## _ElecEwTwinCut_VdwLJ ## __VA_ARGS__
164 #include "nbnxn_cuda_kernel.cuh"
165 #undef NB_KERNEL_FUNC_NAME
166 /* LJ-Ewald w geometric combination rules */
167 #define LJ_EWALD_COMB_GEOM
168 #define NB_KERNEL_FUNC_NAME(x, ...) x ## _ElecEwTwinCut_VdwLJEwCombGeom ## __VA_ARGS__
169 #include "nbnxn_cuda_kernel.cuh"
170 #undef LJ_EWALD_COMB_GEOM
171 #undef NB_KERNEL_FUNC_NAME
172 /* LJ-Ewald w LB combination rules */
173 #define LJ_EWALD_COMB_LB
174 #define NB_KERNEL_FUNC_NAME(x, ...) x ## _ElecEwTwinCut_VdwLJEwCombLB ## __VA_ARGS__
175 #include "nbnxn_cuda_kernel.cuh"
176 #undef LJ_EWALD_COMB_LB
177 #undef NB_KERNEL_FUNC_NAME
179 #define LJ_FORCE_SWITCH
180 #define NB_KERNEL_FUNC_NAME(x, ...) x ## _ElecEwTwinCut_VdwLJFsw ## __VA_ARGS__
181 #include "nbnxn_cuda_kernel.cuh"
182 #undef LJ_FORCE_SWITCH
183 #undef NB_KERNEL_FUNC_NAME
185 #define LJ_POT_SWITCH
186 #define NB_KERNEL_FUNC_NAME(x, ...) x ## _ElecEwTwinCut_VdwLJPsw ## __VA_ARGS__
187 #include "nbnxn_cuda_kernel.cuh"
189 #undef NB_KERNEL_FUNC_NAME
192 #undef VDW_CUTOFF_CHECK
195 /* Tabulated Ewald interaction kernels */
198 /* cut-off + V shift LJ */
199 #define NB_KERNEL_FUNC_NAME(x, ...) x ## _ElecEwQSTab_VdwLJ ## __VA_ARGS__
200 #include "nbnxn_cuda_kernel.cuh"
201 #undef NB_KERNEL_FUNC_NAME
202 /* LJ-Ewald w geometric combination rules */
203 #define LJ_EWALD_COMB_GEOM
204 #define NB_KERNEL_FUNC_NAME(x, ...) x ## _ElecEwQSTab_VdwLJEwCombGeom ## __VA_ARGS__
205 #include "nbnxn_cuda_kernel.cuh"
206 #undef LJ_EWALD_COMB_GEOM
207 #undef NB_KERNEL_FUNC_NAME
208 /* LJ-Ewald w LB combination rules */
209 #define LJ_EWALD_COMB_LB
210 #define NB_KERNEL_FUNC_NAME(x, ...) x ## _ElecEwQSTab_VdwLJEwCombLB ## __VA_ARGS__
211 #include "nbnxn_cuda_kernel.cuh"
212 #undef LJ_EWALD_COMB_LB
213 #undef NB_KERNEL_FUNC_NAME
215 #define LJ_FORCE_SWITCH
216 #define NB_KERNEL_FUNC_NAME(x, ...) x ## _ElecEwQSTab_VdwLJFsw ## __VA_ARGS__
217 #include "nbnxn_cuda_kernel.cuh"
218 #undef LJ_FORCE_SWITCH
219 #undef NB_KERNEL_FUNC_NAME
221 #define LJ_POT_SWITCH
222 #define NB_KERNEL_FUNC_NAME(x, ...) x ## _ElecEwQSTab_VdwLJPsw ## __VA_ARGS__
223 #include "nbnxn_cuda_kernel.cuh"
225 #undef NB_KERNEL_FUNC_NAME
230 /* Tabulated Ewald interaction kernels with twin-range cut-off */
232 #define VDW_CUTOFF_CHECK
234 /* cut-off + V shift LJ */
235 #define NB_KERNEL_FUNC_NAME(x, ...) x ## _ElecEwQSTabTwinCut_VdwLJ ## __VA_ARGS__
236 #include "nbnxn_cuda_kernel.cuh"
237 #undef NB_KERNEL_FUNC_NAME
238 /* LJ-Ewald w geometric combination rules */
239 #define LJ_EWALD_COMB_GEOM
240 #define NB_KERNEL_FUNC_NAME(x, ...) x ## _ElecEwQSTabTwinCut_VdwLJEwCombGeom ## __VA_ARGS__
241 #include "nbnxn_cuda_kernel.cuh"
242 #undef LJ_EWALD_COMB_GEOM
243 #undef NB_KERNEL_FUNC_NAME
244 /* LJ-Ewald w LB combination rules */
245 #define LJ_EWALD_COMB_LB
246 #define NB_KERNEL_FUNC_NAME(x, ...) x ## _ElecEwQSTabTwinCut_VdwLJEwCombLB ## __VA_ARGS__
247 #include "nbnxn_cuda_kernel.cuh"
248 #undef LJ_EWALD_COMB_LB
249 #undef NB_KERNEL_FUNC_NAME
251 #define LJ_FORCE_SWITCH
252 #define NB_KERNEL_FUNC_NAME(x, ...) x ## _ElecEwQSTabTwinCut_VdwLJFsw ## __VA_ARGS__
253 #include "nbnxn_cuda_kernel.cuh"
254 #undef LJ_FORCE_SWITCH
255 #undef NB_KERNEL_FUNC_NAME
257 #define LJ_POT_SWITCH
258 #define NB_KERNEL_FUNC_NAME(x, ...) x ## _ElecEwQSTabTwinCut_VdwLJPsw ## __VA_ARGS__
259 #include "nbnxn_cuda_kernel.cuh"
261 #undef NB_KERNEL_FUNC_NAME
264 #undef VDW_CUTOFF_CHECK