/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018, 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.
* confuses static analysis tools unless we fuse the vsite
* atom-indexing organization code with the ifunc-adding code, so that
* they can see that nral is the same value. */
-static gmx_inline void
+static inline void
add_ifunc_for_vsites(t_iatom *tiatoms, gmx_ga2la_t *ga2la,
int nral, gmx_bool bHomeA,
int a, int a_gl, int a_mol,
}
/*! \brief Store a bonded interaction at the end of \p il */
-static gmx_inline void add_ifunc(int nral, t_iatom *tiatoms, t_ilist *il)
+static inline void add_ifunc(int nral, t_iatom *tiatoms, t_ilist *il)
{
t_iatom *liatoms;
int k;
/*! \brief Check and when available assign bonded interactions for local atom i
*/
-static gmx_inline void
+static inline void
check_assign_interactions_atom(int i, int i_gl,
int mol, int i_mol,
const int *index, const int *rtil,
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, 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.
}
-static gmx_inline void ed_unshift_single_coord(matrix box, const rvec x, const ivec is, rvec xu)
+static inline void ed_unshift_single_coord(matrix box, const rvec x, const ivec is, rvec xu)
{
int tx, ty, tz;
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2016,2017,2018, 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.
* \param[in] pmeGpu The PME GPU structure.
* \returns True if PME runs on multiple GPUs, false otherwise.
*/
-gmx_inline bool pme_gpu_uses_dd(const PmeGpu *pmeGpu)
+inline bool pme_gpu_uses_dd(const PmeGpu *pmeGpu)
{
return !pmeGpu->settings.useDecomposition;
}
* \param[in] pmeGpu The PME GPU structure.
* \returns True if the gathering is performed on GPU, false otherwise.
*/
-gmx_inline bool pme_gpu_performs_gather(const PmeGpu *pmeGpu)
+inline bool pme_gpu_performs_gather(const PmeGpu *pmeGpu)
{
return pmeGpu->settings.performGPUGather;
}
* \param[in] pmeGpu The PME GPU structure.
* \returns True if FFT is performed on GPU, false otherwise.
*/
-gmx_inline bool pme_gpu_performs_FFT(const PmeGpu *pmeGpu)
+inline bool pme_gpu_performs_FFT(const PmeGpu *pmeGpu)
{
return pmeGpu->settings.performGPUFFT;
}
* \param[in] pmeGpu The PME GPU structure.
* \returns True if (un-)wrapping is performed on GPU, false otherwise.
*/
-gmx_inline bool pme_gpu_performs_wrapping(const PmeGpu *pmeGpu)
+inline bool pme_gpu_performs_wrapping(const PmeGpu *pmeGpu)
{
return pmeGpu->settings.useDecomposition;
}
* \param[in] pmeGpu The PME GPU structure.
* \returns True if solving is performed on GPU, false otherwise.
*/
-gmx_inline bool pme_gpu_performs_solve(const PmeGpu *pmeGpu)
+inline bool pme_gpu_performs_solve(const PmeGpu *pmeGpu)
{
return pmeGpu->settings.performGPUSolve;
}
* \param[in] pmeGpu The PME GPU structure.
* \param[in] testing Should the testing mode be enabled, or disabled.
*/
-gmx_inline void pme_gpu_set_testing(PmeGpu *pmeGpu, bool testing)
+inline void pme_gpu_set_testing(PmeGpu *pmeGpu, bool testing)
{
pmeGpu->settings.copyAllOutputs = testing;
pmeGpu->settings.transferKind = testing ? GpuApiCallBehavior::Sync : GpuApiCallBehavior::Async;
* \param[in] pmeGpu The PME GPU structure.
* \returns true if testing mode is enabled, false otherwise.
*/
-gmx_inline bool pme_gpu_is_testing(const PmeGpu *pmeGpu)
+inline bool pme_gpu_is_testing(const PmeGpu *pmeGpu)
{
return pmeGpu->settings.copyAllOutputs;
}
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, 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.
#if defined PME_SIMD_SOLVE
/* Calculate exponentials through SIMD */
-gmx_inline static void calc_exponentials_q(int, int, real f, ArrayRef<const SimdReal> d_aligned, ArrayRef<const SimdReal> r_aligned, ArrayRef<SimdReal> e_aligned)
+inline static void calc_exponentials_q(int, int, real f, ArrayRef<const SimdReal> d_aligned, ArrayRef<const SimdReal> r_aligned, ArrayRef<SimdReal> e_aligned)
{
{
SimdReal f_simd(f);
}
}
#else
-gmx_inline static void calc_exponentials_q(int start, int end, real f, ArrayRef<real> d, ArrayRef<real> r, ArrayRef<real> e)
+inline static void calc_exponentials_q(int start, int end, real f, ArrayRef<real> d, ArrayRef<real> r, ArrayRef<real> e)
{
GMX_ASSERT(d.size() == r.size(), "d and r must have same size");
GMX_ASSERT(d.size() == e.size(), "d and e must have same size");
#if defined PME_SIMD_SOLVE
/* Calculate exponentials through SIMD */
-gmx_inline static void calc_exponentials_lj(int, int, ArrayRef<SimdReal> r_aligned, ArrayRef<SimdReal> factor_aligned, ArrayRef<SimdReal> d_aligned)
+inline static void calc_exponentials_lj(int, int, ArrayRef<SimdReal> r_aligned, ArrayRef<SimdReal> factor_aligned, ArrayRef<SimdReal> d_aligned)
{
SimdReal tmp_r, tmp_d, tmp_fac, d_inv, tmp_mk;
const SimdReal sqr_PI = sqrt(SimdReal(M_PI));
}
}
#else
-gmx_inline static void calc_exponentials_lj(int start, int end, ArrayRef<real> r, ArrayRef<real> tmp2, ArrayRef<real> d)
+inline static void calc_exponentials_lj(int start, int end, ArrayRef<real> r, ArrayRef<real> tmp2, ArrayRef<real> d)
{
int kx;
real mk;
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2016,2017,2018, 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.
* \param[in] pme The PME data structure.
* \returns True if timings are enabled, false otherwise.
*/
-gmx_inline bool pme_gpu_timings_enabled(const PmeGpu *pmeGpu)
+inline bool pme_gpu_timings_enabled(const PmeGpu *pmeGpu)
{
return pmeGpu->archSpecific->useTiming;
}
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, 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.
#include "gromacs/utility/stringutil.h"
/* print to two file pointers at once (i.e. stderr and log) */
-static gmx_inline
+static inline
void lo_ffprintf(FILE *fp1, FILE *fp2, const char *buf)
{
fprintf(fp1, "%s", buf);
}
/* just print a prepared buffer to fp1 and fp2 */
-static gmx_inline
+static inline
void ffprintf(FILE *fp1, FILE *fp2, const char *buf)
{
lo_ffprintf(fp1, fp2, buf);
}
/* prepare buffer with one argument, then print to fp1 and fp2 */
-static gmx_inline
+static inline
void ffprintf_d(FILE *fp1, FILE *fp2, char *buf, const char *fmt, int arg)
{
sprintf(buf, fmt, arg);
}
/* prepare buffer with one argument, then print to fp1 and fp2 */
-static gmx_inline
+static inline
void ffprintf_g(FILE *fp1, FILE *fp2, char *buf, const char *fmt, real arg)
{
sprintf(buf, fmt, arg);
}
/* prepare buffer with one argument, then print to fp1 and fp2 */
-static gmx_inline
+static inline
void ffprintf_s(FILE *fp1, FILE *fp2, char *buf, const char *fmt, const char *arg)
{
sprintf(buf, fmt, arg);
}
/* prepare buffer with two arguments, then print to fp1 and fp2 */
-static gmx_inline
+static inline
void ffprintf_dd(FILE *fp1, FILE *fp2, char *buf, const char *fmt, int arg1, int arg2)
{
sprintf(buf, fmt, arg1, arg2);
}
/* prepare buffer with two arguments, then print to fp1 and fp2 */
-static gmx_inline
+static inline
void ffprintf_gg(FILE *fp1, FILE *fp2, char *buf, const char *fmt, real arg1, real arg2)
{
sprintf(buf, fmt, arg1, arg2);
}
/* prepare buffer with two arguments, then print to fp1 and fp2 */
-static gmx_inline
+static inline
void ffprintf_ss(FILE *fp1, FILE *fp2, char *buf, const char *fmt, const char *arg1, const char *arg2)
{
sprintf(buf, fmt, arg1, arg2);
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2008, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, 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.
* This could be implemented slightly more efficient, but the code
* would get much more complicated.
*/
-static gmx_inline gmx_bool grid_loop_begin(int n, int x, gmx_bool bTric, gmx_bool bEdge)
+static inline gmx_bool grid_loop_begin(int n, int x, gmx_bool bTric, gmx_bool bEdge)
{
return ((n == 1) ? x : bTric && bEdge ? 0 : (x-1));
}
-static gmx_inline gmx_bool grid_loop_end(int n, int x, gmx_bool bTric, gmx_bool bEdge)
+static inline gmx_bool grid_loop_end(int n, int x, gmx_bool bTric, gmx_bool bEdge)
{
return ((n == 1) ? x : bTric && bEdge ? (n-1) : (x+1));
}
-static gmx_inline int grid_mod(int j, int n)
+static inline int grid_mod(int j, int n)
{
return (j+n) % (n);
}
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, 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.
}
}
-static gmx_inline
+static inline
void print_minimum(FILE *fp, int num, const t_minimum *min)
{
fprintf(fp,
num, min->index, min->ener);
}
-static gmx_inline
+static inline
void add_minimum(FILE *fp, int num, const t_minimum *min, t_minimum *mm)
{
print_minimum(fp, num, min);
mm[num].ener = min->ener;
}
-static gmx_inline
+static inline
gmx_bool is_local_minimum_from_below(const t_minimum *this_min,
int dimension_index,
int dimension_min,
/* Note over/underflow within W cannot occur. */
}
-static gmx_inline
+static inline
gmx_bool is_local_minimum_from_above(const t_minimum *this_min,
int dimension_index,
int dimension_max,
} /* fixes auto-indentation problems */
#endif
+/*! \def gmx_inline
+ * \brief
+ * Keyword to use in C code instead of C99 `inline`.
+ *
+ * Some of the C compilers we support do not recognize the C99 keyword
+ * `inline`. This macro should be used in C code and in shared C/C++ headers
+ * to indicate a function is inlined.
+ * C++ code should use plain `inline`, as that is already in C++98.
+ */
+#if !defined __cplusplus && defined _MSC_VER
+#define gmx_inline __inline
+#else
+/* C++ or C99 */
+#define gmx_inline inline
+#endif
+
/* Structure to collect kernel data not available in forcerec or mdatoms structures.
* This is only used inside the nonbonded module.
*/
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2016,2017,2018, 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.
/*! \brief Returns TRUE if any component of the two rvecs differs. */
-static gmx_inline gmx_bool rvecs_differ(const rvec v1, const rvec v2)
+static inline gmx_bool rvecs_differ(const rvec v1, const rvec v2)
{
int i;
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2012,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014,2015,2017,2018, 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.
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/smalloc.h"
-static gmx_inline
+static inline
void do_rotate(double **a, int i, int j, int k, int l, double tau, double s)
{
double g, h;
* also calculates the pre-factor required for the dihedral force update.
* Note that bv and buf should be register aligned.
*/
-static gmx_inline void
+static inline void
dih_angle_simd(const rvec *x,
const int *ai, const int *aj, const int *ak, const int *al,
const real *pbc_simd,
#if GMX_SIMD_HAVE_REAL
/* As do_dih_fup_noshiftf above, but with SIMD and pre-calculated pre-factors */
-static gmx_inline void gmx_simdcall
+static inline void gmx_simdcall
do_dih_fup_noshiftf_simd(const int *ai, const int *aj, const int *ak, const int *al,
SimdReal p, SimdReal q,
SimdReal f_i_x, SimdReal f_i_y, SimdReal f_i_z,
}
}
-static gmx_inline unsigned char reverse_bits(unsigned char b)
+static inline unsigned char reverse_bits(unsigned char b)
{
/* http://graphics.stanford.edu/~seander/bithacks.html#ReverseByteWith64BitsDiv */
return (b * 0x0202020202ULL & 0x010884422010ULL) % 1023;
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017,2018, 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.
#define STRIDE_P8 (DIM*c_packX8)
/* Returns the index in a coordinate array corresponding to atom a */
-template<int packSize> static gmx_inline int atom_to_x_index(int a)
+template<int packSize> static inline int atom_to_x_index(int a)
{
return DIM*(a & ~(packSize - 1)) + (a & (packSize - 1));
}
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2018, 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.
#include "gromacs/simd/simd.h"
#include "gromacs/simd/simd_math.h"
#include "gromacs/simd/vector_operations.h"
-#include "gromacs/utility/basedefinitions.h"
#ifdef CALC_COUL_EWALD
#include "gromacs/math/utilities.h"
#endif
/* As add_ener_grp, but for two groups of UNROLLJ/2 stored in
* a single SIMD register.
*/
-static gmx_inline void
+static inline void
add_ener_grp_halves(SimdReal e_S, real *v0, real *v1, const int *offset_jj)
{
for (int jj = 0; jj < (UNROLLJ/2); jj++)
#endif
-static gmx_inline void gmx_simdcall
+static inline void gmx_simdcall
gmx_load_simd_2xnn_interactions(int excl,
SimdBitMask filter_S0,
SimdBitMask filter_S2,
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2017,2018, 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.
#ifdef UNROLLJ
/* Add energy register to possibly multiple terms in the energy array */
-static gmx_inline void add_ener_grp(SimdReal e_S, real *v, const int *offset_jj)
+static inline void add_ener_grp(SimdReal e_S, real *v, const int *offset_jj)
{
int jj;
typedef SimdReal SimdBitMask;
#endif
-static gmx_inline void gmx_simdcall
+static inline void gmx_simdcall
gmx_load_simd_4xn_interactions(int excl,
SimdBitMask gmx_unused filter_S0,
SimdBitMask gmx_unused filter_S1,
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017,2018, 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.
/* Returns if any atom pair from two clusters is within distance sqrt(rlist2) */
-static gmx_inline gmx_bool
+static inline gmx_bool
clusterpair_in_range(const nbnxn_list_work_t *work,
int si,
int csj, int stride, const real *x_j,
}
/* Add a new i-entry to the FEP list and copy the i-properties */
-static gmx_inline void fep_list_new_nri_copy(t_nblist *nlist)
+static inline void fep_list_new_nri_copy(t_nblist *nlist)
{
/* Add a new i-entry */
nlist->nri++;
}
/* Return the index of atom a within a cluster */
-static gmx_inline int cj_mod_cj4(int cj)
+static inline int cj_mod_cj4(int cj)
{
return cj & (c_nbnxnGpuJgroupSize - 1);
}
/* Convert a j-cluster to a cj4 group */
-static gmx_inline int cj_to_cj4(int cj)
+static inline int cj_to_cj4(int cj)
{
return cj/c_nbnxnGpuJgroupSize;
}
/* Return the index of an j-atom within a warp */
-static gmx_inline int a_mod_wj(int a)
+static inline int a_mod_wj(int a)
{
return a & (c_nbnxnGpuClusterSize/c_nbnxnGpuClusterpairSplit - 1);
}
}
/* Sets a simple list i-cell bounding box, including PBC shift */
-static gmx_inline void set_icell_bb_simple(const nbnxn_bb_t *bb, int ci,
- real shx, real shy, real shz,
- nbnxn_bb_t *bb_ci)
+static inline void set_icell_bb_simple(const nbnxn_bb_t *bb, int ci,
+ real shx, real shy, real shz,
+ nbnxn_bb_t *bb_ci)
{
bb_ci->lower[BB_X] = bb[ci].lower[BB_X] + shx;
bb_ci->lower[BB_Y] = bb[ci].lower[BB_Y] + shy;
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017,2018, 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.
#endif
/* Copies PBC shifted i-cell packed atom coordinates to working array */
-static gmx_inline void
+static inline void
icell_set_x_simd_2xnn(int ci,
real shx, real shy, real shz,
int gmx_unused stride, const real *x,
* \param[in] rbb2 The squared cut-off for putting cluster-pairs in the list based on bounding box distance only
* \param[in,out] numDistanceChecks The number of distance checks performed
*/
-static gmx_inline void
+static inline void
makeClusterListSimd2xnn(const nbnxn_grid_t * gridj,
nbnxn_pairlist_t * nbl,
int icluster,
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017,2018, 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.
#endif
/* Copies PBC shifted i-cell packed atom coordinates to working array */
-static gmx_inline void
+static inline void
icell_set_x_simd_4xn(int ci,
real shx, real shy, real shz,
int gmx_unused stride, const real *x,
* \param[in] rbb2 The squared cut-off for putting cluster-pairs in the list based on bounding box distance only
* \param[in,out] numDistanceChecks The number of distance checks performed
*/
-static gmx_inline void
+static inline void
makeClusterListSimd4xn(const nbnxn_grid_t * gridj,
nbnxn_pairlist_t * nbl,
int icluster,
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017,2018, 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.
/* Returns the base-2 log of n.
* Generates a fatal error when n is not an integer power of 2.
*/
-static gmx_inline int get_2log(int n)
+static inline int get_2log(int n)
{
int log2;
}
/* Returns the nbnxn i-cluster size in atoms for the nbnxn kernel type */
-static gmx_inline int nbnxn_kernel_to_cluster_i_size(int nb_kernel_type)
+static inline int nbnxn_kernel_to_cluster_i_size(int nb_kernel_type)
{
switch (nb_kernel_type)
{
}
/* Returns the nbnxn i-cluster size in atoms for the nbnxn kernel type */
-static gmx_inline int nbnxn_kernel_to_cluster_j_size(int nb_kernel_type)
+static inline int nbnxn_kernel_to_cluster_j_size(int nb_kernel_type)
{
int nbnxn_simd_width = 0;
int cj_size = 0;
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017,2018, 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.
-static gmx_inline void new_i_nblist(t_nblist *nlist, int i_atom, int shift, int gid)
+static inline void new_i_nblist(t_nblist *nlist, int i_atom, int shift, int gid)
{
int nri = nlist->nri;
}
}
-static gmx_inline void close_i_nblist(t_nblist *nlist)
+static inline void close_i_nblist(t_nblist *nlist)
{
int nri = nlist->nri;
int len;
}
}
-static gmx_inline void close_nblist(t_nblist *nlist)
+static inline void close_nblist(t_nblist *nlist)
{
/* Only close this nblist when it has been initialized.
* Avoid the creation of i-lists with no j-particles.
}
}
-static gmx_inline void close_neighbor_lists(t_forcerec *fr, gmx_bool bMakeQMMMnblist)
+static inline void close_neighbor_lists(t_forcerec *fr, gmx_bool bMakeQMMMnblist)
{
int n, i;
}
-static gmx_inline void add_j_to_nblist(t_nblist *nlist, int j_atom)
+static inline void add_j_to_nblist(t_nblist *nlist, int j_atom)
{
int nrj = nlist->nrj;
nlist->nrj++;
}
-static gmx_inline void add_j_to_nblist_cg(t_nblist *nlist,
- int j_start, int j_end,
- t_excl *bexcl, gmx_bool i_is_j)
+static inline void add_j_to_nblist_cg(t_nblist *nlist,
+ int j_start, int j_end,
+ t_excl *bexcl, gmx_bool i_is_j)
{
int nrj = nlist->nrj;
int j;
*
************************************************/
-static gmx_inline void get_dx_dd(int Nx, real gridx, real rc2, int xgi, real x,
- int ncpddc, int shift_min, int shift_max,
- int *g0, int *g1, real *dcx2)
+static inline void get_dx_dd(int Nx, real gridx, real rc2, int xgi, real x,
+ int ncpddc, int shift_min, int shift_max,
+ int *g0, int *g1, real *dcx2)
{
real dcx, tmp;
int g_min, g_max, shift_home;
return nbv != nullptr && nbv->bUseGPU;
}
-static gmx_inline void clear_rvecs_omp(int n, rvec v[])
+static inline void clear_rvecs_omp(int n, rvec v[])
{
int nth = gmx_omp_nthreads_get_simple_rvec_task(emntDefault, n);
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, 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.
return vsite;
}
-static gmx_inline void flagAtom(InterdependentTask *idTask, int atom,
- int thread, int nthread, int natperthread)
+static inline void flagAtom(InterdependentTask *idTask, int atom,
+ int thread, int nthread, int natperthread)
{
if (!idTask->use[atom])
{
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2015,2016,2017,2018, 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.
* without PBC. But on modern processors the overhead of this, often called,
* routine should be low. On e.g. Intel Haswell/Broadwell it takes 8 cycles.
*/
-static gmx_inline void gmx_simdcall
+static inline void gmx_simdcall
pbc_correct_dx_simd(SimdReal *dx,
SimdReal *dy,
SimdReal *dz,
* when all atoms are in the unit-cell (aiuc).
* This is the SIMD equivalent of the scalar version declared in pbc.h.
*/
-static gmx_inline void gmx_simdcall
+static inline void gmx_simdcall
pbc_dx_aiuc(const real *pbc_simd,
const SimdReal *x1,
const SimdReal *x2,
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2008, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, 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.
/* Reduce potential angle fit data for this group at this time step? */
-static gmx_inline gmx_bool bPotAngle(t_rot *rot, t_rotgrp *rotg, gmx_int64_t step)
+static inline gmx_bool bPotAngle(t_rot *rot, t_rotgrp *rotg, gmx_int64_t step)
{
return ( (erotgFitPOT == rotg->eFittype) && (do_per_step(step, rot->nstsout) || do_per_step(step, rot->nstrout)) );
}
/* Reduce slab torqe data for this group at this time step? */
-static gmx_inline gmx_bool bSlabTau(t_rot *rot, t_rotgrp *rotg, gmx_int64_t step)
+static inline gmx_bool bSlabTau(t_rot *rot, t_rotgrp *rotg, gmx_int64_t step)
{
return ( (ISFLEX(rotg)) && do_per_step(step, rot->nstsout) );
}
}
-static gmx_inline real calc_beta(rvec curr_x, t_rotgrp *rotg, int n)
+static inline real calc_beta(rvec curr_x, t_rotgrp *rotg, int n)
{
return iprod(curr_x, rotg->vec) - rotg->slab_dist * n;
}
-static gmx_inline real gaussian_weight(rvec curr_x, t_rotgrp *rotg, int n)
+static inline real gaussian_weight(rvec curr_x, t_rotgrp *rotg, int n)
{
const real norm = GAUSS_NORM;
real sigma;
/* Calculates torque on the rotation axis tau = position x force */
-static gmx_inline real torque(
+static inline real torque(
rvec rotvec, /* rotation vector; MUST be normalized! */
rvec force, /* force */
rvec x, /* position of atom on which the force acts */
/* Shift x with is */
-static gmx_inline void shift_single_coord(const matrix box, rvec x, const ivec is)
+static inline void shift_single_coord(const matrix box, rvec x, const ivec is)
{
int tx, ty, tz;
/* Determine the 'home' slab of this atom which is the
* slab with the highest Gaussian weight of all */
#define round(a) (int)(a+0.5)
-static gmx_inline int get_homeslab(
+static inline int get_homeslab(
rvec curr_x, /* The position for which the home slab shall be determined */
rvec rotvec, /* The rotation vector */
real slabdist) /* The slab distance */
* x_last * v - n*Delta_x >= -beta_max
*
*/
-static gmx_inline int get_first_slab(
+static inline int get_first_slab(
t_rotgrp *rotg, /* The rotation group (inputrec data) */
real max_beta, /* The max_beta value, instead of min_gaussian */
rvec firstatom) /* First atom after sorting along the rotation vector v */
}
-static gmx_inline int get_last_slab(
+static inline int get_last_slab(
t_rotgrp *rotg, /* The rotation group (inputrec data) */
real max_beta, /* The max_beta value, instead of min_gaussian */
rvec lastatom) /* Last atom along v */
* dr = dr - (dr.v)v
* Note that v must be of unit length.
*/
-static gmx_inline void project_onto_plane(rvec dr, const rvec v)
+static inline void project_onto_plane(rvec dr, const rvec v)
{
rvec tmp;
/* Special version of copy_rvec:
* During the copy procedure of xcurr to b, the correct PBC image is chosen
* such that the copied vector ends up near its reference position xref */
-static gmx_inline void copy_correct_pbc_image(
+static inline void copy_correct_pbc_image(
const rvec xcurr, /* copy vector xcurr ... */
rvec b, /* ... to b ... */
const rvec xref, /* choosing the PBC image such that b ends up near xref */
#include <arm_neon.h>
-#include "gromacs/utility/basedefinitions.h"
-
#include "impl_arm_neon_asimd_simd_double.h"
namespace gmx
{
template <int align>
-static gmx_inline void gmx_simdcall
+static inline void gmx_simdcall
gatherLoadTranspose(const double * base,
const std::int32_t offset[],
SimdDouble * v0,
}
template <int align>
-static gmx_inline void gmx_simdcall
+static inline void gmx_simdcall
gatherLoadTranspose(const double * base,
const std::int32_t offset[],
SimdDouble * v0,
static const int c_simdBestPairAlignmentDouble = 2;
template <int align>
-static gmx_inline void gmx_simdcall
+static inline void gmx_simdcall
gatherLoadUTranspose(const double * base,
const std::int32_t offset[],
SimdDouble * v0,
}
template <int align>
-static gmx_inline void gmx_simdcall
+static inline void gmx_simdcall
transposeScatterStoreU(double * base,
const std::int32_t offset[],
SimdDouble v0,
}
template <int align>
-static gmx_inline void gmx_simdcall
+static inline void gmx_simdcall
transposeScatterIncrU(double * base,
const std::int32_t offset[],
SimdDouble v0,
}
template <int align>
-static gmx_inline void gmx_simdcall
+static inline void gmx_simdcall
transposeScatterDecrU(double * base,
const std::int32_t offset[],
SimdDouble v0,
vst1_f64(base + align * offset[1] + 2, t3);
}
-static gmx_inline void gmx_simdcall
+static inline void gmx_simdcall
expandScalarsToTriplets(SimdDouble scalar,
SimdDouble * triplets0,
SimdDouble * triplets1,
}
template <int align>
-static gmx_inline void gmx_simdcall
+static inline void gmx_simdcall
gatherLoadBySimdIntTranspose(const double * base,
SimdDInt32 offset,
SimdDouble * v0,
template <int align>
-static gmx_inline void gmx_simdcall
+static inline void gmx_simdcall
gatherLoadBySimdIntTranspose(const double * base,
SimdDInt32 offset,
SimdDouble * v0,
}
template <int align>
-static gmx_inline void gmx_simdcall
+static inline void gmx_simdcall
gatherLoadUBySimdIntTranspose(const double * base,
SimdDInt32 offset,
SimdDouble * v0,
}
-static gmx_inline double gmx_simdcall
+static inline double gmx_simdcall
reduceIncr4ReturnSum(double * m,
SimdDouble v0,
SimdDouble v1,
* This file is part of the GROMACS molecular simulation package.
*
* Copyright (c) 1991-2006 David van der Spoel, Erik Lindahl, Berk Hess, University of Groningen.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, 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.
} /* fixes auto-indentation problems */
#endif
-/* Minor implementation note:
- *
- * I like to use these counters in other programs too, so to avoid making
- * it dependent on other Gromacs definitions I use the #ifdef's to set
- * architecture-specific inline macros instead of using gmx_inline from
- * gmx_types.h /Erik 2005-12-10
- */
-
#if ((defined(__GNUC__) || defined(__INTEL_COMPILER) || defined(__PATHSCALE__) || defined(__PGIC__)) && \
(defined(__i386__) || defined(__x86_64__)))
/* x86 or x86-64 with GCC inline assembly */
#define GMX_UINT64_MIN UINT64_MIN
/*! \} */
-/*! \def gmx_inline
- * \brief
- * Keyword to use in C code instead of C99 `inline`.
- *
- * Some of the C compilers we support do not recognize the C99 keyword
- * `inline`. This macro should be used in C code and in shared C/C++ headers
- * to indicate a function is inlined.
- * C++ code should use plain `inline`, as that is already in C++98.
- */
-#if !defined __cplusplus && defined _MSC_VER
-#define gmx_inline __inline
-#else
-/* C++ or C99 */
-#define gmx_inline inline
-#endif
-
/* ICC, GCC, MSVC, Pathscale, PGI, XLC support __restrict.
* Any other compiler can be added here. */
/*! \brief
#endif
/*! \brief Initialize all bits to 0 */
-gmx_inline static void bitmask_clear(gmx_bitmask_t* m)
+inline static void bitmask_clear(gmx_bitmask_t* m)
{
*m = 0;
}
/*! \brief Set bit at position b to 1. */
-gmx_inline static void bitmask_set_bit(gmx_bitmask_t* m, int b)
+inline static void bitmask_set_bit(gmx_bitmask_t* m, int b)
{
*m |= ((gmx_bitmask_t)1 << b);
}
/*! \brief Initialize all bits: bit b to 1, others to 0 */
-gmx_inline static void bitmask_init_bit(gmx_bitmask_t* m, int b)
+inline static void bitmask_init_bit(gmx_bitmask_t* m, int b)
{
*m = ((gmx_bitmask_t)1 << b);
}
/*! \brief Initialize all bits: all bits below b to 1, others to 0 */
-gmx_inline static void bitmask_init_low_bits(gmx_bitmask_t* m, int b)
+inline static void bitmask_init_low_bits(gmx_bitmask_t* m, int b)
{
*m = ((gmx_bitmask_t)1 << b) - 1;
}
/*! \brief Test if bit b is set */
-gmx_inline static bool bitmask_is_set(gmx_bitmask_t m, int b)
+inline static bool bitmask_is_set(gmx_bitmask_t m, int b)
{
return (m & ((gmx_bitmask_t)1 << b)) != 0;
}
/*! \brief Test if both bitmasks have no common bits enabled */
-gmx_inline static bool bitmask_is_disjoint(gmx_bitmask_t a, gmx_bitmask_t b)
+inline static bool bitmask_is_disjoint(gmx_bitmask_t a, gmx_bitmask_t b)
{
return !(a & b);
}
/*! \brief Test if both bitmasks are equal */
-gmx_inline static bool bitmask_is_equal(gmx_bitmask_t a, gmx_bitmask_t b)
+inline static bool bitmask_is_equal(gmx_bitmask_t a, gmx_bitmask_t b)
{
return a == b;
}
/*! \brief Test if bitmask has no enabled bits */
-gmx_inline static bool bitmask_is_zero(gmx_bitmask_t m)
+inline static bool bitmask_is_zero(gmx_bitmask_t m)
{
return !m;
}
/*! \brief Set all bits enabled in either mask and write into a */
-gmx_inline static void bitmask_union(gmx_bitmask_t* a, gmx_bitmask_t b)
+inline static void bitmask_union(gmx_bitmask_t* a, gmx_bitmask_t b)
{
*a |= b;
}
#define BITMASK_ALEN (BITMASK_SIZE/64)
typedef gmx_uint64_t gmx_bitmask_t[BITMASK_ALEN];
-gmx_inline static void bitmask_clear(gmx_bitmask_t* m)
+inline static void bitmask_clear(gmx_bitmask_t* m)
{
memset(*m, 0, BITMASK_SIZE/8);
}
-gmx_inline static void bitmask_set_bit(gmx_bitmask_t* m, int b)
+inline static void bitmask_set_bit(gmx_bitmask_t* m, int b)
{
(*m)[b/64] |= ((gmx_uint64_t)1 << (b%64));
}
-gmx_inline static void bitmask_init_bit(gmx_bitmask_t* m, int b)
+inline static void bitmask_init_bit(gmx_bitmask_t* m, int b)
{
bitmask_clear(m);
(*m)[b/64] = ((gmx_uint64_t)1 << (b%64));
}
-gmx_inline static void bitmask_init_low_bits(gmx_bitmask_t* m, int b)
+inline static void bitmask_init_low_bits(gmx_bitmask_t* m, int b)
{
memset(*m, 255, b/64*8);
(*m)[b/64] = ((gmx_uint64_t)1 << (b%64)) - 1;
memset(&(*m)[b/64+1], 0, (BITMASK_ALEN-b/64-1)*8);
}
-gmx_inline static bool bitmask_is_set(gmx_bitmask_t m, int b)
+inline static bool bitmask_is_set(gmx_bitmask_t m, int b)
{
return (m[b/64] & ((gmx_uint64_t)1 << (b%64))) != 0;
}
-gmx_inline static bool bitmask_is_disjoint(gmx_bitmask_t a, gmx_bitmask_t b)
+inline static bool bitmask_is_disjoint(gmx_bitmask_t a, gmx_bitmask_t b)
{
int i;
bool r = 1;
return r;
}
-gmx_inline static bool bitmask_is_equal(gmx_bitmask_t a, gmx_bitmask_t b)
+inline static bool bitmask_is_equal(gmx_bitmask_t a, gmx_bitmask_t b)
{
int i;
bool r = 1;
return r;
}
-gmx_inline static bool bitmask_is_zero(gmx_bitmask_t m)
+inline static bool bitmask_is_zero(gmx_bitmask_t m)
{
int i;
bool r = 1;
return r;
}
-gmx_inline static void bitmask_union(gmx_bitmask_t* a, gmx_bitmask_t b)
+inline static void bitmask_union(gmx_bitmask_t* a, gmx_bitmask_t b)
{
int i;
for (i = 0; i < BITMASK_ALEN; i++)
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2018, 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.
/*! \brief
* Pause for use in a spin-wait loop.
*/
-static gmx_inline void gmx_pause()
+static inline void gmx_pause()
{
#ifndef _MSC_VER
/* Ugly hack because the openmp implementation below hacks into the SIMD