dd9cdf8e8cf05040f45273fb233ac877441e0959
[alexxy/gromacs.git] / src / gromacs / gmxlib / nonbonded / nb_kernel_sparc64_hpc_ace_double / nb_kernel_template_sparc64_hpc_ace_double.pre
1 /* #if 0 */
2 /*
3  * This file is part of the GROMACS molecular simulation package.
4  *
5  * Copyright (c) 2012,2013,2014,2015,2017, 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 #error This file must be processed with the Gromacs pre-preprocessor
37 /* #endif */
38 /* #if INCLUDE_HEADER */
39 #include "gmxpre.h"
40
41 #include "config.h"
42
43 #include <math.h>
44
45 #include "../nb_kernel.h"
46 #include "gromacs/gmxlib/nrnb.h"
47
48 #include "kernelutil_sparc64_hpc_ace_double.h"
49 /* #endif */
50
51 /* ## List of variables set by the generating script:                                    */
52 /* ##                                                                                    */
53 /* ## Setttings that apply to the entire kernel:                                         */
54 /* ## KERNEL_ELEC:           String, choice for electrostatic interactions               */
55 /* ## KERNEL_VDW:            String, choice for van der Waals interactions               */
56 /* ## KERNEL_NAME:           String, name of this kernel                                 */
57 /* ## KERNEL_VF:             String telling if we calculate potential, force, or both    */
58 /* ## GEOMETRY_I/GEOMETRY_J: String, name of each geometry, e.g. 'Water3' or '1Particle' */
59 /* ##                                                                                    */
60 /* ## Setttings that apply to particles in the outer (I) or inner (J) loops:             */
61 /* ## PARTICLES_I[]/         Arrays with lists of i/j particles to use in kernel. It is  */
62 /* ## PARTICLES_J[]:         just [0] for particle geometry, but can be longer for water */
63 /* ## PARTICLES_ELEC_I[]/    Arrays with lists of i/j particle that have electrostatics  */
64 /* ## PARTICLES_ELEC_J[]:    interactions that should be calculated in this kernel.      */
65 /* ## PARTICLES_VDW_I[]/     Arrays with the list of i/j particle that have VdW          */
66 /* ## PARTICLES_VDW_J[]:     interactions that should be calculated in this kernel.      */
67 /* ##                                                                                    */
68 /* ## Setttings for pairs of interactions (e.g. 2nd i particle against 1st j particle)   */
69 /* ## PAIRS_IJ[]:            Array with (i,j) tuples of pairs for which interactions     */
70 /* ##                        should be calculated in this kernel. Zero-charge particles  */
71 /* ##                        do not have interactions with particles without vdw, and    */
72 /* ##                        Vdw-only interactions are not evaluated in a no-vdw-kernel. */
73 /* ## INTERACTION_FLAGS[][]: 2D matrix, dimension e.g. 3*3 for water-water interactions. */
74 /* ##                        For each i-j pair, the element [I][J] is a list of strings  */
75 /* ##                        defining properties/flags of this interaction. Examples     */
76 /* ##                        include 'electrostatics'/'vdw' if that type of interaction  */
77 /* ##                        should be evaluated, 'rsq'/'rinv'/'rinvsq' if those values  */
78 /* ##                        are needed, and 'exactcutoff' or 'shift','switch' to        */
79 /* ##                        decide if the force/potential should be modified. This way  */
80 /* ##                        we only calculate values absolutely needed for each case.   */
81
82 /* ## Calculate the size and offset for (merged/interleaved) table data */
83
84 /*
85  * Gromacs nonbonded kernel:   {KERNEL_NAME}
86  * Electrostatics interaction: {KERNEL_ELEC}
87  * VdW interaction:            {KERNEL_VDW}
88  * Geometry:                   {GEOMETRY_I}-{GEOMETRY_J}
89  * Calculate force/pot:        {KERNEL_VF}
90  */
91 void
92 {KERNEL_NAME}
93                     (t_nblist                    * gmx_restrict       nlist,
94                      rvec                        * gmx_restrict          xx,
95                      rvec                        * gmx_restrict          ff,
96                      struct t_forcerec           * gmx_restrict          fr,
97                      t_mdatoms                   * gmx_restrict     mdatoms,
98                      nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
99                      t_nrnb                      * gmx_restrict        nrnb)
100 {
101     /* ## Not all variables are used for all kernels, but any optimizing compiler fixes that, */
102     /* ## so there is no point in going to extremes to exclude variables that are not needed. */
103     /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
104      * just 0 for non-waters.
105      * Suffixes A,B refer to j loop unrolling done with double precision SIMD, e.g. for the two different
106      * jnr indices corresponding to data put in the four positions in the SIMD register.
107      */
108     int              i_shift_offset,i_coord_offset,outeriter,inneriter;
109     int              j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
110     int              jnrA,jnrB;
111     int              j_coord_offsetA,j_coord_offsetB;
112     int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
113     real             rcutoff_scalar;
114     real             *shiftvec,*fshift,*x,*f;
115     _fjsp_v2r8       tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
116     /* #for I in PARTICLES_I */
117     int              vdwioffset{I};
118     _fjsp_v2r8       ix{I},iy{I},iz{I},fix{I},fiy{I},fiz{I},iq{I},isai{I};
119     /* #endfor */
120     /* #for J in PARTICLES_J */
121     int              vdwjidx{J}A,vdwjidx{J}B;
122     _fjsp_v2r8       jx{J},jy{J},jz{J},fjx{J},fjy{J},fjz{J},jq{J},isaj{J};
123     /* #endfor */
124     /* #for I,J in PAIRS_IJ */
125     _fjsp_v2r8       dx{I}{J},dy{I}{J},dz{I}{J},rsq{I}{J},rinv{I}{J},rinvsq{I}{J},r{I}{J},qq{I}{J},c6_{I}{J},c12_{I}{J};
126     /* #endfor */
127     /* #if KERNEL_ELEC != 'None' */
128     _fjsp_v2r8       velec,felec,velecsum,facel,crf,krf,krf2;
129     real             *charge;
130     /* #endif */
131     /* #if 'GeneralizedBorn' in KERNEL_ELEC */
132     _fjsp_v2r8       vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,dvdaj,gbeps,twogbeps,dvdatmp;
133     _fjsp_v2r8       minushalf = gmx_fjsp_set1_v2r8(-0.5);
134     real             *invsqrta,*dvda,*gbtab;
135     /* #endif */
136     /* #if KERNEL_VDW != 'None' */
137     int              nvdwtype;
138     _fjsp_v2r8       rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
139     int              *vdwtype;
140     real             *vdwparam;
141     _fjsp_v2r8       one_sixth   = gmx_fjsp_set1_v2r8(1.0/6.0);
142     _fjsp_v2r8       one_twelfth = gmx_fjsp_set1_v2r8(1.0/12.0);
143     /* #endif */
144     /* #if 'Table' in KERNEL_ELEC or 'GeneralizedBorn' in KERNEL_ELEC or 'Table' in KERNEL_VDW */
145     _fjsp_v2r8       rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF,twovfeps;
146     real             *vftab;
147     /* #endif */
148     /* #if 'LJEwald' in KERNEL_VDW */
149     /* #for I,J in PAIRS_IJ */
150     _fjsp_v2r8           c6grid_{I}{J};
151     /* #endfor */
152     real                 *vdwgridparam;
153     _fjsp_v2r8           ewclj,ewclj2,ewclj6,ewcljrsq,poly,exponent,f6A,f6B,sh_lj_ewald;
154     _fjsp_v2r8           one_half = gmx_fjsp_set1_v2r8(0.5);
155     _fjsp_v2r8           minus_one = gmx_fjsp_set1_v2r8(-1.0);
156     /* #endif */
157     /* #if 'Ewald' in KERNEL_ELEC */
158     _fjsp_v2r8       ewtabscale,eweps,sh_ewald,ewrt,ewtabhalfspace,ewtabF,ewtabFn,ewtabD,ewtabV;
159     real             *ewtab;
160     /* #endif */
161     /* #if 'PotentialSwitch' in [KERNEL_MOD_ELEC,KERNEL_MOD_VDW] */
162     _fjsp_v2r8       rswitch,swV3,swV4,swV5,swF2,swF3,swF4,d,d2,sw,dsw;
163     real             rswitch_scalar,d_scalar;
164     /* #endif */
165     _fjsp_v2r8       itab_tmp;
166     _fjsp_v2r8       dummy_mask,cutoff_mask;
167     _fjsp_v2r8       one     = gmx_fjsp_set1_v2r8(1.0);
168     _fjsp_v2r8       two     = gmx_fjsp_set1_v2r8(2.0);
169     union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
170
171     x                = xx[0];
172     f                = ff[0];
173
174     nri              = nlist->nri;
175     iinr             = nlist->iinr;
176     jindex           = nlist->jindex;
177     jjnr             = nlist->jjnr;
178     shiftidx         = nlist->shift;
179     gid              = nlist->gid;
180     shiftvec         = fr->shift_vec[0];
181     fshift           = fr->fshift[0];
182     /* #if KERNEL_ELEC != 'None' */
183     facel            = gmx_fjsp_set1_v2r8(fr->ic->epsfac);
184     charge           = mdatoms->chargeA;
185     /*     #if 'ReactionField' in KERNEL_ELEC */
186     krf              = gmx_fjsp_set1_v2r8(fr->ic->k_rf);
187     krf2             = gmx_fjsp_set1_v2r8(fr->ic->k_rf*2.0);
188     crf              = gmx_fjsp_set1_v2r8(fr->ic->c_rf);
189     /*     #endif */
190     /* #endif */
191     /* #if KERNEL_VDW != 'None' */
192     nvdwtype         = fr->ntype;
193     vdwparam         = fr->nbfp;
194     vdwtype          = mdatoms->typeA;
195     /* #endif */
196     /* #if 'LJEwald' in KERNEL_VDW */
197     vdwgridparam     = fr->ljpme_c6grid;
198     sh_lj_ewald      = gmx_fjsp_set1_v2r8(fr->ic->sh_lj_ewald);
199     ewclj            = gmx_fjsp_set1_v2r8(fr->ic->ewaldcoeff_lj);
200     ewclj2           = _fjsp_mul_v2r8(minus_one,_fjsp_mul_v2r8(ewclj,ewclj));
201     /* #endif */
202
203     /* #if 'Table' in KERNEL_ELEC and 'Table' in KERNEL_VDW */
204     vftab            = kernel_data->table_elec_vdw->data;
205     vftabscale       = gmx_fjsp_set1_v2r8(kernel_data->table_elec_vdw->scale);
206     /* #elif 'Table' in KERNEL_ELEC */
207     vftab            = kernel_data->table_elec->data;
208     vftabscale       = gmx_fjsp_set1_v2r8(kernel_data->table_elec->scale);
209     /* #elif 'Table' in KERNEL_VDW */
210     vftab            = kernel_data->table_vdw->data;
211     vftabscale       = gmx_fjsp_set1_v2r8(kernel_data->table_vdw->scale);
212     /* #endif */
213
214     /* #if 'Ewald' in KERNEL_ELEC */
215     sh_ewald         = gmx_fjsp_set1_v2r8(fr->ic->sh_ewald);
216     /*     #if KERNEL_VF=='Force' and KERNEL_MOD_ELEC!='PotentialSwitch' */
217     ewtab            = fr->ic->tabq_coul_F;
218     ewtabscale       = gmx_fjsp_set1_v2r8(fr->ic->tabq_scale);
219     ewtabhalfspace   = gmx_fjsp_set1_v2r8(0.5/fr->ic->tabq_scale);
220     /*     #else */
221     ewtab            = fr->ic->tabq_coul_FDV0;
222     ewtabscale       = gmx_fjsp_set1_v2r8(fr->ic->tabq_scale);
223     ewtabhalfspace   = gmx_fjsp_set1_v2r8(0.5/fr->ic->tabq_scale);
224      /*     #endif */
225     /* #endif */
226
227     /* #if KERNEL_ELEC=='GeneralizedBorn' */
228     invsqrta         = fr->invsqrta;
229     dvda             = fr->dvda;
230     gbtabscale       = gmx_fjsp_set1_v2r8(fr->gbtab->scale);
231     gbtab            = fr->gbtab->data;
232     gbinvepsdiff     = gmx_fjsp_set1_v2r8((1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
233     /* #endif */
234
235     /* #if 'Water' in GEOMETRY_I */
236     /* Setup water-specific parameters */
237     inr              = nlist->iinr[0];
238     /*     #for I in PARTICLES_ELEC_I */
239     iq{I}              = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+{I}]));
240     /*     #endfor */
241     /*     #for I in PARTICLES_VDW_I */
242     vdwioffset{I}      = 2*nvdwtype*vdwtype[inr+{I}];
243     /*     #endfor */
244     /* #endif */
245
246     /* #if 'Water' in GEOMETRY_J */
247     /*     #for J in PARTICLES_ELEC_J */
248     jq{J}              = gmx_fjsp_set1_v2r8(charge[inr+{J}]);
249     /*     #endfor */
250     /*     #for J in PARTICLES_VDW_J */
251     vdwjidx{J}A        = 2*vdwtype[inr+{J}];
252     /*     #endfor */
253     /*     #for I,J in PAIRS_IJ */
254     /*         #if 'electrostatics' in INTERACTION_FLAGS[I][J] */
255     qq{I}{J}             = _fjsp_mul_v2r8(iq{I},jq{J});
256     /*         #endif */
257     /*         #if 'vdw' in INTERACTION_FLAGS[I][J] */
258     /*             #if 'LJEwald' in KERNEL_VDW */
259     c6_{I}{J}            = gmx_fjsp_set1_v2r8(vdwparam[vdwioffset{I}+vdwjidx{J}A]);
260     c12_{I}{J}           = gmx_fjsp_set1_v2r8(vdwparam[vdwioffset{I}+vdwjidx{J}A+1]);
261     c6grid_{I}{J}        = gmx_fjsp_set1_v2r8(vdwgridparam[vdwioffset{I}+vdwjidx{J}A]);
262     /*             #else */
263     c6_{I}{J}            = gmx_fjsp_set1_v2r8(vdwparam[vdwioffset{I}+vdwjidx{J}A]);
264     c12_{I}{J}           = gmx_fjsp_set1_v2r8(vdwparam[vdwioffset{I}+vdwjidx{J}A+1]);
265     /*             #endif */
266     /*         #endif */
267     /*     #endfor */
268     /* #endif */
269
270     /* #if KERNEL_MOD_ELEC!='None' or KERNEL_MOD_VDW!='None' */
271     /*     #if KERNEL_ELEC!='None' */
272     /* When we use explicit cutoffs the value must be identical for elec and VdW, so use elec as an arbitrary choice */
273     rcutoff_scalar   = fr->ic->rcoulomb;
274     /*     #else */
275     rcutoff_scalar   = fr->ic->rvdw;
276     /*     #endif */
277     rcutoff          = gmx_fjsp_set1_v2r8(rcutoff_scalar);
278     rcutoff2         = _fjsp_mul_v2r8(rcutoff,rcutoff);
279     /* #endif */
280
281     /* #if KERNEL_MOD_VDW=='PotentialShift' */
282     sh_vdw_invrcut6  = gmx_fjsp_set1_v2r8(fr->ic->sh_invrc6);
283     rvdw             = gmx_fjsp_set1_v2r8(fr->ic->rvdw);
284     /* #endif */
285
286     /* #if 'PotentialSwitch' in [KERNEL_MOD_ELEC,KERNEL_MOD_VDW] */
287     /*     #if KERNEL_MOD_ELEC=='PotentialSwitch'  */
288     rswitch_scalar   = fr->ic->rcoulomb_switch;
289     rswitch          = gmx_fjsp_set1_v2r8(rswitch_scalar);
290     /*     #else */
291     rswitch_scalar   = fr->ic->rvdw_switch;
292     rswitch          = gmx_fjsp_set1_v2r8(rswitch_scalar);
293     /*     #endif */
294     /* Setup switch parameters */
295     d_scalar         = rcutoff_scalar-rswitch_scalar;
296     d                = gmx_fjsp_set1_v2r8(d_scalar);
297     swV3             = gmx_fjsp_set1_v2r8(-10.0/(d_scalar*d_scalar*d_scalar));
298     swV4             = gmx_fjsp_set1_v2r8( 15.0/(d_scalar*d_scalar*d_scalar*d_scalar));
299     swV5             = gmx_fjsp_set1_v2r8( -6.0/(d_scalar*d_scalar*d_scalar*d_scalar*d_scalar));
300     /*     #if 'Force' in KERNEL_VF */
301     swF2             = gmx_fjsp_set1_v2r8(-30.0/(d_scalar*d_scalar*d_scalar));
302     swF3             = gmx_fjsp_set1_v2r8( 60.0/(d_scalar*d_scalar*d_scalar*d_scalar));
303     swF4             = gmx_fjsp_set1_v2r8(-30.0/(d_scalar*d_scalar*d_scalar*d_scalar*d_scalar));
304     /*     #endif */
305     /* #endif */
306
307     /* Avoid stupid compiler warnings */
308     jnrA = jnrB = 0;
309     j_coord_offsetA = 0;
310     j_coord_offsetB = 0;
311
312     /* ## Keep track of the floating point operations we issue for reporting! */
313     /* #define OUTERFLOPS 0 */
314     outeriter        = 0;
315     inneriter        = 0;
316
317     /* Start outer loop over neighborlists */
318     for(iidx=0; iidx<nri; iidx++)
319     {
320         /* Load shift vector for this list */
321         i_shift_offset   = DIM*shiftidx[iidx];
322
323         /* Load limits for loop over neighbors */
324         j_index_start    = jindex[iidx];
325         j_index_end      = jindex[iidx+1];
326
327         /* Get outer coordinate index */
328         inr              = iinr[iidx];
329         i_coord_offset   = DIM*inr;
330
331         /* Load i particle coords and add shift vector */
332         /* #if GEOMETRY_I == 'Particle' */
333         gmx_fjsp_load_shift_and_1rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
334         /* #elif GEOMETRY_I == 'Water3' */
335         gmx_fjsp_load_shift_and_3rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,
336                                                  &ix0,&iy0,&iz0,&ix1,&iy1,&iz1,&ix2,&iy2,&iz2);
337         /* #elif GEOMETRY_I == 'Water4' */
338         /*     #if 0 in PARTICLES_I                 */
339         gmx_fjsp_load_shift_and_4rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,
340                                                  &ix0,&iy0,&iz0,&ix1,&iy1,&iz1,&ix2,&iy2,&iz2,&ix3,&iy3,&iz3);
341         /*     #else                                */
342         gmx_fjsp_load_shift_and_3rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset+DIM,
343                                                  &ix1,&iy1,&iz1,&ix2,&iy2,&iz2,&ix3,&iy3,&iz3);
344         /*     #endif                               */
345         /* #endif                                   */
346
347         /* #if 'Force' in KERNEL_VF */
348         /*     #for I in PARTICLES_I */
349         fix{I}             = _fjsp_setzero_v2r8();
350         fiy{I}             = _fjsp_setzero_v2r8();
351         fiz{I}             = _fjsp_setzero_v2r8();
352         /*     #endfor */
353         /* #endif */
354
355         /* ## For water we already preloaded parameters at the start of the kernel */
356         /* #if not 'Water' in GEOMETRY_I */
357         /* Load parameters for i particles */
358         /*     #for I in PARTICLES_ELEC_I */
359         iq{I}              = _fjsp_mul_v2r8(facel,gmx_fjsp_load1_v2r8(charge+inr+{I}));
360         /*         #define OUTERFLOPS OUTERFLOPS+1 */
361         /*         #if KERNEL_ELEC=='GeneralizedBorn' */
362         isai{I}            = gmx_fjsp_load1_v2r8(invsqrta+inr+{I});
363         /*         #endif */
364         /*     #endfor */
365         /*     #for I in PARTICLES_VDW_I */
366         vdwioffset{I}      = 2*nvdwtype*vdwtype[inr+{I}];
367         /*     #endfor */
368         /* #endif */
369
370         /* #if 'Potential' in KERNEL_VF */
371         /* Reset potential sums */
372         /*     #if KERNEL_ELEC != 'None' */
373         velecsum         = _fjsp_setzero_v2r8();
374         /*     #endif */
375         /*     #if 'GeneralizedBorn' in KERNEL_ELEC */
376         vgbsum           = _fjsp_setzero_v2r8();
377         /*     #endif */
378         /*     #if KERNEL_VDW != 'None' */
379         vvdwsum          = _fjsp_setzero_v2r8();
380         /*     #endif */
381         /* #endif */
382         /*     #if 'GeneralizedBorn' in KERNEL_ELEC and 'Force' in KERNEL_VF */
383         dvdasum          = _fjsp_setzero_v2r8();
384         /*     #endif */
385
386         /* #for ROUND in ['Loop','Epilogue'] */
387
388         /* #if ROUND =='Loop' */
389         /* Start inner kernel loop */
390         for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
391         {
392         /* ## First round is normal loop (next statement resets indentation) */
393         /*     #if 0 */
394         }
395         /*     #endif */
396         /* #else */
397         if(jidx<j_index_end)
398         {
399         /* ## Second round is epilogue */
400         /* #endif */
401         /* #define INNERFLOPS 0 */
402
403             /* #if ROUND =='Loop' */
404             /* Get j neighbor index, and coordinate index */
405             jnrA             = jjnr[jidx];
406             jnrB             = jjnr[jidx+1];
407             j_coord_offsetA  = DIM*jnrA;
408             j_coord_offsetB  = DIM*jnrB;
409
410             /* load j atom coordinates */
411             /*     #if GEOMETRY_J == 'Particle'             */
412             gmx_fjsp_load_1rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
413                                               &jx0,&jy0,&jz0);
414             /*     #elif GEOMETRY_J == 'Water3'             */
415             gmx_fjsp_load_3rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
416                                               &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,&jy2,&jz2);
417             /*     #elif GEOMETRY_J == 'Water4'             */
418             /*         #if 0 in PARTICLES_J                 */
419             gmx_fjsp_load_4rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
420                                               &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,
421                                               &jy2,&jz2,&jx3,&jy3,&jz3);
422             /*         #else                                */
423             gmx_fjsp_load_3rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA+DIM,x+j_coord_offsetB+DIM,
424                                               &jx1,&jy1,&jz1,&jx2,&jy2,&jz2,&jx3,&jy3,&jz3);
425             /*         #endif                               */
426             /*     #endif                                   */
427             /* #else */
428             jnrA             = jjnr[jidx];
429             j_coord_offsetA  = DIM*jnrA;
430
431             /* load j atom coordinates */
432             /*     #if GEOMETRY_J == 'Particle'             */
433             gmx_fjsp_load_1rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
434                                               &jx0,&jy0,&jz0);
435             /*     #elif GEOMETRY_J == 'Water3'             */
436             gmx_fjsp_load_3rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
437                                               &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,&jy2,&jz2);
438             /*     #elif GEOMETRY_J == 'Water4'             */
439             /*         #if 0 in PARTICLES_J                 */
440             gmx_fjsp_load_4rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
441                                               &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,
442                                               &jy2,&jz2,&jx3,&jy3,&jz3);
443             /*         #else                                */
444             gmx_fjsp_load_3rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA+DIM,
445                                               &jx1,&jy1,&jz1,&jx2,&jy2,&jz2,&jx3,&jy3,&jz3);
446             /*         #endif                               */
447             /*     #endif                                   */
448             /* #endif */
449
450             /* Calculate displacement vector */
451             /* #for I,J in PAIRS_IJ */
452             dx{I}{J}             = _fjsp_sub_v2r8(ix{I},jx{J});
453             dy{I}{J}             = _fjsp_sub_v2r8(iy{I},jy{J});
454             dz{I}{J}             = _fjsp_sub_v2r8(iz{I},jz{J});
455             /*     #define INNERFLOPS INNERFLOPS+3 */
456             /* #endfor */
457
458             /* Calculate squared distance and things based on it */
459             /* #for I,J in PAIRS_IJ */
460             rsq{I}{J}            = gmx_fjsp_calc_rsq_v2r8(dx{I}{J},dy{I}{J},dz{I}{J});
461             /*     #define INNERFLOPS INNERFLOPS+5 */
462             /* #endfor */
463
464             /* #for I,J in PAIRS_IJ */
465             /*     #if 'rinv' in INTERACTION_FLAGS[I][J] */
466             rinv{I}{J}           = gmx_fjsp_invsqrt_v2r8(rsq{I}{J});
467             /*         #define INNERFLOPS INNERFLOPS+5 */
468             /*     #endif */
469             /* #endfor */
470
471             /* #for I,J in PAIRS_IJ */
472             /*     #if 'rinvsq' in INTERACTION_FLAGS[I][J] */
473             /*         # if 'rinv' not in INTERACTION_FLAGS[I][J] */
474             rinvsq{I}{J}         = gmx_fjsp_inv_v2r8(rsq{I}{J});
475             /*             #define INNERFLOPS INNERFLOPS+4 */
476             /*         #else */
477             rinvsq{I}{J}         = _fjsp_mul_v2r8(rinv{I}{J},rinv{I}{J});
478             /*             #define INNERFLOPS INNERFLOPS+1 */
479             /*         #endif */
480             /*     #endif */
481             /* #endfor */
482
483             /* #if not 'Water' in GEOMETRY_J */
484             /* Load parameters for j particles */
485             /*     #for J in PARTICLES_ELEC_J */
486             /*         #if ROUND =='Loop' */
487             jq{J}              = gmx_fjsp_load_2real_swizzle_v2r8(charge+jnrA+{J},charge+jnrB+{J});
488             /*         #else */
489             jq{J}              = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(),charge+jnrA+{J});
490             /*         #endif */
491             /*         #if KERNEL_ELEC=='GeneralizedBorn' */
492             /*             #if ROUND =='Loop' */
493             isaj{J}            = gmx_fjsp_load_2real_swizzle_v2r8(invsqrta+jnrA+{J},invsqrta+jnrB+{J});
494             /*             #else */
495             isaj{J}            = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(),invsqrta+jnrA+{J});
496             /*             #endif */
497             /*         #endif */
498             /*     #endfor */
499             /*     #for J in PARTICLES_VDW_J */
500             vdwjidx{J}A        = 2*vdwtype[jnrA+{J}];
501             /*         #if ROUND =='Loop' */
502             vdwjidx{J}B        = 2*vdwtype[jnrB+{J}];
503             /*         #endif */
504             /*     #endfor */
505             /* #endif */
506
507             /* #if 'Force' in KERNEL_VF and not 'Particle' in GEOMETRY_I */
508             /*     #for J in PARTICLES_J */
509             fjx{J}             = _fjsp_setzero_v2r8();
510             fjy{J}             = _fjsp_setzero_v2r8();
511             fjz{J}             = _fjsp_setzero_v2r8();
512             /*     #endfor */
513             /* #endif */
514
515             /* #for I,J in PAIRS_IJ */
516
517             /**************************
518              * CALCULATE INTERACTIONS *
519              **************************/
520
521             /*     #if 'exactcutoff' in INTERACTION_FLAGS[I][J] */
522             /*         ## We always calculate rinv/rinvsq above to enable pipelineing in compilers (performance tested on x86) */
523             if (gmx_fjsp_any_lt_v2r8(rsq{I}{J},rcutoff2))
524             {
525                 /*     #if 0    ## this and the next two lines is a hack to maintain auto-indentation in template file */
526             }
527             /*         #endif */
528             /*         #define INNERFLOPS INNERFLOPS+1 */
529             /*     #endif */
530
531             /*     #if 'r' in INTERACTION_FLAGS[I][J] */
532             r{I}{J}              = _fjsp_mul_v2r8(rsq{I}{J},rinv{I}{J});
533              /*         #define INNERFLOPS INNERFLOPS+1 */
534             /*     #endif */
535
536             /*     ## For water geometries we already loaded parameters at the start of the kernel */
537             /*     #if not 'Water' in GEOMETRY_J */
538             /* Compute parameters for interactions between i and j atoms */
539             /*         #if 'electrostatics' in INTERACTION_FLAGS[I][J] */
540             qq{I}{J}             = _fjsp_mul_v2r8(iq{I},jq{J});
541             /*             #define INNERFLOPS INNERFLOPS+1 */
542             /*         #endif */
543             /*         #if 'vdw' in INTERACTION_FLAGS[I][J] */
544             gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset{I}+vdwjidx{J}A,
545                                          vdwparam+vdwioffset{I}+vdwjidx{J}B,&c6_{I}{J},&c12_{I}{J});
546
547             /*             #if 'LJEwald' in KERNEL_VDW */
548             c6grid_{I}{J}       = gmx_fjsp_load_2real_swizzle_v2r8(vdwgridparam+vdwioffset{I}+vdwjidx{J}A,
549                                                                    vdwgridparam+vdwioffset{I}+vdwjidx{J}B);
550             /*             #endif */
551             /*         #endif */
552             /*     #endif */
553
554             /*     #if 'table' in INTERACTION_FLAGS[I][J] */
555             /* Calculate table index by multiplying r with table scale and truncate to integer */
556             rt               = _fjsp_mul_v2r8(r{I}{J},vftabscale);
557             itab_tmp         = _fjsp_dtox_v2r8(rt);
558             vfeps            = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
559             twovfeps         = _fjsp_add_v2r8(vfeps,vfeps);
560             _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
561
562             /*         #define INNERFLOPS INNERFLOPS+4                          */
563             /*         #if 'Table' in KERNEL_ELEC and 'Table' in KERNEL_VDW     */
564             /*             ## 3 tables, 4 data per point: multiply index by 12 */
565             vfconv.i[0]     *= 12;
566             vfconv.i[1]     *= 12;
567             /*         #elif 'Table' in KERNEL_ELEC                             */
568             /*             ## 1 table, 4 data per point: multiply index by 4   */
569             vfconv.i[0]     *= 4;
570             vfconv.i[1]     *= 4;
571             /*         #elif 'Table' in KERNEL_VDW                              */
572             /*             ## 2 tables, 4 data per point: multiply index by 8  */
573             vfconv.i[0]     *= 8;
574             vfconv.i[1]     *= 8;
575             /*         #endif                                                   */
576             /*     #endif */
577
578             /*     ## ELECTROSTATIC INTERACTIONS */
579             /*     #if 'electrostatics' in INTERACTION_FLAGS[I][J] */
580
581             /*         #if KERNEL_ELEC=='Coulomb' */
582
583             /* COULOMB ELECTROSTATICS */
584             velec            = _fjsp_mul_v2r8(qq{I}{J},rinv{I}{J});
585             /*             #define INNERFLOPS INNERFLOPS+1 */
586             /*             #if 'Force' in KERNEL_VF */
587             felec            = _fjsp_mul_v2r8(velec,rinvsq{I}{J});
588             /*                 #define INNERFLOPS INNERFLOPS+2 */
589             /*             #endif */
590
591             /*         #elif KERNEL_ELEC=='ReactionField' */
592
593             /* REACTION-FIELD ELECTROSTATICS */
594             /*             #if 'Potential' in KERNEL_VF */
595             velec            = _fjsp_mul_v2r8(qq{I}{J},_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq{I}{J},rinv{I}{J}),crf));
596             /*                 #define INNERFLOPS INNERFLOPS+4 */
597             /*             #endif */
598             /*             #if 'Force' in KERNEL_VF */
599             felec            = _fjsp_mul_v2r8(qq{I}{J},_fjsp_msub_v2r8(rinv{I}{J},rinvsq{I}{J},krf2));
600             /*                 #define INNERFLOPS INNERFLOPS+3 */
601             /*             #endif */
602
603             /*         #elif KERNEL_ELEC=='GeneralizedBorn' */
604
605             /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
606             isaprod          = _fjsp_mul_v2r8(isai{I},isaj{J});
607             gbqqfactor       = _fjsp_neg_v2r8(_fjsp_mul_v2r8(qq{I}{J},_fjsp_mul_v2r8(isaprod,gbinvepsdiff)));
608             gbscale          = _fjsp_mul_v2r8(isaprod,gbtabscale);
609             /*             #define INNERFLOPS INNERFLOPS+5 */
610
611             /* Calculate generalized born table index - this is a separate table from the normal one,
612              * but we use the same procedure by multiplying r with scale and truncating to integer.
613              */
614             rt               = _fjsp_mul_v2r8(r{I}{J},gbscale);
615             itab_tmp         = _fjsp_dtox_v2r8(rt);
616             gbeps            = _fjsp_sub_v2r8(rt,_fjsp_xtod_v2r8(itab_tmp));
617             _fjsp_store_v2r8(&gbconv.simd,itab_tmp);
618
619             Y                = _fjsp_load_v2r8( gbtab + 4*gbconv.i[0] );
620             /*             #if ROUND == 'Loop' */
621             F                = _fjsp_load_v2r8( gbtab + 4*gbconv.i[1] );
622             /*             #else */
623             F                = _fjsp_setzero_v2r8();
624             /*             #endif */
625             GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
626             G                = _fjsp_load_v2r8( gbtab + 4*gbconv.i[0] +2);
627             /*             #if ROUND == 'Loop' */
628             H                = _fjsp_load_v2r8( gbtab + 4*gbconv.i[1] +2);
629             /*             #else */
630             H                = _fjsp_setzero_v2r8();
631             /*             #endif */
632             GMX_FJSP_TRANSPOSE2_V2R8(G,H);
633             Fp               = _fjsp_madd_v2r8(gbeps,_fjsp_madd_v2r8(gbeps,H,G),F);
634             VV               = _fjsp_madd_v2r8(gbeps,Fp,Y);
635             vgb              = _fjsp_mul_v2r8(gbqqfactor,VV);
636             /*             #define INNERFLOPS INNERFLOPS+10 */
637
638             /*             #if 'Force' in KERNEL_VF */
639             twogbeps         = _fjsp_add_v2r8(gbeps,gbeps);
640             FF               = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twogbeps,H,G),gbeps,Fp);
641             fgb              = _fjsp_mul_v2r8(gbqqfactor,_fjsp_mul_v2r8(FF,gbscale));
642             dvdatmp          = _fjsp_mul_v2r8(minushalf,_fjsp_madd_v2r8(fgb,r{I}{J},vgb));
643             dvdasum          = _fjsp_add_v2r8(dvdasum,dvdatmp);
644             /*             #if ROUND == 'Loop' */
645             gmx_fjsp_increment_2real_swizzle_v2r8(dvda+jnrA,dvda+jnrB,_fjsp_mul_v2r8(dvdatmp,_fjsp_mul_v2r8(isaj{J},isaj{J})));
646             /*             #else */
647             gmx_fjsp_increment_1real_v2r8(dvda+jnrA,_fjsp_mul_v2r8(dvdatmp,_fjsp_mul_v2r8(isaj{J},isaj{J})));
648             /*             #endif */
649             /*                 #define INNERFLOPS INNERFLOPS+13 */
650             /*             #endif */
651             velec            = _fjsp_mul_v2r8(qq{I}{J},rinv{I}{J});
652             /*                 #define INNERFLOPS INNERFLOPS+1 */
653             /*             #if 'Force' in KERNEL_VF */
654             felec            = _fjsp_mul_v2r8(_fjsp_msub_v2r8(velec,rinv{I}{J},fgb),rinv{I}{J});
655             /*                 #define INNERFLOPS INNERFLOPS+3 */
656             /*             #endif */
657
658             /*         #elif KERNEL_ELEC=='Ewald' */
659             /* EWALD ELECTROSTATICS */
660
661             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
662             ewrt             = _fjsp_mul_v2r8(r{I}{J},ewtabscale);
663             itab_tmp         = _fjsp_dtox_v2r8(ewrt);
664             eweps            = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
665             _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
666
667             /*             #define INNERFLOPS INNERFLOPS+4 */
668             /*             #if 'Potential' in KERNEL_VF or KERNEL_MOD_ELEC=='PotentialSwitch' */
669             ewtabF           = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
670             /*                 #if ROUND == 'Loop' */
671             ewtabD           = _fjsp_load_v2r8( ewtab + 4*ewconv.i[1] );
672             /*                 #else */
673             ewtabD           = _fjsp_setzero_v2r8();
674             /*                 #endif */
675             GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
676             ewtabV           = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
677             /*                 #if ROUND == 'Loop' */
678             ewtabFn          = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[1] +2);
679             /*                 #else */
680             ewtabFn          = _fjsp_setzero_v2r8();
681             /*                 #endif */
682             GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
683             felec            = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
684             /*                 #define INNERFLOPS INNERFLOPS+2 */
685             /*                 #if KERNEL_MOD_ELEC=='PotentialShift' */            
686             velec            = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
687             velec            = _fjsp_mul_v2r8(qq{I}{J},_fjsp_sub_v2r8(_fjsp_sub_v2r8(rinv{I}{J},sh_ewald),velec));
688             /*                     #define INNERFLOPS INNERFLOPS+7 */
689             /*                 #else */
690             velec            = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
691             velec            = _fjsp_mul_v2r8(qq{I}{J},_fjsp_sub_v2r8(rinv{I}{J},velec));
692             /*                     #define INNERFLOPS INNERFLOPS+6 */
693             /*                 #endif */
694             /*                 #if 'Force' in KERNEL_VF */
695             felec            = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq{I}{J},rinv{I}{J}),_fjsp_sub_v2r8(rinvsq{I}{J},felec));
696             /*                      #define INNERFLOPS INNERFLOPS+3 */
697             /*                 #endif */
698             /*             #elif KERNEL_VF=='Force' */
699             /*                 #if ROUND == 'Loop' */
700             gmx_fjsp_load_2pair_swizzle_v2r8(ewtab+ewconv.i[0],ewtab+ewconv.i[1],
701                                          &ewtabF,&ewtabFn);
702             /*                 #else */
703             gmx_fjsp_load_1pair_swizzle_v2r8(ewtab+ewconv.i[0],&ewtabF,&ewtabFn);
704             /*                 #endif */
705             felec            = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
706             felec            = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq{I}{J},rinv{I}{J}),_fjsp_sub_v2r8(rinvsq{I}{J},felec));
707             /*                 #define INNERFLOPS INNERFLOPS+7 */
708             /*             #endif */
709
710             /*         #elif KERNEL_ELEC=='CubicSplineTable' */
711
712             /* CUBIC SPLINE TABLE ELECTROSTATICS */
713             Y                = _fjsp_load_v2r8( vftab + vfconv.i[0] );
714             /*             #if ROUND == 'Loop' */
715             F                = _fjsp_load_v2r8( vftab + vfconv.i[1] );
716             /*             #else */
717             F                = _fjsp_setzero_v2r8();
718             /*             #endif */
719             GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
720             G                = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
721             /*             #if ROUND == 'Loop' */
722             H                = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
723             /*             #else */
724             H                = _fjsp_setzero_v2r8();
725             /*             #endif */
726             GMX_FJSP_TRANSPOSE2_V2R8(G,H);
727             Fp               = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
728             /*             #define INNERFLOPS INNERFLOPS+4 */
729             /*             #if 'Potential' in KERNEL_VF */
730             VV               = _fjsp_madd_v2r8(vfeps,Fp,Y);
731             velec            = _fjsp_mul_v2r8(qq{I}{J},VV);
732             /*                 #define INNERFLOPS INNERFLOPS+3 */
733             /*             #endif */
734             /*             #if 'Force' in KERNEL_VF */
735             FF               = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
736             felec            = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq{I}{J},FF),_fjsp_mul_v2r8(vftabscale,rinv{I}{J})));
737             /*                 #define INNERFLOPS INNERFLOPS+7 */
738             /*             #endif */
739             /*         #endif */
740             /*         ## End of check for electrostatics interaction forms */
741             /*     #endif */
742             /*     ## END OF ELECTROSTATIC INTERACTION CHECK FOR PAIR I-J */
743
744             /*     #if 'vdw' in INTERACTION_FLAGS[I][J] */
745
746             /*         #if KERNEL_VDW=='LennardJones' */
747
748             /* LENNARD-JONES DISPERSION/REPULSION */
749
750             rinvsix          = _fjsp_mul_v2r8(_fjsp_mul_v2r8(rinvsq{I}{J},rinvsq{I}{J}),rinvsq{I}{J});
751             /*             #define INNERFLOPS INNERFLOPS+2 */
752             /*             #if 'Potential' in KERNEL_VF or KERNEL_MOD_VDW=='PotentialSwitch' */
753             vvdw6            = _fjsp_mul_v2r8(c6_{I}{J},rinvsix);
754             vvdw12           = _fjsp_mul_v2r8(c12_{I}{J},_fjsp_mul_v2r8(rinvsix,rinvsix));
755             /*                 #define INNERFLOPS INNERFLOPS+3 */
756             /*                 #if KERNEL_MOD_VDW=='PotentialShift' */
757             vvdw             = _fjsp_msub_v2r8(_fjsp_nmsub_v2r8(c12_{I}{J},_fjsp_mul_v2r8(sh_vdw_invrcut6,sh_vdw_invrcut6),vvdw12),one_twelfth,
758                                            _fjsp_mul_v2r8(_fjsp_nmsub_v2r8( c6_{I}{J},sh_vdw_invrcut6,vvdw6),one_sixth));
759             /*                     #define INNERFLOPS INNERFLOPS+8 */
760             /*                 #else */
761             vvdw             = _fjsp_msub_v2r8( vvdw12,one_twelfth, _fjsp_mul_v2r8(vvdw6,one_sixth) );
762             /*                     #define INNERFLOPS INNERFLOPS+3 */
763             /*                 #endif */
764             /*                 ## Check for force inside potential check, i.e. this means we already did the potential part */
765             /*                 #if 'Force' in KERNEL_VF */
766             fvdw             = _fjsp_mul_v2r8(_fjsp_sub_v2r8(vvdw12,vvdw6),rinvsq{I}{J});
767             /*                     #define INNERFLOPS INNERFLOPS+2 */
768             /*                 #endif */
769             /*             #elif KERNEL_VF=='Force' */
770             /*                 ## Force-only LennardJones makes it possible to save 1 flop (they do add up...) */
771             fvdw             = _fjsp_mul_v2r8(_fjsp_msub_v2r8(c12_{I}{J},rinvsix,c6_{I}{J}),_fjsp_mul_v2r8(rinvsix,rinvsq{I}{J}));
772             /*                 #define INNERFLOPS INNERFLOPS+4 */
773             /*             #endif */
774
775             /*         #elif KERNEL_VDW=='CubicSplineTable' */
776
777             /* CUBIC SPLINE TABLE DISPERSION */
778             /*             #if 'Table' in KERNEL_ELEC */
779             vfconv.i[0]       += 4;
780             vfconv.i[1]       += 4;
781             /*             #endif                     */
782             Y                = _fjsp_load_v2r8( vftab + vfconv.i[0] );
783             /*             #if ROUND == 'Loop' */
784             F                = _fjsp_load_v2r8( vftab + vfconv.i[1] );
785             /*             #else */
786             F                = _fjsp_setzero_v2r8();
787             /*             #endif */
788             GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
789             G                = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
790             /*             #if ROUND == 'Loop' */
791             H                = _fjsp_load_v2r8( vftab + vfconv.i[1] + 2 );
792             /*             #else */
793             H                = _fjsp_setzero_v2r8();
794             /*             #endif */
795             GMX_FJSP_TRANSPOSE2_V2R8(G,H);
796             Fp               = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
797             /*             #define INNERFLOPS INNERFLOPS+4 */
798             /*             #if 'Potential' in KERNEL_VF */
799             VV               = _fjsp_madd_v2r8(vfeps,Fp,Y);
800             vvdw6            = _fjsp_mul_v2r8(c6_{I}{J},VV);
801             /*                 #define INNERFLOPS INNERFLOPS+3 */
802             /*             #endif */
803             /*             #if 'Force' in KERNEL_VF */
804             FF               = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
805             fvdw6            = _fjsp_mul_v2r8(c6_{I}{J},FF);
806             /*                 #define INNERFLOPS INNERFLOPS+4 */
807             /*             #endif */
808
809             /* CUBIC SPLINE TABLE REPULSION */
810             Y                = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
811             /*             #if ROUND == 'Loop' */
812             F                = _fjsp_load_v2r8( vftab + vfconv.i[1] + 4 );
813             /*             #else */
814             F                = _fjsp_setzero_v2r8();
815             /*             #endif */
816             GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
817             G                = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
818             /*             #if ROUND == 'Loop' */
819             H                = _fjsp_load_v2r8( vftab + vfconv.i[1] + 6 );
820             /*             #else */
821             H                = _fjsp_setzero_v2r8();
822             /*             #endif */
823             GMX_FJSP_TRANSPOSE2_V2R8(G,H);
824             Fp               = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
825             /*             #define INNERFLOPS INNERFLOPS+4 */
826             /*             #if 'Potential' in KERNEL_VF */
827             VV               = _fjsp_madd_v2r8(vfeps,Fp,Y);
828             vvdw12           = _fjsp_mul_v2r8(c12_{I}{J},VV);
829             /*                 #define INNERFLOPS INNERFLOPS+3 */
830             /*             #endif */
831             /*             #if 'Force' in KERNEL_VF */
832             FF               = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
833             fvdw12           = _fjsp_mul_v2r8(c12_{I}{J},FF);
834             /*                 #define INNERFLOPS INNERFLOPS+5 */
835             /*             #endif */
836             /*             #if 'Potential' in KERNEL_VF */
837             vvdw             = _fjsp_add_v2r8(vvdw12,vvdw6);
838             /*                 #define INNERFLOPS INNERFLOPS+1 */
839             /*             #endif */
840             /*             #if 'Force' in KERNEL_VF */
841             fvdw             = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv{I}{J})));
842             /*                 #define INNERFLOPS INNERFLOPS+4 */
843             /*             #endif */
844
845             /*         #elif KERNEL_VDW=='LJEwald' */
846
847             /* Analytical LJ-PME */
848             rinvsix          = _fjsp_mul_v2r8(_fjsp_mul_v2r8(rinvsq{I}{J},rinvsq{I}{J}),rinvsq{I}{J});
849             ewcljrsq         = _fjsp_mul_v2r8(ewclj2,rsq{I}{J});
850             ewclj6           = _fjsp_mul_v2r8(ewclj2,_fjsp_mul_v2r8(ewclj2,ewclj2));
851             exponent         = gmx_simd_exp_d(ewcljrsq);
852             /* poly = exp(-(beta*r)^2) * (1 + (beta*r)^2 + (beta*r)^4 /2) */
853             poly             = _fjsp_mul_v2r8(exponent,_fjsp_madd_v2r8(_fjsp_mul_v2r8(ewcljrsq,ewcljrsq),one_half,_fjsp_sub_v2r8(one,ewcljrsq)));
854             /*                 #define INNERFLOPS INNERFLOPS+9 */
855             /*             #if 'Potential' in KERNEL_VF or KERNEL_MOD_VDW=='PotentialSwitch' */
856             /* vvdw6 = [C6 - C6grid * (1-poly)]/r6 */
857             vvdw6            = _fjsp_mul_v2r8(_fjsp_madd_v2r8(c6grid_{I}{J},_fjsp_sub_v2r8(poly,one),c6_{I}{J}),rinvsix);
858             vvdw12           = _fjsp_mul_v2r8(c12_{I}{J},_fjsp_mul_v2r8(rinvsix,rinvsix));
859             /*                 #define INNERFLOPS INNERFLOPS+5 */
860             /*                 #if KERNEL_MOD_VDW=='PotentialShift' */
861             vvdw             = _fjsp_msub_v2r8(_fjsp_nmsub_v2r8(c12_{I}{J},_fjsp_mul_v2r8(sh_vdw_invrcut6,sh_vdw_invrcut6),vvdw12),one_twelfth,
862                                _fjsp_mul_v2r8(_fjsp_sub_v2r8(vvdw6,_fjsp_madd_v2r8(c6grid_{I}{J},sh_lj_ewald,_fjsp_mul_v2r8(c6_{I}{J},sh_vdw_invrcut6))),one_sixth));
863             /*                     #define INNERFLOPS INNERFLOPS+7 */
864             /*                 #else */
865             vvdw             = _fjsp_msub_v2r8(vvdw12,one_twelfth,_fjsp_mul_v2r8(vvdw6,one_sixth));         
866             /*                 #define INNERFLOPS INNERFLOPS+2 */
867             /*                 #endif */
868             /*                  ## Check for force inside potential check, i.e. this means we already did the potential part */
869             /*                  #if 'Force' in KERNEL_VF */
870             /* fvdw = vvdw12/r - (vvdw6/r + (C6grid * exponent * beta^6)/r) */
871             fvdw             = _fjsp_mul_v2r8(_fjsp_add_v2r8(vvdw12,_fjsp_msub_v2r8(_fjsp_mul_v2r8(c6grid_{I}{J},one_sixth),_fjsp_mul_v2r8(exponent,ewclj6),vvdw6)),rinvsq{I}{J});
872             /*                 #define INNERFLOPS INNERFLOPS+6 */
873             /*                  #endif */
874             /*              #elif KERNEL_VF=='Force' */
875             /* f6A = 6 * C6grid * (1 - poly) */
876             f6A              = _fjsp_mul_v2r8(c6grid_{I}{J},_fjsp_sub_v2r8(one,poly));
877             /* f6B = C6grid * exponent * beta^6 */
878             f6B              = _fjsp_mul_v2r8(_fjsp_mul_v2r8(c6grid_{I}{J},one_sixth),_fjsp_mul_v2r8(exponent,ewclj6));
879             /* fvdw = 12*C12/r13 - ((6*C6 - f6A)/r6 + f6B)/r */
880             fvdw              = _fjsp_mul_v2r8(_fjsp_madd_v2r8(_fjsp_msub_v2r8(c12_{I}{J},rinvsix,_fjsp_sub_v2r8(c6_{I}{J},f6A)),rinvsix,f6B),rinvsq{I}{J});
881             /*                 #define INNERFLOPS INNERFLOPS+12 */
882             /*              #endif */
883             /*         #endif */
884             /*         ## End of check for vdw interaction forms */
885             /*     #endif */
886             /*     ## END OF VDW INTERACTION CHECK FOR PAIR I-J */
887
888             /*     #if 'switch' in INTERACTION_FLAGS[I][J] */
889             d                = _fjsp_sub_v2r8(r{I}{J},rswitch);
890             d                = _fjsp_max_v2r8(d,_fjsp_setzero_v2r8());
891             d2               = _fjsp_mul_v2r8(d,d);
892             sw               = _fjsp_add_v2r8(one,_fjsp_mul_v2r8(d2,_fjsp_mul_v2r8(d,_fjsp_madd_v2r8(d,_fjsp_madd_v2r8(d,swV5,swV4),swV3))));
893             /*         #define INNERFLOPS INNERFLOPS+10 */
894
895             /*         #if 'Force' in KERNEL_VF */
896             dsw              = _fjsp_mul_v2r8(d2,_fjsp_madd_v2r8(d,_fjsp_madd_v2r8(d,swF4,swF3),swF2));
897             /*             #define INNERFLOPS INNERFLOPS+5 */
898             /*         #endif */
899
900             /* Evaluate switch function */
901             /*         #if 'Force' in KERNEL_VF */
902             /* fscal'=f'/r=-(v*sw)'/r=-(v'*sw+v*dsw)/r=-v'*sw/r-v*dsw/r=fscal*sw-v*dsw/r */
903             /*             #if 'electrostatics' in INTERACTION_FLAGS[I][J] and KERNEL_MOD_ELEC=='PotentialSwitch' */
904             felec            = _fjsp_msub_v2r8( felec,sw , _fjsp_mul_v2r8(rinv{I}{J},_fjsp_mul_v2r8(velec,dsw)) );
905             /*                 #define INNERFLOPS INNERFLOPS+4 */
906             /*             #endif */
907             /*             #if 'vdw' in INTERACTION_FLAGS[I][J] and KERNEL_MOD_VDW=='PotentialSwitch' */
908             fvdw             = _fjsp_msub_v2r8( fvdw,sw , _fjsp_mul_v2r8(rinv{I}{J},_fjsp_mul_v2r8(vvdw,dsw)) );
909             /*                 #define INNERFLOPS INNERFLOPS+4 */
910             /*             #endif */
911             /*         #endif */
912             /*         #if 'Potential' in KERNEL_VF */
913             /*             #if 'electrostatics' in INTERACTION_FLAGS[I][J] and KERNEL_MOD_ELEC=='PotentialSwitch' */
914             velec            = _fjsp_mul_v2r8(velec,sw);
915             /*                 #define INNERFLOPS INNERFLOPS+1 */
916             /*             #endif */
917             /*             #if 'vdw' in INTERACTION_FLAGS[I][J] and KERNEL_MOD_VDW=='PotentialSwitch' */
918             vvdw             = _fjsp_mul_v2r8(vvdw,sw);
919             /*                 #define INNERFLOPS INNERFLOPS+1 */
920             /*             #endif */
921             /*         #endif */
922             /*     #endif */
923             /*     #if 'exactcutoff' in INTERACTION_FLAGS[I][J] */
924             cutoff_mask      = _fjsp_cmplt_v2r8(rsq{I}{J},rcutoff2);
925             /*         #define INNERFLOPS INNERFLOPS+1 */
926             /*     #endif */
927
928             /*     #if 'Potential' in KERNEL_VF */
929             /* Update potential sum for this i atom from the interaction with this j atom. */
930             /*         #if 'electrostatics' in INTERACTION_FLAGS[I][J] */
931             /*             #if 'exactcutoff' in INTERACTION_FLAGS[I][J] */
932             velec            = _fjsp_and_v2r8(velec,cutoff_mask);
933             /*                 #define INNERFLOPS INNERFLOPS+1 */
934             /*             #endif                                       */
935             /*             #if ROUND == 'Epilogue' */
936             velec            = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
937             /*             #endif */
938             velecsum         = _fjsp_add_v2r8(velecsum,velec);
939             /*             #define INNERFLOPS INNERFLOPS+1 */
940             /*             #if KERNEL_ELEC=='GeneralizedBorn' */
941             /*             #if 'exactcutoff' in INTERACTION_FLAGS[I][J] */
942             vgb              = _fjsp_and_v2r8(vgb,cutoff_mask);
943             /*                 #define INNERFLOPS INNERFLOPS+1 */
944             /*             #endif                                       */
945             /*             #if ROUND == 'Epilogue' */
946             vgb              = _fjsp_unpacklo_v2r8(vgb,_fjsp_setzero_v2r8());
947             /*             #endif */
948             vgbsum           = _fjsp_add_v2r8(vgbsum,vgb);
949             /*                 #define INNERFLOPS INNERFLOPS+1 */
950             /*             #endif */
951             /*         #endif */
952             /*         #if 'vdw' in INTERACTION_FLAGS[I][J] */
953             /*             #if 'exactcutoff' in INTERACTION_FLAGS[I][J] */
954             vvdw             = _fjsp_and_v2r8(vvdw,cutoff_mask);
955             /*                 #define INNERFLOPS INNERFLOPS+1 */
956             /*             #endif                                       */
957             /*             #if ROUND == 'Epilogue' */
958             vvdw             = _fjsp_unpacklo_v2r8(vvdw,_fjsp_setzero_v2r8());
959             /*             #endif */
960             vvdwsum          = _fjsp_add_v2r8(vvdwsum,vvdw);
961             /*             #define INNERFLOPS INNERFLOPS+1 */
962             /*         #endif */
963             /*     #endif */
964
965             /*     #if 'Force' in KERNEL_VF */
966
967             /*         #if 'electrostatics' in INTERACTION_FLAGS[I][J] and 'vdw' in INTERACTION_FLAGS[I][J] */
968             fscal            = _fjsp_add_v2r8(felec,fvdw);
969             /*             #define INNERFLOPS INNERFLOPS+1 */
970             /*         #elif 'electrostatics' in INTERACTION_FLAGS[I][J] */
971             fscal            = felec;
972             /*         #elif 'vdw' in INTERACTION_FLAGS[I][J] */
973             fscal            = fvdw;
974             /*        #endif */
975
976             /*             #if 'exactcutoff' in INTERACTION_FLAGS[I][J] */
977             fscal            = _fjsp_and_v2r8(fscal,cutoff_mask);
978             /*                 #define INNERFLOPS INNERFLOPS+1 */
979             /*             #endif                                       */
980
981             /*             #if ROUND == 'Epilogue' */
982             fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
983             /*             #endif */
984
985             /* ## Construction of vectorial force built into FMA instructions now */
986             /* #define INNERFLOPS INNERFLOPS+3      */
987             
988             /* Update vectorial force */
989             fix{I}             = _fjsp_madd_v2r8(dx{I}{J},fscal,fix{I});
990             fiy{I}             = _fjsp_madd_v2r8(dy{I}{J},fscal,fiy{I});
991             fiz{I}             = _fjsp_madd_v2r8(dz{I}{J},fscal,fiz{I});
992             /*             #define INNERFLOPS INNERFLOPS+6 */
993             
994             /* #if GEOMETRY_I == 'Particle'             */
995             /*     #if ROUND == 'Loop' */
996             gmx_fjsp_decrement_fma_1rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fscal,dx{I}{J},dy{I}{J},dz{I}{J});
997             /*     #else */
998             gmx_fjsp_decrement_fma_1rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fscal,dx{I}{J},dy{I}{J},dz{I}{J});
999             /*     #endif */
1000             /*     #define INNERFLOPS INNERFLOPS+3      */
1001             /* #else                                    */
1002             fjx{J}             = _fjsp_madd_v2r8(dx{I}{J},fscal,fjx{J});
1003             fjy{J}             = _fjsp_madd_v2r8(dy{I}{J},fscal,fjy{J});
1004             fjz{J}             = _fjsp_madd_v2r8(dz{I}{J},fscal,fjz{J});
1005             /*     #define INNERFLOPS INNERFLOPS+3      */
1006             /* #endif                                   */
1007
1008             /*     #endif */
1009
1010             /*     #if 'exactcutoff' in INTERACTION_FLAGS[I][J] */
1011             /*         #if 0    ## This and next two lines is a hack to maintain indentation in template file */
1012             {
1013                 /*     #endif */
1014             }
1015             /*     #endif */
1016             /*    ## End of check for the interaction being outside the cutoff */
1017
1018             /* #endfor */
1019             /* ## End of loop over i-j interaction pairs */
1020
1021             /* #if 'Water' in GEOMETRY_I and GEOMETRY_J == 'Particle' */
1022             /*     #if ROUND == 'Loop' */
1023             gmx_fjsp_decrement_1rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fjx0,fjy0,fjz0);
1024             /*     #else */
1025             gmx_fjsp_decrement_1rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fjx0,fjy0,fjz0);
1026             /*     #endif */
1027             /*     #define INNERFLOPS INNERFLOPS+3      */
1028             /* #elif GEOMETRY_J == 'Water3'             */
1029             /*     #if ROUND == 'Loop' */
1030             gmx_fjsp_decrement_3rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fjx0,fjy0,fjz0,fjx1,fjy1,fjz1,fjx2,fjy2,fjz2);
1031             /*     #else */
1032             gmx_fjsp_decrement_3rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fjx0,fjy0,fjz0,fjx1,fjy1,fjz1,fjx2,fjy2,fjz2);
1033             /*     #endif */
1034             /*     #define INNERFLOPS INNERFLOPS+9      */
1035             /* #elif GEOMETRY_J == 'Water4'             */
1036             /*     #if 0 in PARTICLES_J                 */
1037             /*         #if ROUND == 'Loop' */
1038             gmx_fjsp_decrement_4rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fjx0,fjy0,fjz0,fjx1,fjy1,fjz1,fjx2,fjy2,fjz2,fjx3,fjy3,fjz3);
1039             /*         #else */
1040             gmx_fjsp_decrement_4rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fjx0,fjy0,fjz0,fjx1,fjy1,fjz1,fjx2,fjy2,fjz2,fjx3,fjy3,fjz3);
1041             /*         #endif */
1042             /*         #define INNERFLOPS INNERFLOPS+12 */
1043             /*     #else                                */
1044             /*         #if ROUND == 'Loop' */
1045             gmx_fjsp_decrement_3rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA+DIM,f+j_coord_offsetB+DIM,fjx1,fjy1,fjz1,fjx2,fjy2,fjz2,fjx3,fjy3,fjz3);
1046             /*         #else */
1047             gmx_fjsp_decrement_3rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA+DIM,fjx1,fjy1,fjz1,fjx2,fjy2,fjz2,fjx3,fjy3,fjz3);
1048             /*         #endif */
1049             /*         #define INNERFLOPS INNERFLOPS+9  */
1050             /*     #endif                               */
1051             /* #endif                                   */
1052
1053             /* Inner loop uses {INNERFLOPS} flops */
1054         }
1055
1056         /* #endfor */
1057
1058         /* End of innermost loop */
1059
1060         /* #if 'Force' in KERNEL_VF */
1061         /*     #if GEOMETRY_I == 'Particle'            */
1062         gmx_fjsp_update_iforce_1atom_swizzle_v2r8(fix0,fiy0,fiz0,
1063                                               f+i_coord_offset,fshift+i_shift_offset);
1064         /*         #define OUTERFLOPS OUTERFLOPS+6     */
1065         /*     #elif GEOMETRY_I == 'Water3'            */
1066         gmx_fjsp_update_iforce_3atom_swizzle_v2r8(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,
1067                                               f+i_coord_offset,fshift+i_shift_offset);
1068         /*         #define OUTERFLOPS OUTERFLOPS+18    */
1069         /*     #elif GEOMETRY_I == 'Water4'            */
1070         /*         #if 0 in PARTICLES_I                */
1071         gmx_fjsp_update_iforce_4atom_swizzle_v2r8(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,fix3,fiy3,fiz3,
1072                                               f+i_coord_offset,fshift+i_shift_offset);
1073         /*             #define OUTERFLOPS OUTERFLOPS+24    */
1074         /*         #else                               */
1075         gmx_fjsp_update_iforce_3atom_swizzle_v2r8(fix1,fiy1,fiz1,fix2,fiy2,fiz2,fix3,fiy3,fiz3,
1076                                               f+i_coord_offset+DIM,fshift+i_shift_offset);
1077         /*             #define OUTERFLOPS OUTERFLOPS+18    */
1078         /*         #endif                              */
1079         /*     #endif                                  */
1080         /* #endif                                      */
1081
1082         /* #if 'Potential' in KERNEL_VF */
1083         ggid                        = gid[iidx];
1084         /* Update potential energies */
1085         /*     #if KERNEL_ELEC != 'None' */
1086         gmx_fjsp_update_1pot_v2r8(velecsum,kernel_data->energygrp_elec+ggid);
1087         /*         #define OUTERFLOPS OUTERFLOPS+1 */
1088         /*     #endif */
1089         /*     #if 'GeneralizedBorn' in KERNEL_ELEC */
1090         gmx_fjsp_update_1pot_v2r8(vgbsum,kernel_data->energygrp_polarization+ggid);
1091         /*         #define OUTERFLOPS OUTERFLOPS+1 */
1092         /*     #endif */
1093         /*     #if KERNEL_VDW != 'None' */
1094         gmx_fjsp_update_1pot_v2r8(vvdwsum,kernel_data->energygrp_vdw+ggid);
1095         /*         #define OUTERFLOPS OUTERFLOPS+1 */
1096         /*     #endif */
1097         /* #endif */
1098         /*     #if 'GeneralizedBorn' in KERNEL_ELEC and 'Force' in KERNEL_VF */
1099         dvdasum = _fjsp_mul_v2r8(dvdasum, _fjsp_mul_v2r8(isai{I},isai{I}));
1100         gmx_fjsp_update_1pot_v2r8(dvdasum,dvda+inr);
1101         /*     #endif */
1102
1103         /* Increment number of inner iterations */
1104         inneriter                  += j_index_end - j_index_start;
1105
1106         /* Outer loop uses {OUTERFLOPS} flops */
1107     }
1108
1109     /* Increment number of outer iterations */
1110     outeriter        += nri;
1111
1112     /* Update outer/inner flops */
1113     /* ## NB: This is not important, it just affects the flopcount. However, since our preprocessor is */
1114     /* ## primitive and replaces aggressively even in strings inside these directives, we need to      */
1115     /* ## assemble the main part of the name (containing KERNEL/ELEC/VDW) directly in the source.      */
1116     /* #if GEOMETRY_I == 'Water3'            */
1117     /*     #define ISUFFIX '_W3'             */
1118     /* #elif GEOMETRY_I == 'Water4'          */
1119     /*     #define ISUFFIX '_W4'             */
1120     /* #else                                 */
1121     /*     #define ISUFFIX ''                */
1122     /* #endif                                */
1123     /* #if GEOMETRY_J == 'Water3'            */
1124     /*     #define JSUFFIX 'W3'              */
1125     /* #elif GEOMETRY_J == 'Water4'          */
1126     /*     #define JSUFFIX 'W4'              */
1127     /* #else                                 */
1128     /*     #define JSUFFIX ''                */
1129     /* #endif                                */
1130     /* #if 'PotentialAndForce' in KERNEL_VF  */
1131     /*     #define VFSUFFIX  '_VF'           */
1132     /* #elif 'Potential' in KERNEL_VF        */
1133     /*     #define VFSUFFIX '_V'             */
1134     /* #else                                 */
1135     /*     #define VFSUFFIX '_F'             */
1136     /* #endif                                */
1137
1138     /* #if KERNEL_ELEC != 'None' and KERNEL_VDW != 'None' */
1139     inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW{ISUFFIX}{JSUFFIX}{VFSUFFIX},outeriter*{OUTERFLOPS} + inneriter*{INNERFLOPS});
1140     /* #elif KERNEL_ELEC != 'None' */
1141     inc_nrnb(nrnb,eNR_NBKERNEL_ELEC{ISUFFIX}{JSUFFIX}{VFSUFFIX},outeriter*{OUTERFLOPS} + inneriter*{INNERFLOPS});
1142     /* #else */
1143     inc_nrnb(nrnb,eNR_NBKERNEL_VDW{ISUFFIX}{JSUFFIX}{VFSUFFIX},outeriter*{OUTERFLOPS} + inneriter*{INNERFLOPS});
1144     /* #endif  */
1145 }