Apply re-formatting to C++ in src/ tree.
[alexxy/gromacs.git] / src / gromacs / nbnxm / kernels_reference / kernel_ref.h
1 /*
2  * This file is part of the GROMACS molecular simulation package.
3  *
4  * Copyright (c) 2012,2013,2014,2015,2017 The GROMACS development team.
5  * Copyright (c) 2018,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.
9  *
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.
14  *
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.
19  *
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.
24  *
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.
32  *
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.
35  */
36 /*! \internal \file
37  *
38  * \brief
39  * Declares CPU reference kernels
40  *
41  * \author Berk Hess <hess@kth.se>
42  * \ingroup module_nbnxm
43  */
44 #ifndef GMX_NBNXM_KERNELS_REFERENCE_KERNEL_REF_H
45 #define GMX_NBNXM_KERNELS_REFERENCE_KERNEL_REF_H
46
47 #include "gromacs/nbnxm/kernel_common.h"
48
49 //! All the different CPU reference kernel functions.
50 //! \{
51 nbk_func_noener nbnxn_kernel_ElecRF_VdwLJ_F_ref;
52 nbk_func_noener nbnxn_kernel_ElecRF_VdwLJFsw_F_ref;
53 nbk_func_noener nbnxn_kernel_ElecRF_VdwLJPsw_F_ref;
54 nbk_func_noener nbnxn_kernel_ElecRF_VdwLJEwCombGeom_F_ref;
55 nbk_func_noener nbnxn_kernel_ElecRF_VdwLJEwCombLB_F_ref;
56 nbk_func_noener nbnxn_kernel_ElecQSTab_VdwLJ_F_ref;
57 nbk_func_noener nbnxn_kernel_ElecQSTab_VdwLJFsw_F_ref;
58 nbk_func_noener nbnxn_kernel_ElecQSTab_VdwLJPsw_F_ref;
59 nbk_func_noener nbnxn_kernel_ElecQSTab_VdwLJEwCombGeom_F_ref;
60 nbk_func_noener nbnxn_kernel_ElecQSTab_VdwLJEwCombLB_F_ref;
61 nbk_func_noener nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_F_ref;
62 nbk_func_noener nbnxn_kernel_ElecQSTabTwinCut_VdwLJFsw_F_ref;
63 nbk_func_noener nbnxn_kernel_ElecQSTabTwinCut_VdwLJPsw_F_ref;
64 nbk_func_noener nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombGeom_F_ref;
65 nbk_func_noener nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombLB_F_ref;
66
67 nbk_func_ener nbnxn_kernel_ElecRF_VdwLJ_VF_ref;
68 nbk_func_ener nbnxn_kernel_ElecRF_VdwLJFsw_VF_ref;
69 nbk_func_ener nbnxn_kernel_ElecRF_VdwLJPsw_VF_ref;
70 nbk_func_ener nbnxn_kernel_ElecRF_VdwLJEwCombGeom_VF_ref;
71 nbk_func_ener nbnxn_kernel_ElecRF_VdwLJEwCombLB_VF_ref;
72 nbk_func_ener nbnxn_kernel_ElecQSTab_VdwLJ_VF_ref;
73 nbk_func_ener nbnxn_kernel_ElecQSTab_VdwLJFsw_VF_ref;
74 nbk_func_ener nbnxn_kernel_ElecQSTab_VdwLJPsw_VF_ref;
75 nbk_func_ener nbnxn_kernel_ElecQSTab_VdwLJEwCombGeom_VF_ref;
76 nbk_func_ener nbnxn_kernel_ElecQSTab_VdwLJEwCombLB_VF_ref;
77 nbk_func_ener nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_VF_ref;
78 nbk_func_ener nbnxn_kernel_ElecQSTabTwinCut_VdwLJFsw_VF_ref;
79 nbk_func_ener nbnxn_kernel_ElecQSTabTwinCut_VdwLJPsw_VF_ref;
80 nbk_func_ener nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombGeom_VF_ref;
81 nbk_func_ener nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombLB_VF_ref;
82
83 nbk_func_ener nbnxn_kernel_ElecRF_VdwLJ_VgrpF_ref;
84 nbk_func_ener nbnxn_kernel_ElecRF_VdwLJFsw_VgrpF_ref;
85 nbk_func_ener nbnxn_kernel_ElecRF_VdwLJPsw_VgrpF_ref;
86 nbk_func_ener nbnxn_kernel_ElecRF_VdwLJEwCombGeom_VgrpF_ref;
87 nbk_func_ener nbnxn_kernel_ElecRF_VdwLJEwCombLB_VgrpF_ref;
88 nbk_func_ener nbnxn_kernel_ElecQSTab_VdwLJ_VgrpF_ref;
89 nbk_func_ener nbnxn_kernel_ElecQSTab_VdwLJFsw_VgrpF_ref;
90 nbk_func_ener nbnxn_kernel_ElecQSTab_VdwLJPsw_VgrpF_ref;
91 nbk_func_ener nbnxn_kernel_ElecQSTab_VdwLJEwCombGeom_VgrpF_ref;
92 nbk_func_ener nbnxn_kernel_ElecQSTab_VdwLJEwCombLB_VgrpF_ref;
93 nbk_func_ener nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_VgrpF_ref;
94 nbk_func_ener nbnxn_kernel_ElecQSTabTwinCut_VdwLJFsw_VgrpF_ref;
95 nbk_func_ener nbnxn_kernel_ElecQSTabTwinCut_VdwLJPsw_VgrpF_ref;
96 nbk_func_ener nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombGeom_VgrpF_ref;
97 nbk_func_ener nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombLB_VgrpF_ref;
98 //! \}
99
100 #ifdef INCLUDE_KERNELFUNCTION_TABLES
101
102 /*! \brief Declare and define the kernel function pointer lookup tables.
103  *
104  * The minor index of the array goes over both the LJ combination rules,
105  * which is only supported by plain cut-off, and the LJ switch/PME functions.
106  * For the C reference kernels, unlike the SIMD kernels, there is not much
107  * advantage in using combination rules, so we (re-)use the same kernel.
108  */
109 //! \{
110 static p_nbk_func_noener nbnxn_kernel_noener_ref[coulktNR][vdwktNR_ref] = {
111     { nbnxn_kernel_ElecRF_VdwLJ_F_ref,
112       nbnxn_kernel_ElecRF_VdwLJ_F_ref,
113       nbnxn_kernel_ElecRF_VdwLJ_F_ref,
114       nbnxn_kernel_ElecRF_VdwLJFsw_F_ref,
115       nbnxn_kernel_ElecRF_VdwLJPsw_F_ref,
116       nbnxn_kernel_ElecRF_VdwLJEwCombGeom_F_ref,
117       nbnxn_kernel_ElecRF_VdwLJEwCombLB_F_ref },
118     { nbnxn_kernel_ElecQSTab_VdwLJ_F_ref,
119       nbnxn_kernel_ElecQSTab_VdwLJ_F_ref,
120       nbnxn_kernel_ElecQSTab_VdwLJ_F_ref,
121       nbnxn_kernel_ElecQSTab_VdwLJFsw_F_ref,
122       nbnxn_kernel_ElecQSTab_VdwLJPsw_F_ref,
123       nbnxn_kernel_ElecQSTab_VdwLJEwCombGeom_F_ref,
124       nbnxn_kernel_ElecQSTab_VdwLJEwCombLB_F_ref },
125     { nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_F_ref,
126       nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_F_ref,
127       nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_F_ref,
128       nbnxn_kernel_ElecQSTabTwinCut_VdwLJFsw_F_ref,
129       nbnxn_kernel_ElecQSTabTwinCut_VdwLJPsw_F_ref,
130       nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombGeom_F_ref,
131       nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombLB_F_ref },
132     { nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_F_ref,
133       nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_F_ref,
134       nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_F_ref,
135       nbnxn_kernel_ElecQSTabTwinCut_VdwLJFsw_F_ref,
136       nbnxn_kernel_ElecQSTabTwinCut_VdwLJPsw_F_ref,
137       nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombGeom_F_ref,
138       nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombLB_F_ref },
139     { nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_F_ref,
140       nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_F_ref,
141       nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_F_ref,
142       nbnxn_kernel_ElecQSTabTwinCut_VdwLJFsw_F_ref,
143       nbnxn_kernel_ElecQSTabTwinCut_VdwLJPsw_F_ref,
144       nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombGeom_F_ref,
145       nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombLB_F_ref }
146 };
147
148 static p_nbk_func_ener nbnxn_kernel_ener_ref[coulktNR][vdwktNR_ref] = {
149     { nbnxn_kernel_ElecRF_VdwLJ_VF_ref,
150       nbnxn_kernel_ElecRF_VdwLJ_VF_ref,
151       nbnxn_kernel_ElecRF_VdwLJ_VF_ref,
152       nbnxn_kernel_ElecRF_VdwLJFsw_VF_ref,
153       nbnxn_kernel_ElecRF_VdwLJPsw_VF_ref,
154       nbnxn_kernel_ElecRF_VdwLJEwCombGeom_VF_ref,
155       nbnxn_kernel_ElecRF_VdwLJEwCombLB_VF_ref },
156     { nbnxn_kernel_ElecQSTab_VdwLJ_VF_ref,
157       nbnxn_kernel_ElecQSTab_VdwLJ_VF_ref,
158       nbnxn_kernel_ElecQSTab_VdwLJ_VF_ref,
159       nbnxn_kernel_ElecQSTab_VdwLJFsw_VF_ref,
160       nbnxn_kernel_ElecQSTab_VdwLJPsw_VF_ref,
161       nbnxn_kernel_ElecQSTab_VdwLJEwCombGeom_VF_ref,
162       nbnxn_kernel_ElecQSTab_VdwLJEwCombLB_VF_ref },
163     { nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_VF_ref,
164       nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_VF_ref,
165       nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_VF_ref,
166       nbnxn_kernel_ElecQSTabTwinCut_VdwLJFsw_VF_ref,
167       nbnxn_kernel_ElecQSTabTwinCut_VdwLJPsw_VF_ref,
168       nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombGeom_VF_ref,
169       nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombLB_VF_ref },
170     { nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_VF_ref,
171       nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_VF_ref,
172       nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_VF_ref,
173       nbnxn_kernel_ElecQSTabTwinCut_VdwLJFsw_VF_ref,
174       nbnxn_kernel_ElecQSTabTwinCut_VdwLJPsw_VF_ref,
175       nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombGeom_VF_ref,
176       nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombLB_VF_ref },
177     { nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_VF_ref,
178       nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_VF_ref,
179       nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_VF_ref,
180       nbnxn_kernel_ElecQSTabTwinCut_VdwLJFsw_VF_ref,
181       nbnxn_kernel_ElecQSTabTwinCut_VdwLJPsw_VF_ref,
182       nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombGeom_VF_ref,
183       nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombLB_VF_ref }
184 };
185
186 static p_nbk_func_ener nbnxn_kernel_energrp_ref[coulktNR][vdwktNR_ref] = {
187     { nbnxn_kernel_ElecRF_VdwLJ_VgrpF_ref,
188       nbnxn_kernel_ElecRF_VdwLJ_VgrpF_ref,
189       nbnxn_kernel_ElecRF_VdwLJ_VgrpF_ref,
190       nbnxn_kernel_ElecRF_VdwLJFsw_VgrpF_ref,
191       nbnxn_kernel_ElecRF_VdwLJPsw_VgrpF_ref,
192       nbnxn_kernel_ElecRF_VdwLJEwCombGeom_VgrpF_ref,
193       nbnxn_kernel_ElecRF_VdwLJEwCombLB_VgrpF_ref },
194     { nbnxn_kernel_ElecQSTab_VdwLJ_VgrpF_ref,
195       nbnxn_kernel_ElecQSTab_VdwLJ_VgrpF_ref,
196       nbnxn_kernel_ElecQSTab_VdwLJ_VgrpF_ref,
197       nbnxn_kernel_ElecQSTab_VdwLJFsw_VgrpF_ref,
198       nbnxn_kernel_ElecQSTab_VdwLJPsw_VgrpF_ref,
199       nbnxn_kernel_ElecQSTab_VdwLJEwCombGeom_VgrpF_ref,
200       nbnxn_kernel_ElecQSTab_VdwLJEwCombLB_VgrpF_ref },
201     { nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_VgrpF_ref,
202       nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_VgrpF_ref,
203       nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_VgrpF_ref,
204       nbnxn_kernel_ElecQSTabTwinCut_VdwLJFsw_VgrpF_ref,
205       nbnxn_kernel_ElecQSTabTwinCut_VdwLJPsw_VgrpF_ref,
206       nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombGeom_VgrpF_ref,
207       nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombLB_VgrpF_ref },
208     { nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_VgrpF_ref,
209       nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_VgrpF_ref,
210       nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_VgrpF_ref,
211       nbnxn_kernel_ElecQSTabTwinCut_VdwLJFsw_VgrpF_ref,
212       nbnxn_kernel_ElecQSTabTwinCut_VdwLJPsw_VgrpF_ref,
213       nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombGeom_VgrpF_ref,
214       nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombLB_VgrpF_ref },
215     { nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_VgrpF_ref,
216       nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_VgrpF_ref,
217       nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_VgrpF_ref,
218       nbnxn_kernel_ElecQSTabTwinCut_VdwLJFsw_VgrpF_ref,
219       nbnxn_kernel_ElecQSTabTwinCut_VdwLJPsw_VgrpF_ref,
220       nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombGeom_VgrpF_ref,
221       nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombLB_VgrpF_ref }
222 };
223 //! \}
224
225 #endif /* INCLUDE_KERNELFUNCTION_TABLES */
226
227 #endif