* This file is part of the GROMACS molecular simulation package.
*
* Copyright (c) 2012-2018, The GROMACS development team.
- * Copyright (c) 2019,2020, by the GROMACS development team, led by
+ * Copyright (c) 2019,2020,2021, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
#else
const __global int* restrict atom_types, /* IN */
#endif
- const __global float* restrict shift_vec, /* IN stores float3 values */
- __constant const float* gmx_unused nbfp_climg2d, /* IN */
- __constant const float* gmx_unused nbfp_comb_climg2d, /* IN */
- __constant const float* gmx_unused coulomb_tab_climg2d, /* IN */
- const __global nbnxn_sci_t* pl_sci, /* IN */
+ const __global float* restrict shift_vec, /* IN stores float3 values */
+ __constant const float* gmx_unused nbfp, /* IN */
+ __constant const float* gmx_unused nbfp_comb, /* IN */
+ __constant const float* gmx_unused coulomb_tab, /* IN */
+ const __global nbnxn_sci_t* pl_sci, /* IN */
#ifndef PRUNE_NBL
const
#endif
E_el += qi * qi;
# endif
# if defined LJ_EWALD
- E_lj += nbfp_climg2d[atom_types[(sci * c_nbnxnGpuNumClusterPerSupercluster + i) * CL_SIZE + tidxi]
- * (ntypes + 1) * 2];
+ E_lj += nbfp[atom_types[(sci * c_nbnxnGpuNumClusterPerSupercluster + i) * CL_SIZE + tidxi]
+ * (ntypes + 1) * 2];
# endif /* LJ_EWALD */
}
#endif /* IATYPE_SHMEM */
/* LJ 6*C6 and 12*C12 */
#ifndef LJ_COMB
- const float c6 = nbfp_climg2d[2 * (ntypes * typei + typej)];
- const float c12 = nbfp_climg2d[2 * (ntypes * typei + typej) + 1];
+ const float c6 = nbfp[2 * (ntypes * typei + typej)];
+ const float c12 = nbfp[2 * (ntypes * typei + typej) + 1];
#else /* LJ_COMB */
# ifdef LJ_COMB_GEOM
const float c6 = ljcp_i.x * ljcp_j.x;
#ifdef LJ_EWALD
# ifdef LJ_EWALD_COMB_GEOM
# ifdef CALC_ENERGIES
- calculate_lj_ewald_comb_geom_F_E(nbfp_comb_climg2d,
+ calculate_lj_ewald_comb_geom_F_E(nbfp_comb,
nbparam,
typei,
typej,
&E_lj_p);
# else
calculate_lj_ewald_comb_geom_F(
- nbfp_comb_climg2d, typei, typej, r2, inv_r2, lje_coeff2, lje_coeff6_6, &F_invr);
+ nbfp_comb, typei, typej, r2, inv_r2, lje_coeff2, lje_coeff6_6, &F_invr);
# endif /* CALC_ENERGIES */
# elif defined LJ_EWALD_COMB_LB
- calculate_lj_ewald_comb_LB_F_E(nbfp_comb_climg2d,
+ calculate_lj_ewald_comb_LB_F_E(nbfp_comb,
nbparam,
typei,
typej,
F_invr += qi * qj_f
* (int_bit * inv_r2
- interpolate_coulomb_force_r(
- coulomb_tab_climg2d, r2 * inv_r, coulomb_tab_scale))
+ coulomb_tab, r2 * inv_r, coulomb_tab_scale))
* inv_r;
#endif /* EL_EWALD_ANA/TAB */
* This file is part of the GROMACS molecular simulation package.
*
* Copyright (c) 2012,2013,2014,2016,2017 by the GROMACS development team.
- * Copyright (c) 2018,2019,2020, by the GROMACS development team, led by
+ * Copyright (c) 2018,2019,2020,2021, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
/*! Calculate LJ-PME grid force contribution with
* geometric combination rule.
*/
-gmx_opencl_inline void calculate_lj_ewald_comb_geom_F(__constant const float* nbfp_comb_climg2d,
+gmx_opencl_inline void calculate_lj_ewald_comb_geom_F(__constant const float* nbfp_comb,
int typei,
int typej,
float r2,
float lje_coeff6_6,
float* F_invr)
{
- const float c6grid = nbfp_comb_climg2d[2 * typei] * nbfp_comb_climg2d[2 * typej];
+ const float c6grid = nbfp_comb[2 * typei] * nbfp_comb[2 * typej];
/* Recalculate inv_r6 without exclusion mask */
const float inv_r6_nm = inv_r2 * inv_r2 * inv_r2;
/*! Calculate LJ-PME grid force + energy contribution with
* geometric combination rule.
*/
-gmx_opencl_inline void calculate_lj_ewald_comb_geom_F_E(__constant const float* nbfp_comb_climg2d,
+gmx_opencl_inline void calculate_lj_ewald_comb_geom_F_E(__constant const float* nbfp_comb,
const cl_nbparam_params_t* nbparam,
int typei,
int typej,
float* F_invr,
float* E_lj)
{
- const float c6grid = nbfp_comb_climg2d[2 * typei] * nbfp_comb_climg2d[2 * typej];
+ const float c6grid = nbfp_comb[2 * typei] * nbfp_comb[2 * typej];
/* Recalculate inv_r6 without exclusion mask */
const float inv_r6_nm = inv_r2 * inv_r2 * inv_r2;
* We use a single F+E kernel with conditional because the performance impact
* of this is pretty small and LB on the CPU is anyway very slow.
*/
-gmx_opencl_inline void calculate_lj_ewald_comb_LB_F_E(__constant const float* nbfp_comb_climg2d,
+gmx_opencl_inline void calculate_lj_ewald_comb_LB_F_E(__constant const float* nbfp_comb,
const cl_nbparam_params_t* nbparam,
int typei,
int typej,
float* E_lj)
{
/* sigma and epsilon are scaled to give 6*C6 */
- const float sigma = nbfp_comb_climg2d[2 * typei] + nbfp_comb_climg2d[2 * typej];
+ const float sigma = nbfp_comb[2 * typei] + nbfp_comb[2 * typej];
- const float epsilon = nbfp_comb_climg2d[2 * typei + 1] * nbfp_comb_climg2d[2 * typej + 1];
+ const float epsilon = nbfp_comb[2 * typei + 1] * nbfp_comb[2 * typej + 1];
const float sigma2 = sigma * sigma;
const float c6grid = epsilon * sigma2 * sigma2 * sigma2;
/*! Interpolate Ewald coulomb force using the table through the tex_nbfp texture.
* Original idea: from the OpenMM project
*/
-gmx_opencl_inline float interpolate_coulomb_force_r(__constant const float* coulomb_tab_climg2d,
- float r,
- float scale)
+gmx_opencl_inline float interpolate_coulomb_force_r(__constant const float* coulomb_tab, float r, float scale)
{
float normalized = scale * r;
int index = (int)normalized;
float fract2 = normalized - (float)index;
float fract1 = 1.0F - fract2;
- return fract1 * coulomb_tab_climg2d[index] + fract2 * coulomb_tab_climg2d[index + 1];
+ return fract1 * coulomb_tab[index] + fract2 * coulomb_tab[index + 1];
}
/*! Calculate analytical Ewald correction term. */