From f775452763a24057cfa876c36522f1e4be64228c Mon Sep 17 00:00:00 2001 From: Mark Abraham Date: Tue, 20 Aug 2019 13:37:56 +0200 Subject: [PATCH] Apply clang-tidy-8 readability-uppercase-literal-suffix This new check in clang-tidy-8 seems useful enough to activate, even if only so people get used to reading code that also conforms to the check. The value is similar to using upper case for MACROS - that the token is more clearly not a variable. Change-Id: Id4712f53e07bd7b9b3148f63c4f1c8457d7e199e --- src/gromacs/compat/tests/string_view.cpp | 2 +- .../coordinateio/outputadapters/setatoms.cpp | 2 +- .../coordinateio/outputadapters/setforces.cpp | 2 +- .../outputadapters/setprecision.cpp | 2 +- .../outputadapters/setvelocities.cpp | 2 +- src/gromacs/coordinateio/tests/testmodule.cpp | 2 +- src/gromacs/domdec/dlbtiming.cpp | 2 +- src/gromacs/domdec/domdec_topology.cpp | 8 +- src/gromacs/domdec/partition.cpp | 6 +- src/gromacs/ewald/pme_only.cpp | 2 +- src/gromacs/ewald/tests/pmegathertest.cpp | 92 ++--- src/gromacs/ewald/tests/pmesolvetest.cpp | 32 +- .../ewald/tests/pmesplinespreadtest.cpp | 50 +-- src/gromacs/ewald/tests/pmetestcommon.cpp | 4 +- src/gromacs/ewald/tests/pmetestcommon.h | 4 +- src/gromacs/fileio/g96io.cpp | 6 +- src/gromacs/fileio/groio.cpp | 4 +- src/gromacs/fileio/matio.cpp | 12 +- src/gromacs/fileio/pdbio.cpp | 2 +- src/gromacs/gmxana/gmx_analyze.cpp | 2 +- src/gromacs/gmxana/gmx_cluster.cpp | 4 +- src/gromacs/gmxpreprocess/gen_vsite.cpp | 4 +- src/gromacs/gmxpreprocess/vsite_parm.cpp | 2 +- src/gromacs/hardware/cpuinfo.cpp | 28 +- src/gromacs/linearalgebra/gmx_arpack.cpp | 14 +- src/gromacs/listed_forces/tests/bonded.cpp | 8 +- src/gromacs/listed_forces/utilities.h | 2 +- src/gromacs/math/functions.cpp | 24 +- src/gromacs/math/functions.h | 4 +- src/gromacs/mdlib/coupling.cpp | 2 +- src/gromacs/mdlib/sim_util.cpp | 2 +- src/gromacs/mdrun/md.cpp | 4 +- src/gromacs/mdtypes/commrec.h | 4 +- src/gromacs/nbnxm/grid.h | 4 +- src/gromacs/pbcutil/pbcmethods.cpp | 2 +- src/gromacs/pulling/pull.cpp | 2 +- .../impl_arm_neon/impl_arm_neon_simd4_float.h | 8 +- .../impl_arm_neon/impl_arm_neon_simd_float.h | 12 +- .../impl_arm_neon/impl_arm_neon_util_float.h | 6 +- .../impl_arm_neon_asimd_simd4_float.h | 4 +- .../impl_ibm_vmx/impl_ibm_vmx_simd_float.h | 8 +- .../impl_ibm_vsx/impl_ibm_vsx_simd4_float.h | 4 +- .../impl_ibm_vsx/impl_ibm_vsx_simd_float.h | 10 +- .../impl_ibm_vsx/impl_ibm_vsx_util_float.h | 10 +- .../impl_reference_simd4_double.h | 4 +- .../impl_reference_simd4_float.h | 12 +- .../impl_reference_simd_double.h | 10 +- .../impl_reference_simd_float.h | 32 +- .../impl_reference_util_float.h | 4 +- .../impl_x86_avx_256_simd_float.h | 6 +- .../impl_x86_avx_512_knl_simd_float.h | 6 +- .../impl_x86_mic/impl_x86_mic_simd_float.h | 8 +- .../impl_x86_sse2/impl_x86_sse2_simd_float.h | 8 +- .../impl_x86_sse4_1_simd_float.h | 6 +- src/gromacs/simd/scalar/scalar.h | 12 +- src/gromacs/simd/scalar/scalar_math.h | 104 +++--- src/gromacs/simd/simd.h | 2 +- src/gromacs/simd/simd_math.h | 324 +++++++++--------- src/gromacs/simd/tests/scalar_math.cpp | 6 +- src/gromacs/tools/mk_angndx.cpp | 2 +- src/gromacs/tools/tune_pme.cpp | 2 +- .../trajectoryanalysis/analysissettings.cpp | 2 +- src/gromacs/utility/bitmask.h | 10 +- src/gromacs/utility/real.h | 4 +- src/testutils/tests/refdata_tests.cpp | 4 +- src/testutils/tests/testasserts_tests.cpp | 48 +-- 66 files changed, 513 insertions(+), 513 deletions(-) diff --git a/src/gromacs/compat/tests/string_view.cpp b/src/gromacs/compat/tests/string_view.cpp index 190a62b115..5f5f1b99c0 100644 --- a/src/gromacs/compat/tests/string_view.cpp +++ b/src/gromacs/compat/tests/string_view.cpp @@ -425,7 +425,7 @@ TEST(StringViewTest, CanCopySubstringWithCopy) EXPECT_TRUE( std::equal( vec.begin(), vec.end(), hello ) ); }{ - std::size_t offset = 3u; std::size_t length = 4u; + std::size_t offset = 3U; std::size_t length = 4U; std::vector vec( length ); sv.copy( data(vec), length, offset ); diff --git a/src/gromacs/coordinateio/outputadapters/setatoms.cpp b/src/gromacs/coordinateio/outputadapters/setatoms.cpp index 78b23bd147..7baddea6ef 100644 --- a/src/gromacs/coordinateio/outputadapters/setatoms.cpp +++ b/src/gromacs/coordinateio/outputadapters/setatoms.cpp @@ -56,7 +56,7 @@ namespace gmx void SetAtoms::checkAbilityDependencies(unsigned long abilities) const { - if ((abilities & convertFlag(moduleRequirements_)) == 0u) + if ((abilities & convertFlag(moduleRequirements_)) == 0U) { std::string errorMessage = "Output file type does not support writing atom information. " "You need to use PDB, GRO or TNG as the file type for this."; diff --git a/src/gromacs/coordinateio/outputadapters/setforces.cpp b/src/gromacs/coordinateio/outputadapters/setforces.cpp index 6f59a05258..232dd26092 100644 --- a/src/gromacs/coordinateio/outputadapters/setforces.cpp +++ b/src/gromacs/coordinateio/outputadapters/setforces.cpp @@ -54,7 +54,7 @@ namespace gmx void SetForces::checkAbilityDependencies(unsigned long abilities) const { - if ((abilities & convertFlag(moduleRequirements_)) == 0u) + if ((abilities & convertFlag(moduleRequirements_)) == 0U) { std::string errorMessage = "Output file type does not support writing forces. " "Only TNG and TRR support this output."; diff --git a/src/gromacs/coordinateio/outputadapters/setprecision.cpp b/src/gromacs/coordinateio/outputadapters/setprecision.cpp index 180ea96743..2697d08343 100644 --- a/src/gromacs/coordinateio/outputadapters/setprecision.cpp +++ b/src/gromacs/coordinateio/outputadapters/setprecision.cpp @@ -56,7 +56,7 @@ namespace gmx void SetPrecision::checkAbilityDependencies(unsigned long abilities) const { - if ((abilities & convertFlag(moduleRequirements_)) == 0u) + if ((abilities & convertFlag(moduleRequirements_)) == 0U) { std::string errorMessage = "Output file type does not support writing variable precision. " "Only XTC and TNG support variable precision."; diff --git a/src/gromacs/coordinateio/outputadapters/setvelocities.cpp b/src/gromacs/coordinateio/outputadapters/setvelocities.cpp index 739082ad2a..1742f32fdd 100644 --- a/src/gromacs/coordinateio/outputadapters/setvelocities.cpp +++ b/src/gromacs/coordinateio/outputadapters/setvelocities.cpp @@ -54,7 +54,7 @@ namespace gmx void SetVelocities::checkAbilityDependencies(unsigned long abilities) const { - if ((abilities & convertFlag(moduleRequirements_)) == 0u) + if ((abilities & convertFlag(moduleRequirements_)) == 0U) { std::string errorMessage = "Output file type does not support writing velocities. " "Only GRO, TRR and TNG support this output."; diff --git a/src/gromacs/coordinateio/tests/testmodule.cpp b/src/gromacs/coordinateio/tests/testmodule.cpp index 8da9305c58..0355de88e2 100644 --- a/src/gromacs/coordinateio/tests/testmodule.cpp +++ b/src/gromacs/coordinateio/tests/testmodule.cpp @@ -59,7 +59,7 @@ namespace test void DummyOutputModule::checkAbilityDependencies(const unsigned long abilities) const { - if ((abilities & convertFlag(moduleRequirements_)) == 0u) + if ((abilities & convertFlag(moduleRequirements_)) == 0U) { std::string errorMessage = "Unhandled module requirements."; GMX_THROW(InconsistentInputError(errorMessage.c_str())); diff --git a/src/gromacs/domdec/dlbtiming.cpp b/src/gromacs/domdec/dlbtiming.cpp index 8180278697..8466bfc69c 100644 --- a/src/gromacs/domdec/dlbtiming.cpp +++ b/src/gromacs/domdec/dlbtiming.cpp @@ -154,7 +154,7 @@ void DDBalanceRegionHandler::closeRegionGpuImpl(float wait /* The actual time could be anywhere between 0 and * waitCyclesEstimate. Using half is the best we can do. */ - const float unknownWaitEstimateFactor = 0.5f; + const float unknownWaitEstimateFactor = 0.5F; waitGpuCyclesEstimate *= unknownWaitEstimateFactor; } diff --git a/src/gromacs/domdec/domdec_topology.cpp b/src/gromacs/domdec/domdec_topology.cpp index 4f527afb70..5009a18faf 100644 --- a/src/gromacs/domdec/domdec_topology.cpp +++ b/src/gromacs/domdec/domdec_topology.cpp @@ -173,9 +173,9 @@ static int nral_rt(int ftype) static gmx_bool dd_check_ftype(int ftype, gmx_bool bBCheck, gmx_bool bConstr, gmx_bool bSettle) { - return ((((interaction_function[ftype].flags & IF_BOND) != 0u) && - ((interaction_function[ftype].flags & IF_VSITE) == 0u) && - (bBCheck || ((interaction_function[ftype].flags & IF_LIMZERO) == 0u))) || + return ((((interaction_function[ftype].flags & IF_BOND) != 0U) && + ((interaction_function[ftype].flags & IF_VSITE) == 0U) && + (bBCheck || ((interaction_function[ftype].flags & IF_LIMZERO) == 0U))) || (bConstr && (ftype == F_CONSTR || ftype == F_CONSTRNC)) || (bSettle && ftype == F_SETTLE)); } @@ -516,7 +516,7 @@ static int low_make_reverse_ilist(const InteractionLists &il_mt, (bConstr && (ftype == F_CONSTR || ftype == F_CONSTRNC)) || (bSettle && ftype == F_SETTLE)) { - const bool bVSite = ((interaction_function[ftype].flags & IF_VSITE) != 0u); + const bool bVSite = ((interaction_function[ftype].flags & IF_VSITE) != 0U); const int nral = NRAL(ftype); const auto &il = il_mt[ftype]; for (int i = 0; i < il.size(); i += 1+nral) diff --git a/src/gromacs/domdec/partition.cpp b/src/gromacs/domdec/partition.cpp index e789d80160..a837d6b825 100644 --- a/src/gromacs/domdec/partition.cpp +++ b/src/gromacs/domdec/partition.cpp @@ -1211,12 +1211,12 @@ static float dd_f_imbal(gmx_domdec_t *dd) { if (dd->comm->load[0].sum > 0) { - return dd->comm->load[0].max*dd->nnodes/dd->comm->load[0].sum - 1.0f; + return dd->comm->load[0].max*dd->nnodes/dd->comm->load[0].sum - 1.0F; } else { /* Something is wrong in the cycle counting, report no load imbalance */ - return 0.0f; + return 0.0F; } } @@ -2846,7 +2846,7 @@ void dd_partition_system(FILE *fplog, if (DDMASTER(dd)) { /* Add the measured cycles to the running average */ - const float averageFactor = 0.1f; + const float averageFactor = 0.1F; comm->cyclesPerStepDlbExpAverage = (1 - averageFactor)*comm->cyclesPerStepDlbExpAverage + averageFactor*comm->cycl[ddCyclStep]/comm->cycl_n[ddCyclStep]; diff --git a/src/gromacs/ewald/pme_only.cpp b/src/gromacs/ewald/pme_only.cpp index e3e948a856..70af46f638 100644 --- a/src/gromacs/ewald/pme_only.cpp +++ b/src/gromacs/ewald/pme_only.cpp @@ -404,7 +404,7 @@ static int gmx_pme_recv_coeffs_coords(gmx_pme_pp *pme_pp, copy_mat(cnb.box, box); *lambda_q = cnb.lambda_q; *lambda_lj = cnb.lambda_lj; - *bEnerVir = ((cnb.flags & PP_PME_ENER_VIR) != 0u); + *bEnerVir = ((cnb.flags & PP_PME_ENER_VIR) != 0U); *step = cnb.step; /* Receive the coordinates in place */ diff --git a/src/gromacs/ewald/tests/pmegathertest.cpp b/src/gromacs/ewald/tests/pmegathertest.cpp index 41d7fdc0c1..db72510636 100644 --- a/src/gromacs/ewald/tests/pmegathertest.cpp +++ b/src/gromacs/ewald/tests/pmegathertest.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2016,2017,2018, by the GROMACS development team, led by + * Copyright (c) 2016,2017,2018,2019, 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. @@ -68,15 +68,15 @@ std::vector const c_sampleBoxes { // normal box Matrix3x3 {{ - 8.0f, 0.0f, 0.0f, - 0.0f, 3.4f, 0.0f, - 0.0f, 0.0f, 2.0f + 8.0F, 0.0F, 0.0F, + 0.0F, 3.4F, 0.0F, + 0.0F, 0.0F, 2.0F }}, // triclinic box Matrix3x3 {{ - 7.0f, 0.0f, 0.0f, - 0.0f, 4.1f, 0.0f, - 3.5f, 2.0f, 12.2f + 7.0F, 0.0F, 0.0F, + 0.0F, 4.1F, 0.0F, + 3.5F, 2.0F, 12.2F }}, }; @@ -93,7 +93,7 @@ std::vector const c_sampleGridSizes //! Random charges std::vector const c_sampleChargesFull { - 4.95f, 3.11f, 3.97f, 1.08f, 2.09f, 1.1f, 4.13f, 3.31f, 2.8f, 5.83f, 5.09f, 6.1f, 2.86f, 0.24f, 5.76f, 5.19f, 0.72f + 4.95F, 3.11F, 3.97F, 1.08F, 2.09F, 1.1F, 4.13F, 3.31F, 2.8F, 5.83F, 5.09F, 6.1F, 2.86F, 0.24F, 5.76F, 5.19F, 0.72F }; //! All the input atom gridline indices @@ -158,19 +158,19 @@ std::vector const c_sampleGridLineIndicesFull //! A lot of bogus input spline values - should have at list (max PME order = 5) * (DIM = 3) * (total unique atom number in all test cases = 16) values std::vector const c_sampleSplineValuesFull { - 0.12f, 0.81f, 0.29f, 0.22f, 0.13f, 0.19f, 0.12f, 0.8f, 0.44f, 0.38f, 0.32f, 0.36f, 0.27f, 0.11f, 0.17f, 0.94f, 0.07f, 0.9f, 0.98f, 0.96f, 0.07f, 0.94f, 0.77f, 0.24f, 0.84f, 0.16f, 0.77f, 0.57f, 0.52f, 0.27f, 0.39f, 0.45f, 0.6f, 0.59f, 0.44f, 0.91f, 0.97f, 0.43f, 0.24f, 0.52f, 0.73f, 0.55f, 0.99f, 0.39f, 0.97f, 0.35f, 0.1f, 0.68f, 0.19f, 0.1f, 0.77f, 0.2f, 0.43f, 0.69f, 0.76f, 0.32f, 0.31f, 0.94f, 0.53f, 0.6f, 0.93f, 0.57f, 0.94f, 0.88f, 0.75f, 0.77f, 0.91f, 0.72f, 0.07f, 0.78f, 0.09f, 0.02f, 0.48f, 0.97f, 0.89f, 0.39f, 0.48f, 0.19f, 0.02f, 0.92f, 0.8f, 0.41f, 0.53f, 0.32f, 0.38f, 0.58f, 0.36f, 0.46f, 0.92f, 0.91f, 0.01f, 0.86f, 0.54f, 0.86f, 0.94f, 0.37f, 0.35f, 0.81f, 0.89f, 0.48f, - 0.34f, 0.18f, 0.11f, 0.02f, 0.87f, 0.95f, 0.66f, 0.67f, 0.38f, 0.45f, 0.04f, 0.94f, 0.54f, 0.76f, 0.58f, 0.83f, 0.31f, 0.73f, 0.71f, 0.06f, 0.35f, 0.32f, 0.35f, 0.61f, 0.27f, 0.98f, 0.83f, 0.11f, 0.3f, 0.42f, 0.95f, 0.69f, 0.58f, 0.29f, 0.1f, 0.68f, 0.94f, 0.62f, 0.51f, 0.47f, 0.04f, 0.47f, 0.34f, 0.71f, 0.52f, 0.19f, 0.69f, 0.5f, 0.59f, 0.05f, 0.74f, 0.11f, 0.4f, 0.81f, 0.24f, 0.53f, 0.71f, 0.07f, 0.17f, 0.41f, 0.23f, 0.78f, 0.27f, 0.1f, 0.71f, 0.36f, 0.67f, 0.6f, 0.94f, 0.69f, 0.19f, 0.58f, 0.68f, 0.5f, 0.62f, 0.38f, 0.29f, 0.44f, 0.04f, 0.89f, 0.0f, 0.76f, 0.22f, 0.16f, 0.08f, 0.62f, 0.51f, 0.62f, 0.83f, 0.72f, 0.96f, 0.99f, 0.4f, 0.79f, 0.83f, 0.21f, 0.43f, 0.32f, 0.44f, 0.72f, - 0.21f, 0.4f, 0.93f, 0.07f, 0.11f, 0.41f, 0.24f, 0.04f, 0.36f, 0.15f, 0.92f, 0.08f, 0.99f, 0.35f, 0.42f, 0.7f, 0.17f, 0.39f, 0.69f, 0.0f, 0.86f, 0.89f, 0.59f, 0.81f, 0.77f, 0.15f, 0.89f, 0.17f, 0.76f, 0.67f, 0.58f, 0.78f, 0.26f, 0.19f, 0.69f, 0.18f, 0.46f, 0.6f, 0.69f, 0.23f, 0.34f, 0.3f, 0.64f, 0.34f, 0.6f, 0.99f, 0.69f, 0.57f, 0.75f, 0.07f, 0.36f, 0.75f, 0.81f, 0.8f, 0.42f, 0.09f, 0.94f, 0.66f, 0.35f, 0.67f, 0.34f, 0.66f, 0.02f, 0.47f, 0.78f, 0.21f, 0.02f, 0.18f, 0.42f, 0.2f, 0.46f, 0.34f, 0.4f, 0.46f, 0.96f, 0.86f, 0.25f, 0.25f, 0.22f, 0.37f, 0.59f, 0.19f, 0.45f, 0.61f, 0.04f, 0.71f, 0.77f, 0.51f, 0.77f, 0.15f, 0.78f, 0.36f, 0.62f, 0.24f, 0.86f, 0.2f, 0.77f, 0.08f, 0.09f, 0.3f, - 0.0f, 0.6f, 0.99f, 0.69f, + 0.12F, 0.81F, 0.29F, 0.22F, 0.13F, 0.19F, 0.12F, 0.8F, 0.44F, 0.38F, 0.32F, 0.36F, 0.27F, 0.11F, 0.17F, 0.94F, 0.07F, 0.9F, 0.98F, 0.96F, 0.07F, 0.94F, 0.77F, 0.24F, 0.84F, 0.16F, 0.77F, 0.57F, 0.52F, 0.27F, 0.39F, 0.45F, 0.6F, 0.59F, 0.44F, 0.91F, 0.97F, 0.43F, 0.24F, 0.52F, 0.73F, 0.55F, 0.99F, 0.39F, 0.97F, 0.35F, 0.1F, 0.68F, 0.19F, 0.1F, 0.77F, 0.2F, 0.43F, 0.69F, 0.76F, 0.32F, 0.31F, 0.94F, 0.53F, 0.6F, 0.93F, 0.57F, 0.94F, 0.88F, 0.75F, 0.77F, 0.91F, 0.72F, 0.07F, 0.78F, 0.09F, 0.02F, 0.48F, 0.97F, 0.89F, 0.39F, 0.48F, 0.19F, 0.02F, 0.92F, 0.8F, 0.41F, 0.53F, 0.32F, 0.38F, 0.58F, 0.36F, 0.46F, 0.92F, 0.91F, 0.01F, 0.86F, 0.54F, 0.86F, 0.94F, 0.37F, 0.35F, 0.81F, 0.89F, 0.48F, + 0.34F, 0.18F, 0.11F, 0.02F, 0.87F, 0.95F, 0.66F, 0.67F, 0.38F, 0.45F, 0.04F, 0.94F, 0.54F, 0.76F, 0.58F, 0.83F, 0.31F, 0.73F, 0.71F, 0.06F, 0.35F, 0.32F, 0.35F, 0.61F, 0.27F, 0.98F, 0.83F, 0.11F, 0.3F, 0.42F, 0.95F, 0.69F, 0.58F, 0.29F, 0.1F, 0.68F, 0.94F, 0.62F, 0.51F, 0.47F, 0.04F, 0.47F, 0.34F, 0.71F, 0.52F, 0.19F, 0.69F, 0.5F, 0.59F, 0.05F, 0.74F, 0.11F, 0.4F, 0.81F, 0.24F, 0.53F, 0.71F, 0.07F, 0.17F, 0.41F, 0.23F, 0.78F, 0.27F, 0.1F, 0.71F, 0.36F, 0.67F, 0.6F, 0.94F, 0.69F, 0.19F, 0.58F, 0.68F, 0.5F, 0.62F, 0.38F, 0.29F, 0.44F, 0.04F, 0.89F, 0.0F, 0.76F, 0.22F, 0.16F, 0.08F, 0.62F, 0.51F, 0.62F, 0.83F, 0.72F, 0.96F, 0.99F, 0.4F, 0.79F, 0.83F, 0.21F, 0.43F, 0.32F, 0.44F, 0.72F, + 0.21F, 0.4F, 0.93F, 0.07F, 0.11F, 0.41F, 0.24F, 0.04F, 0.36F, 0.15F, 0.92F, 0.08F, 0.99F, 0.35F, 0.42F, 0.7F, 0.17F, 0.39F, 0.69F, 0.0F, 0.86F, 0.89F, 0.59F, 0.81F, 0.77F, 0.15F, 0.89F, 0.17F, 0.76F, 0.67F, 0.58F, 0.78F, 0.26F, 0.19F, 0.69F, 0.18F, 0.46F, 0.6F, 0.69F, 0.23F, 0.34F, 0.3F, 0.64F, 0.34F, 0.6F, 0.99F, 0.69F, 0.57F, 0.75F, 0.07F, 0.36F, 0.75F, 0.81F, 0.8F, 0.42F, 0.09F, 0.94F, 0.66F, 0.35F, 0.67F, 0.34F, 0.66F, 0.02F, 0.47F, 0.78F, 0.21F, 0.02F, 0.18F, 0.42F, 0.2F, 0.46F, 0.34F, 0.4F, 0.46F, 0.96F, 0.86F, 0.25F, 0.25F, 0.22F, 0.37F, 0.59F, 0.19F, 0.45F, 0.61F, 0.04F, 0.71F, 0.77F, 0.51F, 0.77F, 0.15F, 0.78F, 0.36F, 0.62F, 0.24F, 0.86F, 0.2F, 0.77F, 0.08F, 0.09F, 0.3F, + 0.0F, 0.6F, 0.99F, 0.69F, }; //! A lot of bogus input spline derivatives - should have at list (max PME order = 5) * (DIM = 3) * (total unique atom number in all test cases = 16) values std::vector const c_sampleSplineDerivativesFull { - 0.82f, 0.88f, 0.83f, 0.11f, 0.93f, 0.32f, 0.71f, 0.37f, 0.69f, 0.88f, 0.11f, 0.38f, 0.25f, 0.5f, 0.36f, 0.81f, 0.78f, 0.31f, 0.66f, 0.32f, 0.27f, 0.35f, 0.53f, 0.83f, 0.08f, 0.08f, 0.94f, 0.71f, 0.65f, 0.24f, 0.13f, 0.01f, 0.33f, 0.65f, 0.24f, 0.53f, 0.45f, 0.84f, 0.33f, 0.97f, 0.31f, 0.7f, 0.03f, 0.31f, 0.41f, 0.76f, 0.12f, 0.3f, 0.57f, 0.65f, 0.87f, 0.99f, 0.42f, 0.97f, 0.32f, 0.39f, 0.73f, 0.23f, 0.03f, 0.67f, 0.97f, 0.57f, 0.42f, 0.38f, 0.54f, 0.17f, 0.53f, 0.54f, 0.18f, 0.8f, 0.76f, 0.13f, 0.29f, 0.83f, 0.77f, 0.56f, 0.4f, 0.87f, 0.36f, 0.18f, 0.59f, 0.04f, 0.05f, 0.61f, 0.26f, 0.91f, 0.62f, 0.16f, 0.89f, 0.23f, 0.26f, 0.59f, 0.33f, 0.2f, 0.49f, 0.41f, 0.25f, 0.4f, 0.16f, 0.83f, - 0.44f, 0.82f, 0.21f, 0.95f, 0.14f, 0.8f, 0.37f, 0.31f, 0.41f, 0.53f, 0.15f, 0.85f, 0.78f, 0.17f, 0.92f, 0.03f, 0.13f, 0.2f, 0.03f, 0.33f, 0.87f, 0.38f, 0, 0.08f, 0.79f, 0.36f, 0.53f, 0.05f, 0.07f, 0.94f, 0.23f, 0.85f, 0.13f, 0.27f, 0.23f, 0.22f, 0.26f, 0.38f, 0.15f, 0.48f, 0.18f, 0.33f, 0.23f, 0.62f, 0.1f, 0.36f, 0.99f, 0.07f, 0.02f, 0.04f, 0.09f, 0.29f, 0.52f, 0.29f, 0.83f, 0.97f, 0.61f, 0.81f, 0.49f, 0.56f, 0.08f, 0.09f, 0.03f, 0.65f, 0.46f, 0.1f, 0.06f, 0.06f, 0.39f, 0.29f, 0.04f, 0.03f, 0.1f, 0.83f, 0.94f, 0.59f, 0.97f, 0.82f, 0.2f, 0.66f, 0.23f, 0.11f, 0.03f, 0.16f, 0.27f, 0.53f, 0.94f, 0.46f, 0.43f, 0.29f, 0.97f, 0.64f, 0.46f, 0.37f, 0.43f, 0.48f, 0.37f, 0.93f, 0.5f, 0.2f, - 0.92f, 0.09f, 0.74f, 0.55f, 0.44f, 0.05f, 0.13f, 0.17f, 0.79f, 0.44f, 0.11f, 0.6f, 0.64f, 0.05f, 0.96f, 0.3f, 0.45f, 0.47f, 0.42f, 0.74f, 0.91f, 0.06f, 0.89f, 0.24f, 0.26f, 0.68f, 0.4f, 0.88f, 0.5f, 0.65f, 0.48f, 0.15f, 0.0f, 0.41f, 0.67f, 0.4f, 0.31f, 0.73f, 0.77f, 0.36f, 0.26f, 0.74f, 0.46f, 0.56f, 0.78f, 0.92f, 0.32f, 0.9f, 0.06f, 0.55f, 0.6f, 0.13f, 0.38f, 0.93f, 0.5f, 0.92f, 0.96f, 0.82f, 0.0f, 0.04f, 0.9f, 0.55f, 0.97f, 1.0f, 0.23f, 0.46f, 0.52f, 0.49f, 0.0f, 0.32f, 0.16f, 0.4f, 0.62f, 0.36f, 0.03f, 0.63f, 0.16f, 0.58f, 0.97f, 0.03f, 0.44f, 0.07f, 0.22f, 0.75f, 0.32f, 0.61f, 0.94f, 0.33f, 0.7f, 0.57f, 0.5f, 0.84f, 0.7f, 0.47f, 0.18f, 0.09f, 0.25f, 0.77f, 0.94f, 0.85f, - 0.09f, 0.83f, 0.02f, 0.91f, + 0.82F, 0.88F, 0.83F, 0.11F, 0.93F, 0.32F, 0.71F, 0.37F, 0.69F, 0.88F, 0.11F, 0.38F, 0.25F, 0.5F, 0.36F, 0.81F, 0.78F, 0.31F, 0.66F, 0.32F, 0.27F, 0.35F, 0.53F, 0.83F, 0.08F, 0.08F, 0.94F, 0.71F, 0.65F, 0.24F, 0.13F, 0.01F, 0.33F, 0.65F, 0.24F, 0.53F, 0.45F, 0.84F, 0.33F, 0.97F, 0.31F, 0.7F, 0.03F, 0.31F, 0.41F, 0.76F, 0.12F, 0.3F, 0.57F, 0.65F, 0.87F, 0.99F, 0.42F, 0.97F, 0.32F, 0.39F, 0.73F, 0.23F, 0.03F, 0.67F, 0.97F, 0.57F, 0.42F, 0.38F, 0.54F, 0.17F, 0.53F, 0.54F, 0.18F, 0.8F, 0.76F, 0.13F, 0.29F, 0.83F, 0.77F, 0.56F, 0.4F, 0.87F, 0.36F, 0.18F, 0.59F, 0.04F, 0.05F, 0.61F, 0.26F, 0.91F, 0.62F, 0.16F, 0.89F, 0.23F, 0.26F, 0.59F, 0.33F, 0.2F, 0.49F, 0.41F, 0.25F, 0.4F, 0.16F, 0.83F, + 0.44F, 0.82F, 0.21F, 0.95F, 0.14F, 0.8F, 0.37F, 0.31F, 0.41F, 0.53F, 0.15F, 0.85F, 0.78F, 0.17F, 0.92F, 0.03F, 0.13F, 0.2F, 0.03F, 0.33F, 0.87F, 0.38F, 0, 0.08F, 0.79F, 0.36F, 0.53F, 0.05F, 0.07F, 0.94F, 0.23F, 0.85F, 0.13F, 0.27F, 0.23F, 0.22F, 0.26F, 0.38F, 0.15F, 0.48F, 0.18F, 0.33F, 0.23F, 0.62F, 0.1F, 0.36F, 0.99F, 0.07F, 0.02F, 0.04F, 0.09F, 0.29F, 0.52F, 0.29F, 0.83F, 0.97F, 0.61F, 0.81F, 0.49F, 0.56F, 0.08F, 0.09F, 0.03F, 0.65F, 0.46F, 0.1F, 0.06F, 0.06F, 0.39F, 0.29F, 0.04F, 0.03F, 0.1F, 0.83F, 0.94F, 0.59F, 0.97F, 0.82F, 0.2F, 0.66F, 0.23F, 0.11F, 0.03F, 0.16F, 0.27F, 0.53F, 0.94F, 0.46F, 0.43F, 0.29F, 0.97F, 0.64F, 0.46F, 0.37F, 0.43F, 0.48F, 0.37F, 0.93F, 0.5F, 0.2F, + 0.92F, 0.09F, 0.74F, 0.55F, 0.44F, 0.05F, 0.13F, 0.17F, 0.79F, 0.44F, 0.11F, 0.6F, 0.64F, 0.05F, 0.96F, 0.3F, 0.45F, 0.47F, 0.42F, 0.74F, 0.91F, 0.06F, 0.89F, 0.24F, 0.26F, 0.68F, 0.4F, 0.88F, 0.5F, 0.65F, 0.48F, 0.15F, 0.0F, 0.41F, 0.67F, 0.4F, 0.31F, 0.73F, 0.77F, 0.36F, 0.26F, 0.74F, 0.46F, 0.56F, 0.78F, 0.92F, 0.32F, 0.9F, 0.06F, 0.55F, 0.6F, 0.13F, 0.38F, 0.93F, 0.5F, 0.92F, 0.96F, 0.82F, 0.0F, 0.04F, 0.9F, 0.55F, 0.97F, 1.0F, 0.23F, 0.46F, 0.52F, 0.49F, 0.0F, 0.32F, 0.16F, 0.4F, 0.62F, 0.36F, 0.03F, 0.63F, 0.16F, 0.58F, 0.97F, 0.03F, 0.44F, 0.07F, 0.22F, 0.75F, 0.32F, 0.61F, 0.94F, 0.33F, 0.7F, 0.57F, 0.5F, 0.84F, 0.7F, 0.47F, 0.18F, 0.09F, 0.25F, 0.77F, 0.94F, 0.85F, + 0.09F, 0.83F, 0.02F, 0.91F, }; //! 2 c_sample grids - only non-zero values have to be listed @@ -179,107 +179,107 @@ std::vector const c_sampleGrids SparseRealGridValuesInput {{ IVec { 0, 0, 0 - }, 3.5f + }, 3.5F }, { IVec { 7, 0, 0 - }, -2.5f + }, -2.5F }, { IVec { 3, 5, 7 - }, -0.006f + }, -0.006F }, { IVec { 1, 6, 7 - }, -2.76f + }, -2.76F }, { IVec { 3, 1, 2 - }, 0.6f + }, 0.6F }, { IVec { 6, 2, 4 - }, 7.1f + }, 7.1F }, { IVec { 4, 5, 6 - }, 4.1f + }, 4.1F }, { IVec { 4, 4, 6 - }, -3.7f + }, -3.7F }, }, SparseRealGridValuesInput {{ IVec { 0, 4, 0 - }, 6.f + }, 6.F }, { IVec { 4, 2, 7 - }, 13.76f + }, 13.76F }, { IVec { 0, 6, 7 - }, 3.6f + }, 3.6F }, { IVec { 3, 2, 8 - }, 0.61f + }, 0.61F }, { IVec { 5, 4, 3 - }, 2.1f + }, 2.1F }, { IVec { 2, 5, 10 - }, 3.6f + }, 3.6F }, { IVec { 5, 3, 6 - }, 2.1f + }, 2.1F }, { IVec { 6, 6, 6 - }, 6.1f + }, 6.1F }, } }; //! Input forces for reduction std::vector const c_sampleForcesFull { RVec { - 0.02f, 0.87f, 0.95f + 0.02F, 0.87F, 0.95F }, RVec { - 0.66f, 0.67f, 0.38f + 0.66F, 0.67F, 0.38F }, RVec { - 0.45f, 0.04f, 0.94f + 0.45F, 0.04F, 0.94F }, RVec { - 0.54f, 0.76f, 0.58f + 0.54F, 0.76F, 0.58F }, RVec { - 0.83f, 0.31f, 0.73f + 0.83F, 0.31F, 0.73F }, RVec { - 0.71f, 0.06f, 0.35f + 0.71F, 0.06F, 0.35F }, RVec { - 0.32f, 0.35f, 0.61f + 0.32F, 0.35F, 0.61F }, RVec { - 0.27f, 0.98f, 0.83f + 0.27F, 0.98F, 0.83F }, RVec { - 0.11f, 0.3f, 0.42f + 0.11F, 0.3F, 0.42F }, RVec { - 0.95f, 0.69f, 0.58f + 0.95F, 0.69F, 0.58F }, RVec { - 0.29f, 0.1f, 0.68f + 0.29F, 0.1F, 0.68F }, RVec { - 0.94f, 0.62f, 0.51f + 0.94F, 0.62F, 0.51F }, RVec { - 0.47f, 0.04f, 0.47f + 0.47F, 0.04F, 0.47F }, RVec { - 0.34f, 0.71f, 0.52f + 0.34F, 0.71F, 0.52F } }; diff --git a/src/gromacs/ewald/tests/pmesolvetest.cpp b/src/gromacs/ewald/tests/pmesolvetest.cpp index e7549d85c4..af049a2e39 100644 --- a/src/gromacs/ewald/tests/pmesolvetest.cpp +++ b/src/gromacs/ewald/tests/pmesolvetest.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2016,2017,2018, by the GROMACS development team, led by + * Copyright (c) 2016,2017,2018,2019, 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. @@ -253,15 +253,15 @@ std::vector const c_sampleBoxes { // normal box Matrix3x3 {{ - 8.0f, 0.0f, 0.0f, - 0.0f, 3.4f, 0.0f, - 0.0f, 0.0f, 2.0f + 8.0F, 0.0F, 0.0F, + 0.0F, 3.4F, 0.0F, + 0.0F, 0.0F, 2.0F }}, // triclinic box Matrix3x3 {{ - 7.0f, 0.0f, 0.0f, - 0.0f, 4.1f, 0.0f, - 3.5f, 2.0f, 12.2f + 7.0F, 0.0F, 0.0F, + 0.0F, 4.1F, 0.0F, + 3.5F, 2.0F, 12.2F }}, }; @@ -288,56 +288,56 @@ std::vector const c_sampleGrids IVec { 0, 0, 0 }, t_complex { - 3.5f, 6.7f + 3.5F, 6.7F } }, { IVec { 7, 0, 0 }, t_complex { - -2.5f, -0.7f + -2.5F, -0.7F } }, { IVec { 3, 5, 7 }, t_complex { - -0.006f, 1e-8f + -0.006F, 1e-8F } }, { IVec { 3, 1, 2 }, t_complex { - 0.6f, 7.9f + 0.6F, 7.9F } }, { IVec { 6, 2, 4 }, t_complex { - 30.1f, 2.45f + 30.1F, 2.45F } }, }, SparseComplexGridValuesInput {{ IVec { 0, 4, 0 }, t_complex { - 0.0f, 0.3f + 0.0F, 0.3F } }, { IVec { 4, 2, 7 }, t_complex { - 13.76f, -40.0f + 13.76F, -40.0F } }, { IVec { 0, 6, 7 }, t_complex { - 3.6f, 0.0f + 3.6F, 0.0F } }, { IVec { 2, 5, 10 }, t_complex { - 3.6f, 10.65f + 3.6F, 10.65F } }, } }; diff --git a/src/gromacs/ewald/tests/pmesplinespreadtest.cpp b/src/gromacs/ewald/tests/pmesplinespreadtest.cpp index d8c5beb645..eef1b9fe2d 100644 --- a/src/gromacs/ewald/tests/pmesplinespreadtest.cpp +++ b/src/gromacs/ewald/tests/pmesplinespreadtest.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2016,2017,2018, by the GROMACS development team, led by + * Copyright (c) 2016,2017,2018,2019, 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. @@ -248,15 +248,15 @@ std::vector const c_sampleBoxes { // normal box Matrix3x3 {{ - 8.0f, 0.0f, 0.0f, - 0.0f, 3.4f, 0.0f, - 0.0f, 0.0f, 2.0f + 8.0F, 0.0F, 0.0F, + 0.0F, 3.4F, 0.0F, + 0.0F, 0.0F, 2.0F }}, // triclinic box Matrix3x3 {{ - 7.0f, 0.0f, 0.0f, - 0.0f, 4.1f, 0.0f, - 3.5f, 2.0f, 12.2f + 7.0F, 0.0F, 0.0F, + 0.0F, 4.1F, 0.0F, + 3.5F, 2.0F, 12.2F }}, }; @@ -274,7 +274,7 @@ std::vector const c_sampleGridSizes //! Random charges std::vector const c_sampleChargesFull { - 4.95f, 3.11f, 3.97f, 1.08f, 2.09f, 1.1f, 4.13f, 3.31f, 2.8f, 5.83f, 5.09f, 6.1f, 2.86f, 0.24f, 5.76f, 5.19f, 0.72f + 4.95F, 3.11F, 3.97F, 1.08F, 2.09F, 1.1F, 4.13F, 3.31F, 2.8F, 5.83F, 5.09F, 6.1F, 2.86F, 0.24F, 5.76F, 5.19F, 0.72F }; //! 1 charge auto const c_sampleCharges1 = ChargesVector(c_sampleChargesFull).subArray(0, 1); @@ -287,39 +287,39 @@ auto const c_sampleCharges13 = ChargesVector(c_sampleChargesFull).subArray(3, 13 CoordinatesVector const c_sampleCoordinatesFull { { - 5.59f, 1.37f, 0.95f + 5.59F, 1.37F, 0.95F }, { - 16.0f, 1.02f, 0.22f // 2 box lengths in x + 16.0F, 1.02F, 0.22F // 2 box lengths in x }, { - 0.034f, 1.65f, 0.22f + 0.034F, 1.65F, 0.22F }, { - 0.33f, 0.92f, 1.56f + 0.33F, 0.92F, 1.56F }, { - 1.16f, 0.75f, 0.39f + 1.16F, 0.75F, 0.39F }, { - 0.5f, 1.63f, 1.14f + 0.5F, 1.63F, 1.14F }, { - 16.0001f, 1.52f, 1.19f // > 2 box lengths in x + 16.0001F, 1.52F, 1.19F // > 2 box lengths in x }, { - 1.43f, 1.1f, 4.1f // > 2 box lengths in z + 1.43F, 1.1F, 4.1F // > 2 box lengths in z }, { - -1.08f, 1.19f, 0.08f // negative x + -1.08F, 1.19F, 0.08F // negative x }, { - 1.6f, 0.93f, 0.53f + 1.6F, 0.93F, 0.53F }, { - 1.32f, -1.48f, 0.16f // negative y + 1.32F, -1.48F, 0.16F // negative y }, { - 0.87f, 0.0f, 0.33f + 0.87F, 0.0F, 0.33F }, { - 0.95f, 7.7f, -0.48f // > 2 box lengths in y, negative z + 0.95F, 7.7F, -0.48F // > 2 box lengths in y, negative z }, { - 1.23f, 0.91f, 0.68f + 1.23F, 0.91F, 0.68F }, { - 0.19f, 1.45f, 0.94f + 0.19F, 1.45F, 0.94F }, { - 1.28f, 0.46f, 0.38f + 1.28F, 0.46F, 0.38F }, { - 1.21f, 0.23f, 1.0f + 1.21F, 0.23F, 1.0F } }; //! 1 coordinate vector diff --git a/src/gromacs/ewald/tests/pmetestcommon.cpp b/src/gromacs/ewald/tests/pmetestcommon.cpp index 763d79d682..9a5c5c352b 100644 --- a/src/gromacs/ewald/tests/pmetestcommon.cpp +++ b/src/gromacs/ewald/tests/pmetestcommon.cpp @@ -112,8 +112,8 @@ static PmeSafePointer pmeInitInternal(const t_inputrec *inputRec, const gmx_device_info_t *gpuInfo, PmeGpuProgramHandle pmeGpuProgram, const Matrix3x3 &box, - real ewaldCoeff_q = 1.0f, - real ewaldCoeff_lj = 1.0f + real ewaldCoeff_q = 1.0F, + real ewaldCoeff_lj = 1.0F ) { const MDLogger dummyLogger; diff --git a/src/gromacs/ewald/tests/pmetestcommon.h b/src/gromacs/ewald/tests/pmetestcommon.h index 552f333abc..e9290dbae9 100644 --- a/src/gromacs/ewald/tests/pmetestcommon.h +++ b/src/gromacs/ewald/tests/pmetestcommon.h @@ -122,8 +122,8 @@ PmeSafePointer pmeInitEmpty(const t_inputrec *inputRec, CodePath mode = CodePath::CPU, const gmx_device_info_t *gpuInfo = nullptr, PmeGpuProgramHandle pmeGpuProgram = nullptr, - const Matrix3x3 &box = {{1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f}}, - real ewaldCoeff_q = 0.0f, real ewaldCoeff_lj = 0.0f); + const Matrix3x3 &box = {{1.0F, 0.0F, 0.0F, 0.0F, 1.0F, 0.0F, 0.0F, 0.0F, 1.0F}}, + real ewaldCoeff_q = 0.0F, real ewaldCoeff_lj = 0.0F); //! PME initialization with atom data and system box PmeSafePointer pmeInitAtoms(const t_inputrec *inputRec, CodePath mode, diff --git a/src/gromacs/fileio/g96io.cpp b/src/gromacs/fileio/g96io.cpp index 763db57a1b..ff4dfbf16e 100644 --- a/src/gromacs/fileio/g96io.cpp +++ b/src/gromacs/fileio/g96io.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2016,2017,2018,2019, 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. @@ -460,8 +460,8 @@ void write_g96_conf(FILE *out, const char *title, const t_trxframe *fr, fprintf(out, "BOX\n"); fprintf(out, "%15.9f%15.9f%15.9f", fr->box[XX][XX], fr->box[YY][YY], fr->box[ZZ][ZZ]); - if ((fr->box[XX][YY] != 0.0f) || (fr->box[XX][ZZ] != 0.0f) || (fr->box[YY][XX] != 0.0f) || - (fr->box[YY][ZZ] != 0.0f) || (fr->box[ZZ][XX] != 0.0f) || (fr->box[ZZ][YY] != 0.0f)) + if ((fr->box[XX][YY] != 0.0F) || (fr->box[XX][ZZ] != 0.0F) || (fr->box[YY][XX] != 0.0F) || + (fr->box[YY][ZZ] != 0.0F) || (fr->box[ZZ][XX] != 0.0F) || (fr->box[ZZ][YY] != 0.0F)) { fprintf(out, "%15.9f%15.9f%15.9f%15.9f%15.9f%15.9f", fr->box[XX][YY], fr->box[XX][ZZ], fr->box[YY][XX], diff --git a/src/gromacs/fileio/groio.cpp b/src/gromacs/fileio/groio.cpp index 7014b1868a..d6c93a8e0e 100644 --- a/src/gromacs/fileio/groio.cpp +++ b/src/gromacs/fileio/groio.cpp @@ -436,8 +436,8 @@ static const char *get_hconf_format(bool haveVelocities) static void write_hconf_box(FILE *out, const matrix box) { - if ((box[XX][YY] != 0.0f) || (box[XX][ZZ] != 0.0f) || (box[YY][XX] != 0.0f) || (box[YY][ZZ] != 0.0f) || - (box[ZZ][XX] != 0.0f) || (box[ZZ][YY] != 0.0f)) + if ((box[XX][YY] != 0.0F) || (box[XX][ZZ] != 0.0F) || (box[YY][XX] != 0.0F) || (box[YY][ZZ] != 0.0F) || + (box[ZZ][XX] != 0.0F) || (box[ZZ][YY] != 0.0F)) { fprintf(out, "%10.5f%10.5f%10.5f%10.5f%10.5f%10.5f%10.5f%10.5f%10.5f\n", box[XX][XX], box[YY][YY], box[ZZ][ZZ], diff --git a/src/gromacs/fileio/matio.cpp b/src/gromacs/fileio/matio.cpp index 0dcf881104..ed0e806714 100644 --- a/src/gromacs/fileio/matio.cpp +++ b/src/gromacs/fileio/matio.cpp @@ -1060,8 +1060,8 @@ void write_xpm3(FILE *out, unsigned int flags, write_xpm_header(out, title, legend, label_x, label_y, FALSE); write_xpm_map3(out, n_x, n_y, nlevels, lo, mid, hi, rlo, rmid, rhi); - writeXpmAxis(out, "x", ArrayRef(axis_x, axis_x + n_x + ((flags & MAT_SPATIAL_X) != 0u ? 1 : 0))); - writeXpmAxis(out, "y", ArrayRef(axis_y, axis_y + n_y + ((flags & MAT_SPATIAL_Y) != 0u ? 1 : 0))); + writeXpmAxis(out, "x", ArrayRef(axis_x, axis_x + n_x + ((flags & MAT_SPATIAL_X) != 0U ? 1 : 0))); + writeXpmAxis(out, "y", ArrayRef(axis_y, axis_y + n_y + ((flags & MAT_SPATIAL_Y) != 0U ? 1 : 0))); write_xpm_data3(out, n_x, n_y, mat, lo, mid, hi, *nlevels); } @@ -1096,8 +1096,8 @@ void write_xpm_split(FILE *out, unsigned int flags, write_xpm_header(out, title, legend, label_x, label_y, FALSE); write_xpm_map_split(out, n_x, n_y, nlevel_top, lo_top, hi_top, rlo_top, rhi_top, bDiscreteColor, nlevel_bot, lo_bot, hi_bot, rlo_bot, rhi_bot); - writeXpmAxis(out, "x", ArrayRef(axis_x, axis_x + n_x + ((flags & MAT_SPATIAL_X) != 0u ? 1 : 0))); - writeXpmAxis(out, "y", ArrayRef(axis_y, axis_y + n_y + ((flags & MAT_SPATIAL_Y) != 0u ? 1 : 0))); + writeXpmAxis(out, "x", ArrayRef(axis_x, axis_x + n_x + ((flags & MAT_SPATIAL_X) != 0U ? 1 : 0))); + writeXpmAxis(out, "y", ArrayRef(axis_y, axis_y + n_y + ((flags & MAT_SPATIAL_Y) != 0U ? 1 : 0))); write_xpm_data_split(out, n_x, n_y, mat, lo_top, hi_top, *nlevel_top, lo_bot, hi_bot, *nlevel_bot); } @@ -1132,7 +1132,7 @@ void write_xpm(FILE *out, unsigned int flags, write_xpm_header(out, title, legend, label_x, label_y, FALSE); write_xpm_map(out, n_x, n_y, nlevels, lo, hi, rlo, rhi); - writeXpmAxis(out, "x", ArrayRef(axis_x, axis_x + n_x + ((flags & MAT_SPATIAL_X) != 0u ? 1 : 0))); - writeXpmAxis(out, "y", ArrayRef(axis_y, axis_y + n_y + ((flags & MAT_SPATIAL_Y) != 0u ? 1 : 0))); + writeXpmAxis(out, "x", ArrayRef(axis_x, axis_x + n_x + ((flags & MAT_SPATIAL_X) != 0U ? 1 : 0))); + writeXpmAxis(out, "y", ArrayRef(axis_y, axis_y + n_y + ((flags & MAT_SPATIAL_Y) != 0U ? 1 : 0))); write_xpm_data(out, n_x, n_y, mat, lo, hi, *nlevels); } diff --git a/src/gromacs/fileio/pdbio.cpp b/src/gromacs/fileio/pdbio.cpp index aff5e005cd..2ac27ffd02 100644 --- a/src/gromacs/fileio/pdbio.cpp +++ b/src/gromacs/fileio/pdbio.cpp @@ -316,7 +316,7 @@ void write_pdbfile_indexed(FILE *out, const char *title, fprintf(out, "TITLE %s\n", (title && title[0]) ? title : gmx::bromacs().c_str()); - if (box && ( (norm2(box[XX]) != 0.0f) || (norm2(box[YY]) != 0.0f) || (norm2(box[ZZ]) != 0.0f) ) ) + if (box && ( (norm2(box[XX]) != 0.0F) || (norm2(box[YY]) != 0.0F) || (norm2(box[ZZ]) != 0.0F) ) ) { gmx_write_pdb_box(out, ePBC, box); } diff --git a/src/gromacs/gmxana/gmx_analyze.cpp b/src/gromacs/gmxana/gmx_analyze.cpp index 1dc3769df1..66ea69f083 100644 --- a/src/gromacs/gmxana/gmx_analyze.cpp +++ b/src/gromacs/gmxana/gmx_analyze.cpp @@ -1253,7 +1253,7 @@ int gmx_analyze(int argc, char *argv[]) } printf("\n"); - if (filtlen != 0.0f) + if (filtlen != 0.0F) { filter(filtlen, n, nset, val, dt); } diff --git a/src/gromacs/gmxana/gmx_cluster.cpp b/src/gromacs/gmxana/gmx_cluster.cpp index 619ad7c214..a442db4263 100644 --- a/src/gromacs/gmxana/gmx_cluster.cpp +++ b/src/gromacs/gmxana/gmx_cluster.cpp @@ -568,7 +568,7 @@ static void jarvis_patrick(int n1, real **mat, int M, int P, { for (j = i+1; j < n1; j++) { - if (mcpy[i][j] != 0.0f) + if (mcpy[i][j] != 0.0F) { diff = c[j].clust - c[i].clust; if (diff) @@ -1940,7 +1940,7 @@ int gmx_cluster(int argc, char *argv[]) { for (i1 = i2+1; (i1 < nf); i1++) { - if (rms->mat[i1][i2] != 0.0f) + if (rms->mat[i1][i2] != 0.0F) { rms->mat[i1][i2] = rms->maxrms; } diff --git a/src/gromacs/gmxpreprocess/gen_vsite.cpp b/src/gromacs/gmxpreprocess/gen_vsite.cpp index dacc317552..76e4c0f843 100644 --- a/src/gromacs/gmxpreprocess/gen_vsite.cpp +++ b/src/gromacs/gmxpreprocess/gen_vsite.cpp @@ -554,7 +554,7 @@ static int get_atype(int atom, t_atoms *at, gmx::ArrayRefatom[atom].m != 0.0f) + if (at->atom[atom].m != 0.0F) { type = at->atom[atom].type; } @@ -590,7 +590,7 @@ static real get_amass(int atom, t_atoms *at, gmx::ArrayRefatom[atom].m != 0.0f) + if (at->atom[atom].m != 0.0F) { mass = at->atom[atom].m; } diff --git a/src/gromacs/gmxpreprocess/vsite_parm.cpp b/src/gromacs/gmxpreprocess/vsite_parm.cpp index 8657a1f510..b33fcf8f85 100644 --- a/src/gromacs/gmxpreprocess/vsite_parm.cpp +++ b/src/gromacs/gmxpreprocess/vsite_parm.cpp @@ -1019,7 +1019,7 @@ static void clean_vsite_bonds(gmx::ArrayRef plist, (pindex[atom].functionType() == F_VSITE4FD ) || (pindex[atom].functionType() == F_VSITE4FDN ) ); bool bThisOUT = ( (pindex[atom].functionType() == F_VSITE3OUT) && - ((interaction_function[cftype].flags & IF_CONSTRAINT) != 0u) ); + ((interaction_function[cftype].flags & IF_CONSTRAINT) != 0U) ); bAllFD = bAllFD && bThisFD; if (bThisFD || bThisOUT) { diff --git a/src/gromacs/hardware/cpuinfo.cpp b/src/gromacs/hardware/cpuinfo.cpp index 2849a95815..b5425e4b4d 100644 --- a/src/gromacs/hardware/cpuinfo.cpp +++ b/src/gromacs/hardware/cpuinfo.cpp @@ -349,7 +349,7 @@ detectX86Features(std::string * brand, // Check whether Hyper-threading is really possible to enable in the hardware, // not just technically supported by this generation of processors - if ((features->count(CpuInfo::Feature::X86_Htt) != 0u) && maxStdLevel >= 0x4) + if ((features->count(CpuInfo::Feature::X86_Htt) != 0U) && maxStdLevel >= 0x4) { executeX86CpuID(0x1, 0, &eax, &ebx, &ecx, &edx); unsigned int maxLogicalCores = (ebx >> 16) & 0x0ff; @@ -539,7 +539,7 @@ detectAmdApicIdLayout(unsigned int maxExtLevel) executeX86CpuID(0x1, 0, &eax, &ebx, &ecx, &edx); int family = ((eax & 0x0ff00000) >> 20) + ((eax & 0x00000f00) >> 8); executeX86CpuID(0x80000001, 0, &eax, &ebx, &ecx, &edx); - bool haveExtendedTopology = (ecx & (1 << 22)) != 0u; + bool haveExtendedTopology = (ecx & (1 << 22)) != 0U; // NOTE: Here we assume 1 thread per core, unless we have family >= 17h layout.hwThreadBits = 0; @@ -604,8 +604,8 @@ detectX86LogicalProcessors() if (maxStdLevel >= 0x1) { executeX86CpuID(0x1, 0, &eax, &ebx, &ecx, &edx); - haveX2Apic = ((ecx & (1 << 21)) != 0u) && maxStdLevel >= 0xb; - haveApic = ((edx & (1 << 9)) != 0u) && maxExtLevel >= 0x80000008; + haveX2Apic = ((ecx & (1 << 21)) != 0U) && maxStdLevel >= 0xb; + haveApic = ((edx & (1 << 9)) != 0U) && maxExtLevel >= 0x80000008; } else { @@ -761,7 +761,7 @@ detectProcCpuInfoVendor(const std::map &cpuInfo) // testNames map above, and if it's a match return the vendor. for (auto &l : { "vendor_id", "vendor", "manufacture", "model", "processor", "cpu" }) { - if (cpuInfo.count(l) != 0u) + if (cpuInfo.count(l) != 0U) { // there was a line with this left-hand side in /proc/cpuinfo const std::string &s1 = cpuInfo.at(l); @@ -799,11 +799,11 @@ detectProcCpuInfoIbm(const std::map &cpuInfo, std::set * features) { // Get brand string from 'cpu' label if present, otherwise 'Processor' - if (cpuInfo.count("cpu") != 0u) + if (cpuInfo.count("cpu") != 0U) { *brand = cpuInfo.at("cpu"); } - else if (cpuInfo.count("Processor") != 0u) + else if (cpuInfo.count("Processor") != 0U) { *brand = cpuInfo.at("Processor"); } @@ -816,7 +816,7 @@ detectProcCpuInfoIbm(const std::map &cpuInfo, for (auto &l : { "model name", "model", "Processor", "cpu" }) { - if (cpuInfo.count(l) != 0u) + if (cpuInfo.count(l) != 0U) { std::string s1 = cpuInfo.at(l); std::transform(s1.begin(), s1.end(), s1.begin(), ::tolower); @@ -855,16 +855,16 @@ detectProcCpuInfoArm(const std::map &cpuInfo, int * stepping, std::set * features) { - if (cpuInfo.count("Processor") != 0u) + if (cpuInfo.count("Processor") != 0U) { *brand = cpuInfo.at("Processor"); } - else if (cpuInfo.count("model name") != 0u) + else if (cpuInfo.count("model name") != 0U) { *brand = cpuInfo.at("model name"); } - if (cpuInfo.count("CPU architecture") != 0u) + if (cpuInfo.count("CPU architecture") != 0U) { *family = std::strtol(cpuInfo.at("CPU architecture").c_str(), nullptr, 10); // For some 64-bit CPUs it appears to say 'AArch64' instead @@ -873,16 +873,16 @@ detectProcCpuInfoArm(const std::map &cpuInfo, *family = 8; // fragile - no idea how a future ARMv9 will be represented in this case } } - if (cpuInfo.count("CPU variant") != 0u) + if (cpuInfo.count("CPU variant") != 0U) { *model = std::strtol(cpuInfo.at("CPU variant").c_str(), nullptr, 16); } - if (cpuInfo.count("CPU revision") != 0u) + if (cpuInfo.count("CPU revision") != 0U) { *stepping = std::strtol(cpuInfo.at("CPU revision").c_str(), nullptr, 10); } - if (cpuInfo.count("Features") != 0u) + if (cpuInfo.count("Features") != 0U) { const std::string &s = cpuInfo.at("Features"); if (s.find("neon") != std::string::npos) diff --git a/src/gromacs/linearalgebra/gmx_arpack.cpp b/src/gromacs/linearalgebra/gmx_arpack.cpp index d7ea794f4a..a3de65eb74 100644 --- a/src/gromacs/linearalgebra/gmx_arpack.cpp +++ b/src/gromacs/linearalgebra/gmx_arpack.cpp @@ -2,7 +2,7 @@ * This file is part of the GROMACS molecular simulation package. * * Copyright (c) 1991-2004 David van der Spoel, Erik Lindahl, University of Groningen. - * Copyright (c) 2012,2013,2014,2015,2016,2018, by the GROMACS development team, led by + * Copyright (c) 2012,2013,2014,2015,2016,2018,2019, 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. @@ -644,7 +644,7 @@ L40: *rnorm = F77_FUNC(dnrm2, DNRM2) (n, &resid[1], &c__1); } - if (*rnorm > workd[*n * 3 + 4] * .717f) + if (*rnorm > workd[*n * 3 + 4] * .717F) { goto L50; } @@ -1696,7 +1696,7 @@ L70: *rnorm = F77_FUNC(dnrm2, DNRM2) (n, &resid[1], &c__1); } - if (*rnorm > workd[*n * 3 + 3] * .717f) + if (*rnorm > workd[*n * 3 + 3] * .717F) { goto L100; } @@ -1744,7 +1744,7 @@ L90: } - if (workd[*n * 3 + 2] > *rnorm * .717f) + if (workd[*n * 3 + 2] > *rnorm * .717F) { *rnorm = workd[*n * 3 + 2]; @@ -3507,7 +3507,7 @@ L40: *rnorm = F77_FUNC(snrm2, SNRM2) (n, &resid[1], &c__1); } - if (*rnorm > workd[*n * 3 + 4] * .717f) + if (*rnorm > workd[*n * 3 + 4] * .717F) { goto L50; } @@ -4559,7 +4559,7 @@ L70: *rnorm = F77_FUNC(snrm2, SNRM2) (n, &resid[1], &c__1); } - if (*rnorm > workd[*n * 3 + 3] * .717f) + if (*rnorm > workd[*n * 3 + 3] * .717F) { goto L100; } @@ -4607,7 +4607,7 @@ L90: } - if (workd[*n * 3 + 2] > *rnorm * .717f) + if (workd[*n * 3 + 2] > *rnorm * .717F) { *rnorm = workd[*n * 3 + 2]; diff --git a/src/gromacs/listed_forces/tests/bonded.cpp b/src/gromacs/listed_forces/tests/bonded.cpp index f3de6ee7ef..cb62be3610 100644 --- a/src/gromacs/listed_forces/tests/bonded.cpp +++ b/src/gromacs/listed_forces/tests/bonded.cpp @@ -598,12 +598,12 @@ TEST_P (ListedForcesTest, Ifunc) std::vector c_InputBonds = { { iListInput().setHarmonic(F_BONDS, 0.15, 500.0) }, - { iListInput(2e-6f, 1e-8).setHarmonic(F_BONDS, 0.15, 500.0, 0.17, 400.0) }, - { iListInput(1e-4f, 1e-8).setHarmonic(F_G96BONDS, 0.15, 50.0) }, + { iListInput(2e-6F, 1e-8).setHarmonic(F_BONDS, 0.15, 500.0, 0.17, 400.0) }, + { iListInput(1e-4F, 1e-8).setHarmonic(F_G96BONDS, 0.15, 50.0) }, { iListInput().setHarmonic(F_G96BONDS, 0.15, 50.0, 0.17, 40.0) }, { iListInput().setCubic(0.16, 50.0, 2.0) }, - { iListInput(2e-6f, 1e-8).setMorse(0.15, 50.0, 2.0, 0.17, 40.0, 1.6) }, - { iListInput(2e-6f, 1e-8).setMorse(0.15, 30.0, 2.7) }, + { iListInput(2e-6F, 1e-8).setMorse(0.15, 50.0, 2.0, 0.17, 40.0, 1.6) }, + { iListInput(2e-6F, 1e-8).setMorse(0.15, 30.0, 2.7) }, { iListInput().setFene(0.4, 5.0) } }; diff --git a/src/gromacs/listed_forces/utilities.h b/src/gromacs/listed_forces/utilities.h index c652fa5ae3..3f4efac784 100644 --- a/src/gromacs/listed_forces/utilities.h +++ b/src/gromacs/listed_forces/utilities.h @@ -56,7 +56,7 @@ static bool ftype_is_bonded_potential(int ftype) { return - ((interaction_function[ftype].flags & IF_BOND) != 0u) && + ((interaction_function[ftype].flags & IF_BOND) != 0U) && !(ftype == F_CONNBONDS || ftype == F_POSRES || ftype == F_FBPOSRES); } diff --git a/src/gromacs/math/functions.cpp b/src/gromacs/math/functions.cpp index c99718ecfb..f6a4869de8 100644 --- a/src/gromacs/math/functions.cpp +++ b/src/gromacs/math/functions.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2016,2019, 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. @@ -231,42 +231,42 @@ erfinv(float x) { float xabs = std::abs(x); - if (xabs > 1.0f) + if (xabs > 1.0F) { return std::nan(""); } - if (x == 1.0f) + if (x == 1.0F) { return std::numeric_limits::infinity(); } - if (x == -1.0f) + if (x == -1.0F) { return -std::numeric_limits::infinity(); } float res; - if (xabs <= 0.7f) + if (xabs <= 0.7F) { // Rational approximation in range [0,0.7] float z = x*x; - float P = (((-0.140543331f * z + 0.914624893f) * z - 1.645349621f) * z + 0.886226899f); - float Q = ((((0.012229801f * z - 0.329097515f) * z + 1.442710462f) * z - 2.118377725f) * z + 1.0f); + float P = (((-0.140543331F * z + 0.914624893F) * z - 1.645349621F) * z + 0.886226899F); + float Q = ((((0.012229801F * z - 0.329097515F) * z + 1.442710462F) * z - 2.118377725F) * z + 1.0F); res = x * P/Q; } else { // Rational approximation in range [0.7,1) - float z = std::sqrt(-std::log((1.0 - std::abs(x))/2.0f)); - float P = ((1.641345311f * z + 3.429567803f) * z - 1.624906493f) * z - 1.970840454f; - float Q = (1.637067800f * z + 3.543889200f) * z + 1.0f; - res = std::copysign(1.0f, x) * P/Q; + float z = std::sqrt(-std::log((1.0 - std::abs(x))/2.0F)); + float P = ((1.641345311F * z + 3.429567803F) * z - 1.624906493F) * z - 1.970840454F; + float Q = (1.637067800F * z + 3.543889200F) * z + 1.0F; + res = std::copysign(1.0F, x) * P/Q; } // Single N-R iteration sufficient for single precision - res = res - (std::erf(res) - x)/( (2.0f/std::sqrt(M_PI))*std::exp(-res*res)); + res = res - (std::erf(res) - x)/( (2.0F/std::sqrt(M_PI))*std::exp(-res*res)); return res; } diff --git a/src/gromacs/math/functions.h b/src/gromacs/math/functions.h index aa8d9fefb4..5b523ad860 100644 --- a/src/gromacs/math/functions.h +++ b/src/gromacs/math/functions.h @@ -167,7 +167,7 @@ greatestCommonDivisor(std::int64_t p, std::int64_t q); static inline float invsqrt(float x) { - return 1.0f/std::sqrt(x); + return 1.0F/std::sqrt(x); } /*! \brief Calculate 1.0/sqrt(x) in double precision, but single range @@ -210,7 +210,7 @@ invsqrt(int x) static inline float invcbrt(float x) { - return 1.0f/std::cbrt(x); + return 1.0F/std::cbrt(x); } /*! \brief Calculate inverse sixth root of x in double precision diff --git a/src/gromacs/mdlib/coupling.cpp b/src/gromacs/mdlib/coupling.cpp index 796142c71a..1713a16009 100644 --- a/src/gromacs/mdlib/coupling.cpp +++ b/src/gromacs/mdlib/coupling.cpp @@ -608,7 +608,7 @@ void berendsen_pcoupl(FILE *fplog, int64_t step, case epctSURFACETENSION: /* ir->ref_p[0/1] is the reference surface-tension times * * the number of surfaces */ - if (ir->compress[ZZ][ZZ] != 0.0f) + if (ir->compress[ZZ][ZZ] != 0.0F) { p_corr_z = dt/ir->tau_p*(ir->ref_p[ZZ][ZZ] - pres[ZZ][ZZ]); } diff --git a/src/gromacs/mdlib/sim_util.cpp b/src/gromacs/mdlib/sim_util.cpp index 63eb82767f..5f4d39c5c6 100644 --- a/src/gromacs/mdlib/sim_util.cpp +++ b/src/gromacs/mdlib/sim_util.cpp @@ -1477,7 +1477,7 @@ void do_force(FILE *fplog, * but even with a step of 0.1 ms the difference is less than 1% * of the step time. */ - const float gpuWaitApiOverheadMargin = 2e6f; /* cycles */ + const float gpuWaitApiOverheadMargin = 2e6F; /* cycles */ wallcycle_start(wcycle, ewcWAIT_GPU_NB_L); Nbnxm::gpu_wait_finish_task(nbv->gpu_nbv, diff --git a/src/gromacs/mdrun/md.cpp b/src/gromacs/mdrun/md.cpp index f5c247089a..b6473f9ee1 100644 --- a/src/gromacs/mdrun/md.cpp +++ b/src/gromacs/mdrun/md.cpp @@ -426,7 +426,7 @@ void gmx::LegacySimulator::do_md() if (!ir->bContinuation) { - if (state->flags & (1u << estV)) + if (state->flags & (1U << estV)) { auto v = makeArrayRef(state->v); /* Set the velocities of vsites, shells and frozen atoms to zero */ @@ -1543,7 +1543,7 @@ void gmx::LegacySimulator::do_md() /* With all integrators, except VV, we need to retain the pressure * at the current step for coupling at the next step. */ - if ((state->flags & (1u<flags & (1U<nstpcouple > 0 && step % ir->nstpcouple == 0))) { diff --git a/src/gromacs/mdtypes/commrec.h b/src/gromacs/mdtypes/commrec.h index 2625e5026d..9eeb07d79f 100644 --- a/src/gromacs/mdtypes/commrec.h +++ b/src/gromacs/mdtypes/commrec.h @@ -46,8 +46,8 @@ struct mpi_in_place_buf_t; struct gmx_domdec_t; -#define DUTY_PP (1u<<0u) -#define DUTY_PME (1u<<1u) +#define DUTY_PP (1U<<0U) +#define DUTY_PME (1U<<1U) typedef struct { int bUse; diff --git a/src/gromacs/nbnxm/grid.h b/src/gromacs/nbnxm/grid.h index 5387b8c271..3da68f5772 100644 --- a/src/gromacs/nbnxm/grid.h +++ b/src/gromacs/nbnxm/grid.h @@ -329,14 +329,14 @@ class Grid //! Returns whether any atom in the cluster is perturbed bool clusterIsPerturbed(int clusterIndex) const { - return fep_[clusterIndex] != 0u; + return fep_[clusterIndex] != 0U; } //! Returns whether the given atom in the cluster is perturbed bool atomIsPerturbed(int clusterIndex, int atomIndexInCluster) const { - return (fep_[clusterIndex] & (1 << atomIndexInCluster)) != 0u; + return (fep_[clusterIndex] & (1 << atomIndexInCluster)) != 0U; } //! Returns the free-energy perturbation bits for the cluster diff --git a/src/gromacs/pbcutil/pbcmethods.cpp b/src/gromacs/pbcutil/pbcmethods.cpp index bb01ded3c0..11af37418c 100644 --- a/src/gromacs/pbcutil/pbcmethods.cpp +++ b/src/gromacs/pbcutil/pbcmethods.cpp @@ -341,7 +341,7 @@ void put_residue_com_in_box(int unitcell_enum, int ecenter, break; } rvec_sub(newCom, com, shift); - if (norm2(shift) != 0.0f) + if (norm2(shift) != 0.0F) { if (debug) { diff --git a/src/gromacs/pulling/pull.cpp b/src/gromacs/pulling/pull.cpp index 1b0663bb1d..1745d4c5fa 100644 --- a/src/gromacs/pulling/pull.cpp +++ b/src/gromacs/pulling/pull.cpp @@ -1780,7 +1780,7 @@ static void init_pull_group_index(FILE *fplog, const t_commrec *cr, else if (ir->eI == eiBD) { real mbd; - if (ir->bd_fric != 0.0f) + if (ir->bd_fric != 0.0F) { mbd = ir->bd_fric*ir->delta_t; } diff --git a/src/gromacs/simd/impl_arm_neon/impl_arm_neon_simd4_float.h b/src/gromacs/simd/impl_arm_neon/impl_arm_neon_simd4_float.h index c05635ee66..83d12729d8 100644 --- a/src/gromacs/simd/impl_arm_neon/impl_arm_neon_simd4_float.h +++ b/src/gromacs/simd/impl_arm_neon/impl_arm_neon_simd4_float.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2014,2015, by the GROMACS development team, led by + * Copyright (c) 2014,2015,2019, 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. @@ -106,7 +106,7 @@ static inline Simd4Float gmx_simdcall simd4SetZeroF() { return { - vdupq_n_f32(0.0f) + vdupq_n_f32(0.0F) }; } @@ -268,7 +268,7 @@ round(Simd4Float x) { // Convert x to nearest integer float32x4_t signBitOfX = vreinterpretq_f32_u32(vandq_u32(vdupq_n_u32(0x80000000), vreinterpretq_u32_f32(x.simdInternal_))); - float32x4_t half = vdupq_n_f32(0.5f); + float32x4_t half = vdupq_n_f32(0.5F); float32x4_t corr = vreinterpretq_f32_u32(vorrq_u32(vreinterpretq_u32_f32(half), vreinterpretq_u32_f32(signBitOfX))); int32x4_t integerX = vcvtq_s32_f32(vaddq_f32(x.simdInternal_, corr)); @@ -413,7 +413,7 @@ dotProduct(Simd4Float a, Simd4Float b) c = a * b; /* set 4th element to 0, then add all of them */ - c.simdInternal_ = vsetq_lane_f32(0.0f, c.simdInternal_, 3); + c.simdInternal_ = vsetq_lane_f32(0.0F, c.simdInternal_, 3); return reduce(c); } #endif diff --git a/src/gromacs/simd/impl_arm_neon/impl_arm_neon_simd_float.h b/src/gromacs/simd/impl_arm_neon/impl_arm_neon_simd_float.h index 9635671b36..67fcd4d6f6 100644 --- a/src/gromacs/simd/impl_arm_neon/impl_arm_neon_simd_float.h +++ b/src/gromacs/simd/impl_arm_neon/impl_arm_neon_simd_float.h @@ -1,7 +1,7 @@ /* * 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,2019, 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. @@ -134,7 +134,7 @@ static inline SimdFloat gmx_simdcall setZeroF() { return { - vdupq_n_f32(0.0f) + vdupq_n_f32(0.0F) }; } @@ -382,7 +382,7 @@ maskzRsqrt(SimdFloat x, SimdFBool m) // The result will always be correct since we mask the result with m, but // for debug builds we also want to make sure not to generate FP exceptions #ifndef NDEBUG - x.simdInternal_ = vbslq_f32(m.simdInternal_, x.simdInternal_, vdupq_n_f32(1.0f)); + x.simdInternal_ = vbslq_f32(m.simdInternal_, x.simdInternal_, vdupq_n_f32(1.0F)); #endif return { vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(vrsqrteq_f32(x.simdInternal_)), @@ -396,7 +396,7 @@ maskzRcp(SimdFloat x, SimdFBool m) // The result will always be correct since we mask the result with m, but // for debug builds we also want to make sure not to generate FP exceptions #ifndef NDEBUG - x.simdInternal_ = vbslq_f32(m.simdInternal_, x.simdInternal_, vdupq_n_f32(1.0f)); + x.simdInternal_ = vbslq_f32(m.simdInternal_, x.simdInternal_, vdupq_n_f32(1.0F)); #endif return { vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(vrecpeq_f32(x.simdInternal_)), @@ -437,7 +437,7 @@ frexp(SimdFloat value, SimdFInt32 * exponent) const int32x4_t exponentMask = vdupq_n_s32(0x7F800000); const int32x4_t mantissaMask = vdupq_n_s32(0x807FFFFF); const int32x4_t exponentBias = vdupq_n_s32(126); // add 1 to make our definition identical to frexp() - const float32x4_t half = vdupq_n_f32(0.5f); + const float32x4_t half = vdupq_n_f32(0.5F); int32x4_t iExponent; iExponent = vandq_s32(vreinterpretq_s32_f32(value.simdInternal_), exponentMask); @@ -727,7 +727,7 @@ static inline SimdFInt32 gmx_simdcall cvtR2I(SimdFloat a) { float32x4_t signBitOfA = vreinterpretq_f32_u32(vandq_u32(vdupq_n_u32(0x80000000), vreinterpretq_u32_f32(a.simdInternal_))); - float32x4_t half = vdupq_n_f32(0.5f); + float32x4_t half = vdupq_n_f32(0.5F); float32x4_t corr = vreinterpretq_f32_u32(vorrq_u32(vreinterpretq_u32_f32(half), vreinterpretq_u32_f32(signBitOfA))); return { diff --git a/src/gromacs/simd/impl_arm_neon/impl_arm_neon_util_float.h b/src/gromacs/simd/impl_arm_neon/impl_arm_neon_util_float.h index 93aaed2561..81c3ff0ea2 100644 --- a/src/gromacs/simd/impl_arm_neon/impl_arm_neon_util_float.h +++ b/src/gromacs/simd/impl_arm_neon/impl_arm_neon_util_float.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2014,2015,2016,2017,2018, by the GROMACS development team, led by + * Copyright (c) 2014,2015,2016,2017,2018,2019, 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. @@ -184,7 +184,7 @@ transposeScatterIncrU(float * base, { // Extra elements means we can use full width-4 load/store operations float32x4x2_t t0 = vuzpq_f32(v0.simdInternal_, v2.simdInternal_); - float32x4x2_t t1 = vuzpq_f32(v1.simdInternal_, vdupq_n_f32(0.0f)); + float32x4x2_t t1 = vuzpq_f32(v1.simdInternal_, vdupq_n_f32(0.0F)); float32x4x2_t t2 = vtrnq_f32(t0.val[0], t1.val[0]); float32x4x2_t t3 = vtrnq_f32(t0.val[1], t1.val[1]); float32x4_t t4 = t2.val[0]; @@ -239,7 +239,7 @@ transposeScatterDecrU(float * base, { // Extra elements means we can use full width-4 load/store operations float32x4x2_t t0 = vuzpq_f32(v0.simdInternal_, v2.simdInternal_); - float32x4x2_t t1 = vuzpq_f32(v1.simdInternal_, vdupq_n_f32(0.0f)); + float32x4x2_t t1 = vuzpq_f32(v1.simdInternal_, vdupq_n_f32(0.0F)); float32x4x2_t t2 = vtrnq_f32(t0.val[0], t1.val[0]); float32x4x2_t t3 = vtrnq_f32(t0.val[1], t1.val[1]); float32x4_t t4 = t2.val[0]; diff --git a/src/gromacs/simd/impl_arm_neon_asimd/impl_arm_neon_asimd_simd4_float.h b/src/gromacs/simd/impl_arm_neon_asimd/impl_arm_neon_asimd_simd4_float.h index 47d691f18d..f501402221 100644 --- a/src/gromacs/simd/impl_arm_neon_asimd/impl_arm_neon_asimd_simd4_float.h +++ b/src/gromacs/simd/impl_arm_neon_asimd/impl_arm_neon_asimd_simd4_float.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2014,2015, by the GROMACS development team, led by + * Copyright (c) 2014,2015,2019, 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. @@ -115,7 +115,7 @@ dotProduct(Simd4Float a, Simd4Float b) c = a * b; /* set 4th element to 0, then add all of them */ - c.simdInternal_ = vsetq_lane_f32(0.0f, c.simdInternal_, 3); + c.simdInternal_ = vsetq_lane_f32(0.0F, c.simdInternal_, 3); return reduce(c); } diff --git a/src/gromacs/simd/impl_ibm_vmx/impl_ibm_vmx_simd_float.h b/src/gromacs/simd/impl_ibm_vmx/impl_ibm_vmx_simd_float.h index e79864d493..cc51a61aeb 100644 --- a/src/gromacs/simd/impl_ibm_vmx/impl_ibm_vmx_simd_float.h +++ b/src/gromacs/simd/impl_ibm_vmx/impl_ibm_vmx_simd_float.h @@ -1,7 +1,7 @@ /* * 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,2019, 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. @@ -305,7 +305,7 @@ static inline SimdFloat gmx_simdcall maskzRsqrt(SimdFloat x, SimdFBool m) { #ifndef NDEBUG - SimdFloat one(1.0f); + SimdFloat one(1.0F); x.simdInternal_ = vec_sel(one.simdInternal_, x.simdInternal_, m.simdInternal_); #endif return { @@ -317,7 +317,7 @@ static inline SimdFloat gmx_simdcall maskzRcp(SimdFloat x, SimdFBool m) { #ifndef NDEBUG - SimdFloat one(1.0f); + SimdFloat one(1.0F); x.simdInternal_ = vec_sel(one.simdInternal_, x.simdInternal_, m.simdInternal_); #endif return { @@ -372,7 +372,7 @@ frexp(SimdFloat value, SimdFInt32 * exponent) const __vector signed int exponentMask = vec_sl(vec_add(vec_splat_s32(15), vec_sl(vec_splat_s32(15), vec_splat_u32(4))), vec_add(vec_splat_u32(15), vec_splat_u32(8))); // 0x7F800000 const __vector signed int exponentBias = vec_sub(vec_sl(vec_splat_s32(1), vec_splat_u32(7)), vec_splat_s32(2)); // 126 - const SimdFloat half(0.5f); + const SimdFloat half(0.5F); __vector signed int iExponent; iExponent = vec_and(reinterpret_cast<__vector signed int>(value.simdInternal_), exponentMask); diff --git a/src/gromacs/simd/impl_ibm_vsx/impl_ibm_vsx_simd4_float.h b/src/gromacs/simd/impl_ibm_vsx/impl_ibm_vsx_simd4_float.h index 9abedb1b42..0876d93ee5 100644 --- a/src/gromacs/simd/impl_ibm_vsx/impl_ibm_vsx_simd4_float.h +++ b/src/gromacs/simd/impl_ibm_vsx/impl_ibm_vsx_simd4_float.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2014,2015,2017,2018, by the GROMACS development team, led by + * Copyright (c) 2014,2015,2017,2018,2019, 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. @@ -128,7 +128,7 @@ static inline Simd4Float gmx_simdcall simd4SetZeroF() { return { - vec_splats(0.0f) + vec_splats(0.0F) }; } diff --git a/src/gromacs/simd/impl_ibm_vsx/impl_ibm_vsx_simd_float.h b/src/gromacs/simd/impl_ibm_vsx/impl_ibm_vsx_simd_float.h index b518e874f3..91f3436a2e 100644 --- a/src/gromacs/simd/impl_ibm_vsx/impl_ibm_vsx_simd_float.h +++ b/src/gromacs/simd/impl_ibm_vsx/impl_ibm_vsx_simd_float.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2014,2015,2016,2017,2018, by the GROMACS development team, led by + * Copyright (c) 2014,2015,2016,2017,2018,2019, 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. @@ -143,7 +143,7 @@ static inline SimdFloat gmx_simdcall setZeroF() { return { - vec_splats(0.0f) + vec_splats(0.0F) }; } @@ -343,7 +343,7 @@ static inline SimdFloat gmx_simdcall maskzRsqrt(SimdFloat x, SimdFBool m) { #ifndef NDEBUG - x.simdInternal_ = vec_sel(vec_splats(1.0f), x.simdInternal_, m.simdInternal_); + x.simdInternal_ = vec_sel(vec_splats(1.0F), x.simdInternal_, m.simdInternal_); #endif return { vec_and(vec_rsqrte(x.simdInternal_), reinterpret_cast<__vector float>(m.simdInternal_)) @@ -354,7 +354,7 @@ static inline SimdFloat gmx_simdcall maskzRcp(SimdFloat x, SimdFBool m) { #ifndef NDEBUG - x.simdInternal_ = vec_sel(vec_splats(1.0f), x.simdInternal_, m.simdInternal_); + x.simdInternal_ = vec_sel(vec_splats(1.0F), x.simdInternal_, m.simdInternal_); #endif return { vec_and(vec_re(x.simdInternal_), reinterpret_cast<__vector float>(m.simdInternal_)) @@ -406,7 +406,7 @@ frexp(SimdFloat value, SimdFInt32 * exponent) { const __vector float exponentMask = reinterpret_cast<__vector float>(vec_splats(0x7F800000U)); const __vector signed int exponentBias = vec_splats(126); - const __vector float half = vec_splats(0.5f); + const __vector float half = vec_splats(0.5F); __vector signed int iExponent; iExponent = reinterpret_cast<__vector signed int>(vec_and(value.simdInternal_, exponentMask)); diff --git a/src/gromacs/simd/impl_ibm_vsx/impl_ibm_vsx_util_float.h b/src/gromacs/simd/impl_ibm_vsx/impl_ibm_vsx_util_float.h index 50e8ce8ad6..c35b7311de 100644 --- a/src/gromacs/simd/impl_ibm_vsx/impl_ibm_vsx_util_float.h +++ b/src/gromacs/simd/impl_ibm_vsx/impl_ibm_vsx_util_float.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2014,2015,2016,2017,2018, by the GROMACS development team, led by + * Copyright (c) 2014,2015,2016,2017,2018,2019, 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. @@ -212,8 +212,8 @@ transposeScatterIncrU(float * base, SimdFloat v3; __vector float t0 = vec_mergeh(v0.simdInternal_, v2.simdInternal_); __vector float t1 = vec_mergel(v0.simdInternal_, v2.simdInternal_); - __vector float t2 = vec_mergeh(v1.simdInternal_, vec_splats(0.0f)); - __vector float t3 = vec_mergel(v1.simdInternal_, vec_splats(0.0f)); + __vector float t2 = vec_mergeh(v1.simdInternal_, vec_splats(0.0F)); + __vector float t3 = vec_mergel(v1.simdInternal_, vec_splats(0.0F)); v0.simdInternal_ = vec_mergeh(t0, t2); v1.simdInternal_ = vec_mergel(t0, t2); v2.simdInternal_ = vec_mergeh(t1, t3); @@ -282,8 +282,8 @@ transposeScatterDecrU(float * base, SimdFloat v3; __vector float t0 = vec_mergeh(v0.simdInternal_, v2.simdInternal_); __vector float t1 = vec_mergel(v0.simdInternal_, v2.simdInternal_); - __vector float t2 = vec_mergeh(v1.simdInternal_, vec_splats(0.0f)); - __vector float t3 = vec_mergel(v1.simdInternal_, vec_splats(0.0f)); + __vector float t2 = vec_mergeh(v1.simdInternal_, vec_splats(0.0F)); + __vector float t3 = vec_mergel(v1.simdInternal_, vec_splats(0.0F)); v0.simdInternal_ = vec_mergeh(t0, t2); v1.simdInternal_ = vec_mergel(t0, t2); v2.simdInternal_ = vec_mergeh(t1, t3); diff --git a/src/gromacs/simd/impl_reference/impl_reference_simd4_double.h b/src/gromacs/simd/impl_reference/impl_reference_simd4_double.h index 1f1f037065..864c167a96 100644 --- a/src/gromacs/simd/impl_reference/impl_reference_simd4_double.h +++ b/src/gromacs/simd/impl_reference/impl_reference_simd4_double.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2014,2015, by the GROMACS development team, led by + * Copyright (c) 2014,2015,2019, 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. @@ -454,7 +454,7 @@ rsqrt(Simd4Double x) for (std::size_t i = 0; i < res.simdInternal_.size(); i++) { // sic - we only use single precision for the lookup - res.simdInternal_[i] = 1.0f / std::sqrt(static_cast(x.simdInternal_[i])); + res.simdInternal_[i] = 1.0F / std::sqrt(static_cast(x.simdInternal_[i])); } return res; }; diff --git a/src/gromacs/simd/impl_reference/impl_reference_simd4_float.h b/src/gromacs/simd/impl_reference/impl_reference_simd4_float.h index 0478379f93..01a0813916 100644 --- a/src/gromacs/simd/impl_reference/impl_reference_simd4_float.h +++ b/src/gromacs/simd/impl_reference/impl_reference_simd4_float.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2014,2015, by the GROMACS development team, led by + * Copyright (c) 2014,2015,2019, 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. @@ -189,7 +189,7 @@ store4U(float *m, Simd4Float a) static inline Simd4Float gmx_simdcall simd4SetZeroF() { - return Simd4Float(0.0f); + return Simd4Float(0.0F); } @@ -453,7 +453,7 @@ rsqrt(Simd4Float x) for (std::size_t i = 0; i < res.simdInternal_.size(); i++) { - res.simdInternal_[i] = 1.0f / std::sqrt(x.simdInternal_[i]); + res.simdInternal_[i] = 1.0F / std::sqrt(x.simdInternal_[i]); } return res; }; @@ -752,7 +752,7 @@ selectByMask(Simd4Float a, Simd4FBool mask) for (std::size_t i = 0; i < res.simdInternal_.size(); i++) { - res.simdInternal_[i] = mask.simdInternal_[i] ? a.simdInternal_[i] : 0.0f; + res.simdInternal_[i] = mask.simdInternal_[i] ? a.simdInternal_[i] : 0.0F; } return res; } @@ -770,7 +770,7 @@ selectByNotMask(Simd4Float a, Simd4FBool mask) for (std::size_t i = 0; i < res.simdInternal_.size(); i++) { - res.simdInternal_[i] = mask.simdInternal_[i] ? 0.0f : a.simdInternal_[i]; + res.simdInternal_[i] = mask.simdInternal_[i] ? 0.0F : a.simdInternal_[i]; } return res; } @@ -805,7 +805,7 @@ blend(Simd4Float a, Simd4Float b, Simd4FBool sel) static inline float gmx_simdcall reduce(Simd4Float a) { - float sum = 0.0f; + float sum = 0.0F; for (std::size_t i = 0; i < a.simdInternal_.size(); i++) { diff --git a/src/gromacs/simd/impl_reference/impl_reference_simd_double.h b/src/gromacs/simd/impl_reference/impl_reference_simd_double.h index 1774c61592..ba4a1b82d0 100644 --- a/src/gromacs/simd/impl_reference/impl_reference_simd_double.h +++ b/src/gromacs/simd/impl_reference/impl_reference_simd_double.h @@ -1,7 +1,7 @@ /* * 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,2019, 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. @@ -628,7 +628,7 @@ rsqrt(SimdDouble x) for (std::size_t i = 0; i < res.simdInternal_.size(); i++) { // sic - we only use single precision for the lookup - res.simdInternal_[i] = 1.0f / std::sqrt(static_cast(x.simdInternal_[i])); + res.simdInternal_[i] = 1.0F / std::sqrt(static_cast(x.simdInternal_[i])); } return res; }; @@ -649,7 +649,7 @@ rcp(SimdDouble x) for (std::size_t i = 0; i < res.simdInternal_.size(); i++) { // sic - we only use single precision for the lookup - res.simdInternal_[i] = 1.0f / static_cast(x.simdInternal_[i]); + res.simdInternal_[i] = 1.0F / static_cast(x.simdInternal_[i]); } return res; }; @@ -730,7 +730,7 @@ maskzRsqrt(SimdDouble x, SimdDBool m) for (std::size_t i = 0; i < res.simdInternal_.size(); i++) { // sic - we only use single precision for the lookup - res.simdInternal_[i] = (m.simdInternal_[i] != 0) ? 1.0f / std::sqrt(static_cast(x.simdInternal_[i])) : 0.0; + res.simdInternal_[i] = (m.simdInternal_[i] != 0) ? 1.0F / std::sqrt(static_cast(x.simdInternal_[i])) : 0.0; } return res; } @@ -752,7 +752,7 @@ maskzRcp(SimdDouble x, SimdDBool m) for (std::size_t i = 0; i < res.simdInternal_.size(); i++) { - res.simdInternal_[i] = (m.simdInternal_[i] != 0) ? 1.0f / static_cast(x.simdInternal_[i]) : 0.0; + res.simdInternal_[i] = (m.simdInternal_[i] != 0) ? 1.0F / static_cast(x.simdInternal_[i]) : 0.0; } return res; } diff --git a/src/gromacs/simd/impl_reference/impl_reference_simd_float.h b/src/gromacs/simd/impl_reference/impl_reference_simd_float.h index c8e4c13d25..5261bc36a7 100644 --- a/src/gromacs/simd/impl_reference/impl_reference_simd_float.h +++ b/src/gromacs/simd/impl_reference/impl_reference_simd_float.h @@ -1,7 +1,7 @@ /* * 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,2019, 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. @@ -249,12 +249,12 @@ storeU(float *m, SimdFloat a) * You should typically just call \ref gmx::setZero(), which uses proxy objects * internally to handle all types rather than adding the suffix used here. * - * \return SIMD 0.0f + * \return SIMD 0.0F */ static inline SimdFloat gmx_simdcall setZeroF() { - return SimdFloat(0.0f); + return SimdFloat(0.0F); } /*! \} */ @@ -626,7 +626,7 @@ rsqrt(SimdFloat x) for (std::size_t i = 0; i < res.simdInternal_.size(); i++) { - res.simdInternal_[i] = 1.0f / std::sqrt(x.simdInternal_[i]); + res.simdInternal_[i] = 1.0F / std::sqrt(x.simdInternal_[i]); } return res; }; @@ -646,7 +646,7 @@ rcp(SimdFloat x) for (std::size_t i = 0; i < res.simdInternal_.size(); i++) { - res.simdInternal_[i] = 1.0f / x.simdInternal_[i]; + res.simdInternal_[i] = 1.0F / x.simdInternal_[i]; } return res; }; @@ -665,7 +665,7 @@ maskAdd(SimdFloat a, SimdFloat b, SimdFBool m) for (std::size_t i = 0; i < res.simdInternal_.size(); i++) { - res.simdInternal_[i] = a.simdInternal_[i] + (m.simdInternal_[i] ? b.simdInternal_[i] : 0.0f); + res.simdInternal_[i] = a.simdInternal_[i] + (m.simdInternal_[i] ? b.simdInternal_[i] : 0.0F); } return res; } @@ -684,7 +684,7 @@ maskzMul(SimdFloat a, SimdFloat b, SimdFBool m) for (std::size_t i = 0; i < res.simdInternal_.size(); i++) { - res.simdInternal_[i] = m.simdInternal_[i] ? (a.simdInternal_[i] * b.simdInternal_[i]) : 0.0f; + res.simdInternal_[i] = m.simdInternal_[i] ? (a.simdInternal_[i] * b.simdInternal_[i]) : 0.0F; } return res; } @@ -704,7 +704,7 @@ maskzFma(SimdFloat a, SimdFloat b, SimdFloat c, SimdFBool m) for (std::size_t i = 0; i < res.simdInternal_.size(); i++) { - res.simdInternal_[i] = m.simdInternal_[i] ? (a.simdInternal_[i] * b.simdInternal_[i] + c.simdInternal_[i]) : 0.0f; + res.simdInternal_[i] = m.simdInternal_[i] ? (a.simdInternal_[i] * b.simdInternal_[i] + c.simdInternal_[i]) : 0.0F; } return res; } @@ -726,7 +726,7 @@ maskzRsqrt(SimdFloat x, SimdFBool m) for (std::size_t i = 0; i < res.simdInternal_.size(); i++) { - res.simdInternal_[i] = (m.simdInternal_[i] != 0) ? 1.0f / std::sqrt(x.simdInternal_[i]) : 0.0f; + res.simdInternal_[i] = (m.simdInternal_[i] != 0) ? 1.0F / std::sqrt(x.simdInternal_[i]) : 0.0F; } return res; } @@ -748,7 +748,7 @@ maskzRcp(SimdFloat x, SimdFBool m) for (std::size_t i = 0; i < res.simdInternal_.size(); i++) { - res.simdInternal_[i] = (m.simdInternal_[i] != 0) ? 1.0f / x.simdInternal_[i] : 0.0f; + res.simdInternal_[i] = (m.simdInternal_[i] != 0) ? 1.0F / x.simdInternal_[i] : 0.0F; } return res; } @@ -903,7 +903,7 @@ ldexp(SimdFloat value, SimdFInt32 exponent) static inline float gmx_simdcall reduce(SimdFloat a) { - float sum = 0.0f; + float sum = 0.0F; for (std::size_t i = 0; i < a.simdInternal_.size(); i++) { @@ -997,7 +997,7 @@ operator<=(SimdFloat a, SimdFloat b) /*! \brief Return true if any bits are set in the single precision SIMD. * * This function is used to handle bitmasks, mainly for exclusions in the - * inner kernels. Note that it will return true even for -0.0f (sign bit set), + * inner kernels. Note that it will return true even for -0.0F (sign bit set), * so it is not identical to not-equal. * * \param a value @@ -1098,7 +1098,7 @@ selectByMask(SimdFloat a, SimdFBool mask) for (std::size_t i = 0; i < res.simdInternal_.size(); i++) { - res.simdInternal_[i] = mask.simdInternal_[i] ? a.simdInternal_[i] : 0.0f; + res.simdInternal_[i] = mask.simdInternal_[i] ? a.simdInternal_[i] : 0.0F; } return res; } @@ -1116,7 +1116,7 @@ selectByNotMask(SimdFloat a, SimdFBool mask) for (std::size_t i = 0; i < res.simdInternal_.size(); i++) { - res.simdInternal_[i] = mask.simdInternal_[i] ? 0.0f : a.simdInternal_[i]; + res.simdInternal_[i] = mask.simdInternal_[i] ? 0.0F : a.simdInternal_[i]; } return res; } @@ -1447,7 +1447,7 @@ selectByMask(SimdFInt32 a, SimdFIBool mask) for (std::size_t i = 0; i < res.simdInternal_.size(); i++) { - res.simdInternal_[i] = mask.simdInternal_[i] ? a.simdInternal_[i] : 0.0f; + res.simdInternal_[i] = mask.simdInternal_[i] ? a.simdInternal_[i] : 0.0F; } return res; } @@ -1467,7 +1467,7 @@ selectByNotMask(SimdFInt32 a, SimdFIBool mask) for (std::size_t i = 0; i < res.simdInternal_.size(); i++) { - res.simdInternal_[i] = mask.simdInternal_[i] ? 0.0f : a.simdInternal_[i]; + res.simdInternal_[i] = mask.simdInternal_[i] ? 0.0F : a.simdInternal_[i]; } return res; } diff --git a/src/gromacs/simd/impl_reference/impl_reference_util_float.h b/src/gromacs/simd/impl_reference/impl_reference_util_float.h index 422e571ab3..51e1a725ef 100644 --- a/src/gromacs/simd/impl_reference/impl_reference_util_float.h +++ b/src/gromacs/simd/impl_reference/impl_reference_util_float.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2014,2015,2017, by the GROMACS development team, led by + * Copyright (c) 2014,2015,2017,2019, 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. @@ -931,7 +931,7 @@ reduceIncr4ReturnSumHsimd(float * m, SimdFloat v1) { // The 4 here corresponds to the 4 elements in memory, not any SIMD width - float sum[4] = { 0.0f, 0.0f, 0.0f, 0.0f }; + float sum[4] = { 0.0F, 0.0F, 0.0F, 0.0F }; for (std::size_t i = 0; i < v0.simdInternal_.size()/2; i++) { diff --git a/src/gromacs/simd/impl_x86_avx_256/impl_x86_avx_256_simd_float.h b/src/gromacs/simd/impl_x86_avx_256/impl_x86_avx_256_simd_float.h index c65023ef4d..bd3e5fd399 100644 --- a/src/gromacs/simd/impl_x86_avx_256/impl_x86_avx_256_simd_float.h +++ b/src/gromacs/simd/impl_x86_avx_256/impl_x86_avx_256_simd_float.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2014,2015,2016,2017,2018, by the GROMACS development team, led by + * Copyright (c) 2014,2015,2016,2017,2018,2019, 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. @@ -314,7 +314,7 @@ static inline SimdFloat maskzRsqrt(SimdFloat x, SimdFBool m) { #ifndef NDEBUG - x.simdInternal_ = _mm256_blendv_ps(_mm256_set1_ps(1.0f), x.simdInternal_, m.simdInternal_); + x.simdInternal_ = _mm256_blendv_ps(_mm256_set1_ps(1.0F), x.simdInternal_, m.simdInternal_); #endif return { _mm256_and_ps(_mm256_rsqrt_ps(x.simdInternal_), m.simdInternal_) @@ -325,7 +325,7 @@ static inline SimdFloat maskzRcp(SimdFloat x, SimdFBool m) { #ifndef NDEBUG - x.simdInternal_ = _mm256_blendv_ps(_mm256_set1_ps(1.0f), x.simdInternal_, m.simdInternal_); + x.simdInternal_ = _mm256_blendv_ps(_mm256_set1_ps(1.0F), x.simdInternal_, m.simdInternal_); #endif return { _mm256_and_ps(_mm256_rcp_ps(x.simdInternal_), m.simdInternal_) diff --git a/src/gromacs/simd/impl_x86_avx_512_knl/impl_x86_avx_512_knl_simd_float.h b/src/gromacs/simd/impl_x86_avx_512_knl/impl_x86_avx_512_knl_simd_float.h index a33206c67d..3c6749a67a 100644 --- a/src/gromacs/simd/impl_x86_avx_512_knl/impl_x86_avx_512_knl_simd_float.h +++ b/src/gromacs/simd/impl_x86_avx_512_knl/impl_x86_avx_512_knl_simd_float.h @@ -1,7 +1,7 @@ /* * 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,2019, 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. @@ -91,8 +91,8 @@ template static inline SimdFloat gmx_simdcall exp(SimdFloat x) { - const __m512 argscale = _mm512_set1_ps(1.44269504088896341f); - const __m512 invargscale = _mm512_set1_ps(-0.69314718055994528623f); + const __m512 argscale = _mm512_set1_ps(1.44269504088896341F); + const __m512 invargscale = _mm512_set1_ps(-0.69314718055994528623F); if (opt == MathOptimization::Safe) { diff --git a/src/gromacs/simd/impl_x86_mic/impl_x86_mic_simd_float.h b/src/gromacs/simd/impl_x86_mic/impl_x86_mic_simd_float.h index 0b766b366b..87b9b8f318 100644 --- a/src/gromacs/simd/impl_x86_mic/impl_x86_mic_simd_float.h +++ b/src/gromacs/simd/impl_x86_mic/impl_x86_mic_simd_float.h @@ -1,7 +1,7 @@ /* * 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,2019, 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. @@ -692,8 +692,8 @@ template static inline SimdFloat gmx_simdcall exp(SimdFloat x) { - const __m512 argscale = _mm512_set1_ps(1.44269504088896341f); - const __m512 invargscale = _mm512_set1_ps(-0.69314718055994528623f); + const __m512 argscale = _mm512_set1_ps(1.44269504088896341F); + const __m512 invargscale = _mm512_set1_ps(-0.69314718055994528623F); if (opt == MathOptimization::Safe) { @@ -728,7 +728,7 @@ static inline SimdFloat gmx_simdcall log(SimdFloat x) { return { - _mm512_mul_ps(_mm512_set1_ps(0.693147180559945286226764f), _mm512_log2ae23_ps(x.simdInternal_)) + _mm512_mul_ps(_mm512_set1_ps(0.693147180559945286226764F), _mm512_log2ae23_ps(x.simdInternal_)) }; } diff --git a/src/gromacs/simd/impl_x86_sse2/impl_x86_sse2_simd_float.h b/src/gromacs/simd/impl_x86_sse2/impl_x86_sse2_simd_float.h index a11682c365..4cfd589a29 100644 --- a/src/gromacs/simd/impl_x86_sse2/impl_x86_sse2_simd_float.h +++ b/src/gromacs/simd/impl_x86_sse2/impl_x86_sse2_simd_float.h @@ -1,7 +1,7 @@ /* * 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,2019, 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. @@ -329,7 +329,7 @@ static inline SimdFloat gmx_simdcall maskzRsqrt(SimdFloat x, SimdFBool m) { #ifndef NDEBUG - x.simdInternal_ = _mm_or_ps(_mm_andnot_ps(m.simdInternal_, _mm_set1_ps(1.0f)), _mm_and_ps(m.simdInternal_, x.simdInternal_)); + x.simdInternal_ = _mm_or_ps(_mm_andnot_ps(m.simdInternal_, _mm_set1_ps(1.0F)), _mm_and_ps(m.simdInternal_, x.simdInternal_)); #endif return { _mm_and_ps(_mm_rsqrt_ps(x.simdInternal_), m.simdInternal_) @@ -340,7 +340,7 @@ static inline SimdFloat gmx_simdcall maskzRcp(SimdFloat x, SimdFBool m) { #ifndef NDEBUG - x.simdInternal_ = _mm_or_ps(_mm_andnot_ps(m.simdInternal_, _mm_set1_ps(1.0f)), _mm_and_ps(m.simdInternal_, x.simdInternal_)); + x.simdInternal_ = _mm_or_ps(_mm_andnot_ps(m.simdInternal_, _mm_set1_ps(1.0F)), _mm_and_ps(m.simdInternal_, x.simdInternal_)); #endif return { _mm_and_ps(_mm_rcp_ps(x.simdInternal_), m.simdInternal_) @@ -398,7 +398,7 @@ frexp(SimdFloat value, SimdFInt32 * exponent) const __m128 exponentMask = _mm_castsi128_ps(_mm_set1_epi32(0x7F800000)); const __m128 mantissaMask = _mm_castsi128_ps(_mm_set1_epi32(0x807FFFFF)); const __m128i exponentBias = _mm_set1_epi32(126); // add 1 to make our definition identical to frexp() - const __m128 half = _mm_set1_ps(0.5f); + const __m128 half = _mm_set1_ps(0.5F); __m128i iExponent; iExponent = _mm_castps_si128(_mm_and_ps(value.simdInternal_, exponentMask)); diff --git a/src/gromacs/simd/impl_x86_sse4_1/impl_x86_sse4_1_simd_float.h b/src/gromacs/simd/impl_x86_sse4_1/impl_x86_sse4_1_simd_float.h index a0df1808bf..b4a89c5fa3 100644 --- a/src/gromacs/simd/impl_x86_sse4_1/impl_x86_sse4_1_simd_float.h +++ b/src/gromacs/simd/impl_x86_sse4_1/impl_x86_sse4_1_simd_float.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2014,2015,2017, by the GROMACS development team, led by + * Copyright (c) 2014,2015,2017,2019, 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. @@ -56,7 +56,7 @@ static inline SimdFloat maskzRsqrt(SimdFloat x, SimdFBool m) { #ifndef NDEBUG - x.simdInternal_ = _mm_blendv_ps(_mm_set1_ps(1.0f), x.simdInternal_, m.simdInternal_); + x.simdInternal_ = _mm_blendv_ps(_mm_set1_ps(1.0F), x.simdInternal_, m.simdInternal_); #endif return { _mm_and_ps(_mm_rsqrt_ps(x.simdInternal_), m.simdInternal_) @@ -67,7 +67,7 @@ static inline SimdFloat maskzRcp(SimdFloat x, SimdFBool m) { #ifndef NDEBUG - x.simdInternal_ = _mm_blendv_ps(_mm_set1_ps(1.0f), x.simdInternal_, m.simdInternal_); + x.simdInternal_ = _mm_blendv_ps(_mm_set1_ps(1.0F), x.simdInternal_, m.simdInternal_); #endif return { _mm_and_ps(_mm_rcp_ps(x.simdInternal_), m.simdInternal_) diff --git a/src/gromacs/simd/scalar/scalar.h b/src/gromacs/simd/scalar/scalar.h index df588dbb6f..fb4213d91f 100644 --- a/src/gromacs/simd/scalar/scalar.h +++ b/src/gromacs/simd/scalar/scalar.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2016,2017,2018, by the GROMACS development team, led by + * Copyright (c) 2016,2017,2018,2019, 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. @@ -183,7 +183,7 @@ fnms(float a, float b, float c) static inline float maskAdd(float a, float b, float m) { - return a + (m != 0.0f ? b : 0.0f); + return a + (m != 0.0F ? b : 0.0F); } /*! \brief Multiply two float variables, masked version. @@ -200,7 +200,7 @@ maskAdd(float a, float b, float m) static inline float maskzMul(float a, float b, float m) { - return m != 0.0f ? (a * b) : 0.0f; + return m != 0.0F ? (a * b) : 0.0F; } /*! \brief Float fused multiply-add, masked version. @@ -218,7 +218,7 @@ maskzMul(float a, float b, float m) static inline float maskzFma(float a, float b, float c, float m) { - return m != 0.0f ? (a * b + c) : 0.0f; + return m != 0.0F ? (a * b + c) : 0.0F; } /*! \brief Float Floating-point abs(). @@ -394,7 +394,7 @@ anyTrue(bool a) static inline float selectByMask(float a, bool mask) { - return mask ? a : 0.0f; + return mask ? a : 0.0F; } /*! \brief Select from single precision variable where boolean is false. @@ -410,7 +410,7 @@ selectByMask(float a, bool mask) static inline float selectByNotMask(float a, bool mask) { - return mask ? 0.0f : a; + return mask ? 0.0F : a; } /*! \brief Blend float selection. diff --git a/src/gromacs/simd/scalar/scalar_math.h b/src/gromacs/simd/scalar/scalar_math.h index 834ef7a8e3..b0834a0653 100644 --- a/src/gromacs/simd/scalar/scalar_math.h +++ b/src/gromacs/simd/scalar/scalar_math.h @@ -1,7 +1,7 @@ /* * 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,2019, 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. @@ -115,7 +115,7 @@ invsqrtPair(float x0, float x1, static inline float inv(float x) { - return 1.0f/x; + return 1.0F/x; } /*! \brief Calculate 1/sqrt(x) for masked entry of float. @@ -136,7 +136,7 @@ inv(float x) static inline float maskzInvsqrt(float x, bool m) { - return m ? invsqrt(x) : 0.0f; + return m ? invsqrt(x) : 0.0F; } /*! \brief Calculate 1/x for masked entry of float. @@ -157,7 +157,7 @@ maskzInvsqrt(float x, bool m) static inline float maskzInv(float x, bool m) { - return m ? inv(x) : 0.0f; + return m ? inv(x) : 0.0F; } /*! \brief Float sqrt(x). This is the square root. @@ -391,19 +391,19 @@ atan2(float y, float x) static inline float pmeForceCorrection(float z2) { - const float FN6(-1.7357322914161492954e-8f); - const float FN5(1.4703624142580877519e-6f); - const float FN4(-0.000053401640219807709149f); - const float FN3(0.0010054721316683106153f); - const float FN2(-0.019278317264888380590f); - const float FN1(0.069670166153766424023f); - const float FN0(-0.75225204789749321333f); + const float FN6(-1.7357322914161492954e-8F); + const float FN5(1.4703624142580877519e-6F); + const float FN4(-0.000053401640219807709149F); + const float FN3(0.0010054721316683106153F); + const float FN2(-0.019278317264888380590F); + const float FN1(0.069670166153766424023F); + const float FN0(-0.75225204789749321333F); - const float FD4(0.0011193462567257629232f); - const float FD3(0.014866955030185295499f); - const float FD2(0.11583842382862377919f); - const float FD1(0.50736591960530292870f); - const float FD0(1.0f); + const float FD4(0.0011193462567257629232F); + const float FD3(0.014866955030185295499F); + const float FD2(0.11583842382862377919F); + const float FD1(0.50736591960530292870F); + const float FD0(1.0F); float z4; float polyFN0, polyFN1, polyFD0, polyFD1; @@ -439,18 +439,18 @@ pmeForceCorrection(float z2) static inline float pmePotentialCorrection(float z2) { - const float VN6(1.9296833005951166339e-8f); - const float VN5(-1.4213390571557850962e-6f); - const float VN4(0.000041603292906656984871f); - const float VN3(-0.00013134036773265025626f); - const float VN2(0.038657983986041781264f); - const float VN1(0.11285044772717598220f); - const float VN0(1.1283802385263030286f); + const float VN6(1.9296833005951166339e-8F); + const float VN5(-1.4213390571557850962e-6F); + const float VN4(0.000041603292906656984871F); + const float VN3(-0.00013134036773265025626F); + const float VN2(0.038657983986041781264F); + const float VN1(0.11285044772717598220F); + const float VN0(1.1283802385263030286F); - const float VD3(0.0066752224023576045451f); - const float VD2(0.078647795836373922256f); - const float VD1(0.43336185284710920150f); - const float VD0(1.0f); + const float VD3(0.0066752224023576045451F); + const float VD2(0.078647795836373922256F); + const float VD1(0.43336185284710920150F); + const float VD0(1.0F); float z4; float polyVN0, polyVN1, polyVD0, polyVD1; @@ -959,7 +959,7 @@ invsqrtPairSingleAccuracy(double x0, double x1, static inline double invSingleAccuracy(double x) { - return 1.0f/x; + return 1.0F/x; } /*! \brief Calculate 1/sqrt(x) for masked entry of double, but with single accuracy. @@ -1234,19 +1234,19 @@ atan2SingleAccuracy(double y, double x) static inline double pmeForceCorrectionSingleAccuracy(double z2) { - const float FN6(-1.7357322914161492954e-8f); - const float FN5(1.4703624142580877519e-6f); - const float FN4(-0.000053401640219807709149f); - const float FN3(0.0010054721316683106153f); - const float FN2(-0.019278317264888380590f); - const float FN1(0.069670166153766424023f); - const float FN0(-0.75225204789749321333f); + const float FN6(-1.7357322914161492954e-8F); + const float FN5(1.4703624142580877519e-6F); + const float FN4(-0.000053401640219807709149F); + const float FN3(0.0010054721316683106153F); + const float FN2(-0.019278317264888380590F); + const float FN1(0.069670166153766424023F); + const float FN0(-0.75225204789749321333F); - const float FD4(0.0011193462567257629232f); - const float FD3(0.014866955030185295499f); - const float FD2(0.11583842382862377919f); - const float FD1(0.50736591960530292870f); - const float FD0(1.0f); + const float FD4(0.0011193462567257629232F); + const float FD3(0.014866955030185295499F); + const float FD2(0.11583842382862377919F); + const float FD1(0.50736591960530292870F); + const float FD0(1.0F); float z4; float polyFN0, polyFN1, polyFD0, polyFD1; @@ -1284,18 +1284,18 @@ pmeForceCorrectionSingleAccuracy(double z2) static inline double pmePotentialCorrectionSingleAccuracy(double z2) { - const float VN6(1.9296833005951166339e-8f); - const float VN5(-1.4213390571557850962e-6f); - const float VN4(0.000041603292906656984871f); - const float VN3(-0.00013134036773265025626f); - const float VN2(0.038657983986041781264f); - const float VN1(0.11285044772717598220f); - const float VN0(1.1283802385263030286f); - - const float VD3(0.0066752224023576045451f); - const float VD2(0.078647795836373922256f); - const float VD1(0.43336185284710920150f); - const float VD0(1.0f); + const float VN6(1.9296833005951166339e-8F); + const float VN5(-1.4213390571557850962e-6F); + const float VN4(0.000041603292906656984871F); + const float VN3(-0.00013134036773265025626F); + const float VN2(0.038657983986041781264F); + const float VN1(0.11285044772717598220F); + const float VN0(1.1283802385263030286F); + + const float VD3(0.0066752224023576045451F); + const float VD2(0.078647795836373922256F); + const float VD1(0.43336185284710920150F); + const float VD0(1.0F); float z4; float polyVN0, polyVN1, polyVD0, polyVD1; diff --git a/src/gromacs/simd/simd.h b/src/gromacs/simd/simd.h index 04b7997aa5..49549d523d 100644 --- a/src/gromacs/simd/simd.h +++ b/src/gromacs/simd/simd.h @@ -543,7 +543,7 @@ class SimdSetZeroProxy { public: //!\brief Conversion method that returns 0.0 as float - operator float() const { return 0.0f; } + operator float() const { return 0.0F; } //!\brief Conversion method that returns 0.0 as double operator double() const { return 0.0; } //!\brief Conversion method that returns 0.0 as int32 diff --git a/src/gromacs/simd/simd_math.h b/src/gromacs/simd/simd_math.h index a45ba4b84d..8b2fc7636f 100644 --- a/src/gromacs/simd/simd_math.h +++ b/src/gromacs/simd/simd_math.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2012,2013,2014,2015,2017,2018, by the GROMACS development team, led by + * Copyright (c) 2012,2013,2014,2015,2017,2018,2019, 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. @@ -125,8 +125,8 @@ static inline SimdFloat gmx_simdcall rsqrtIter(SimdFloat lu, SimdFloat x) { SimdFloat tmp1 = x*lu; - SimdFloat tmp2 = SimdFloat(-0.5f)*lu; - tmp1 = fma(tmp1, lu, SimdFloat(-3.0f)); + SimdFloat tmp2 = SimdFloat(-0.5F)*lu; + tmp1 = fma(tmp1, lu, SimdFloat(-3.0F)); return tmp1*tmp2; } #endif @@ -200,7 +200,7 @@ invsqrtPair(SimdFloat x0, SimdFloat x1, static inline SimdFloat gmx_simdcall rcpIter(SimdFloat lu, SimdFloat x) { - return lu*fnma(lu, x, SimdFloat(2.0f)); + return lu*fnma(lu, x, SimdFloat(2.0F)); } #endif @@ -349,15 +349,15 @@ sqrt(SimdFloat x) static inline SimdFloat gmx_simdcall log(SimdFloat x) { - const SimdFloat one(1.0f); - const SimdFloat two(2.0f); - const SimdFloat invsqrt2(1.0f/std::sqrt(2.0f)); - const SimdFloat corr(0.693147180559945286226764f); - const SimdFloat CL9(0.2371599674224853515625f); - const SimdFloat CL7(0.285279005765914916992188f); - const SimdFloat CL5(0.400005519390106201171875f); - const SimdFloat CL3(0.666666567325592041015625f); - const SimdFloat CL1(2.0f); + const SimdFloat one(1.0F); + const SimdFloat two(2.0F); + const SimdFloat invsqrt2(1.0F/std::sqrt(2.0F)); + const SimdFloat corr(0.693147180559945286226764F); + const SimdFloat CL9(0.2371599674224853515625F); + const SimdFloat CL7(0.285279005765914916992188F); + const SimdFloat CL5(0.400005519390106201171875F); + const SimdFloat CL3(0.666666567325592041015625F); + const SimdFloat CL1(2.0F); SimdFloat fExp, x2, p; SimdFBool m; SimdFInt32 iExp; @@ -417,13 +417,13 @@ template static inline SimdFloat gmx_simdcall exp2(SimdFloat x) { - const SimdFloat CC6(0.0001534581200287996416911311f); - const SimdFloat CC5(0.001339993121934088894618990f); - const SimdFloat CC4(0.009618488957115180159497841f); - const SimdFloat CC3(0.05550328776964726865751735f); - const SimdFloat CC2(0.2402264689063408646490722f); - const SimdFloat CC1(0.6931472057372680777553816f); - const SimdFloat one(1.0f); + const SimdFloat CC6(0.0001534581200287996416911311F); + const SimdFloat CC5(0.001339993121934088894618990F); + const SimdFloat CC4(0.009618488957115180159497841F); + const SimdFloat CC3(0.05550328776964726865751735F); + const SimdFloat CC2(0.2402264689063408646490722F); + const SimdFloat CC1(0.6931472057372680777553816F); + const SimdFloat one(1.0F); SimdFloat intpart; SimdFloat fexppart; @@ -504,15 +504,15 @@ template static inline SimdFloat gmx_simdcall exp(SimdFloat x) { - const SimdFloat argscale(1.44269504088896341f); - const SimdFloat invargscale0(-0.693145751953125f); - const SimdFloat invargscale1(-1.428606765330187045e-06f); - const SimdFloat CC4(0.00136324646882712841033936f); - const SimdFloat CC3(0.00836596917361021041870117f); - const SimdFloat CC2(0.0416710823774337768554688f); - const SimdFloat CC1(0.166665524244308471679688f); - const SimdFloat CC0(0.499999850988388061523438f); - const SimdFloat one(1.0f); + const SimdFloat argscale(1.44269504088896341F); + const SimdFloat invargscale0(-0.693145751953125F); + const SimdFloat invargscale1(-1.428606765330187045e-06F); + const SimdFloat CC4(0.00136324646882712841033936F); + const SimdFloat CC3(0.00836596917361021041870117F); + const SimdFloat CC2(0.0416710823774337768554688F); + const SimdFloat CC1(0.166665524244308471679688F); + const SimdFloat CC0(0.499999850988388061523438F); + const SimdFloat one(1.0F); SimdFloat fexppart; SimdFloat intpart; SimdFloat y, p; @@ -573,38 +573,38 @@ static inline SimdFloat gmx_simdcall erf(SimdFloat x) { // Coefficients for minimax approximation of erf(x)=x*P(x^2) in range [-1,1] - const SimdFloat CA6(7.853861353153693e-5f); - const SimdFloat CA5(-8.010193625184903e-4f); - const SimdFloat CA4(5.188327685732524e-3f); - const SimdFloat CA3(-2.685381193529856e-2f); - const SimdFloat CA2(1.128358514861418e-1f); - const SimdFloat CA1(-3.761262582423300e-1f); - const SimdFloat CA0(1.128379165726710f); + const SimdFloat CA6(7.853861353153693e-5F); + const SimdFloat CA5(-8.010193625184903e-4F); + const SimdFloat CA4(5.188327685732524e-3F); + const SimdFloat CA3(-2.685381193529856e-2F); + const SimdFloat CA2(1.128358514861418e-1F); + const SimdFloat CA1(-3.761262582423300e-1F); + const SimdFloat CA0(1.128379165726710F); // Coefficients for minimax approximation of erfc(x)=Exp(-x^2)*P((1/(x-1))^2) in range [0.67,2] - const SimdFloat CB9(-0.0018629930017603923f); - const SimdFloat CB8(0.003909821287598495f); - const SimdFloat CB7(-0.0052094582210355615f); - const SimdFloat CB6(0.005685614362160572f); - const SimdFloat CB5(-0.0025367682853477272f); - const SimdFloat CB4(-0.010199799682318782f); - const SimdFloat CB3(0.04369575504816542f); - const SimdFloat CB2(-0.11884063474674492f); - const SimdFloat CB1(0.2732120154030589f); - const SimdFloat CB0(0.42758357702025784f); + const SimdFloat CB9(-0.0018629930017603923F); + const SimdFloat CB8(0.003909821287598495F); + const SimdFloat CB7(-0.0052094582210355615F); + const SimdFloat CB6(0.005685614362160572F); + const SimdFloat CB5(-0.0025367682853477272F); + const SimdFloat CB4(-0.010199799682318782F); + const SimdFloat CB3(0.04369575504816542F); + const SimdFloat CB2(-0.11884063474674492F); + const SimdFloat CB1(0.2732120154030589F); + const SimdFloat CB0(0.42758357702025784F); // Coefficients for minimax approximation of erfc(x)=Exp(-x^2)*(1/x)*P((1/x)^2) in range [2,9.19] - const SimdFloat CC10(-0.0445555913112064f); - const SimdFloat CC9(0.21376355144663348f); - const SimdFloat CC8(-0.3473187200259257f); - const SimdFloat CC7(0.016690861551248114f); - const SimdFloat CC6(0.7560973182491192f); - const SimdFloat CC5(-1.2137903600145787f); - const SimdFloat CC4(0.8411872321232948f); - const SimdFloat CC3(-0.08670413896296343f); - const SimdFloat CC2(-0.27124782687240334f); - const SimdFloat CC1(-0.0007502488047806069f); - const SimdFloat CC0(0.5642114853803148f); - const SimdFloat one(1.0f); - const SimdFloat two(2.0f); + const SimdFloat CC10(-0.0445555913112064F); + const SimdFloat CC9(0.21376355144663348F); + const SimdFloat CC8(-0.3473187200259257F); + const SimdFloat CC7(0.016690861551248114F); + const SimdFloat CC6(0.7560973182491192F); + const SimdFloat CC5(-1.2137903600145787F); + const SimdFloat CC4(0.8411872321232948F); + const SimdFloat CC3(-0.08670413896296343F); + const SimdFloat CC2(-0.27124782687240334F); + const SimdFloat CC1(-0.0007502488047806069F); + const SimdFloat CC0(0.5642114853803148F); + const SimdFloat one(1.0F); + const SimdFloat two(2.0F); SimdFloat x2, x4, y; SimdFloat t, t2, w, w2; @@ -630,7 +630,7 @@ erf(SimdFloat x) // Calculate erfc y = abs(x); - maskErf = SimdFloat(0.75f) <= y; + maskErf = SimdFloat(0.75F) <= y; t = maskzInv(y, maskErf); w = t-one; t2 = t*t; @@ -693,43 +693,43 @@ static inline SimdFloat gmx_simdcall erfc(SimdFloat x) { // Coefficients for minimax approximation of erf(x)=x*P(x^2) in range [-1,1] - const SimdFloat CA6(7.853861353153693e-5f); - const SimdFloat CA5(-8.010193625184903e-4f); - const SimdFloat CA4(5.188327685732524e-3f); - const SimdFloat CA3(-2.685381193529856e-2f); - const SimdFloat CA2(1.128358514861418e-1f); - const SimdFloat CA1(-3.761262582423300e-1f); - const SimdFloat CA0(1.128379165726710f); + const SimdFloat CA6(7.853861353153693e-5F); + const SimdFloat CA5(-8.010193625184903e-4F); + const SimdFloat CA4(5.188327685732524e-3F); + const SimdFloat CA3(-2.685381193529856e-2F); + const SimdFloat CA2(1.128358514861418e-1F); + const SimdFloat CA1(-3.761262582423300e-1F); + const SimdFloat CA0(1.128379165726710F); // Coefficients for minimax approximation of erfc(x)=Exp(-x^2)*P((1/(x-1))^2) in range [0.67,2] - const SimdFloat CB9(-0.0018629930017603923f); - const SimdFloat CB8(0.003909821287598495f); - const SimdFloat CB7(-0.0052094582210355615f); - const SimdFloat CB6(0.005685614362160572f); - const SimdFloat CB5(-0.0025367682853477272f); - const SimdFloat CB4(-0.010199799682318782f); - const SimdFloat CB3(0.04369575504816542f); - const SimdFloat CB2(-0.11884063474674492f); - const SimdFloat CB1(0.2732120154030589f); - const SimdFloat CB0(0.42758357702025784f); + const SimdFloat CB9(-0.0018629930017603923F); + const SimdFloat CB8(0.003909821287598495F); + const SimdFloat CB7(-0.0052094582210355615F); + const SimdFloat CB6(0.005685614362160572F); + const SimdFloat CB5(-0.0025367682853477272F); + const SimdFloat CB4(-0.010199799682318782F); + const SimdFloat CB3(0.04369575504816542F); + const SimdFloat CB2(-0.11884063474674492F); + const SimdFloat CB1(0.2732120154030589F); + const SimdFloat CB0(0.42758357702025784F); // Coefficients for minimax approximation of erfc(x)=Exp(-x^2)*(1/x)*P((1/x)^2) in range [2,9.19] - const SimdFloat CC10(-0.0445555913112064f); - const SimdFloat CC9(0.21376355144663348f); - const SimdFloat CC8(-0.3473187200259257f); - const SimdFloat CC7(0.016690861551248114f); - const SimdFloat CC6(0.7560973182491192f); - const SimdFloat CC5(-1.2137903600145787f); - const SimdFloat CC4(0.8411872321232948f); - const SimdFloat CC3(-0.08670413896296343f); - const SimdFloat CC2(-0.27124782687240334f); - const SimdFloat CC1(-0.0007502488047806069f); - const SimdFloat CC0(0.5642114853803148f); + const SimdFloat CC10(-0.0445555913112064F); + const SimdFloat CC9(0.21376355144663348F); + const SimdFloat CC8(-0.3473187200259257F); + const SimdFloat CC7(0.016690861551248114F); + const SimdFloat CC6(0.7560973182491192F); + const SimdFloat CC5(-1.2137903600145787F); + const SimdFloat CC4(0.8411872321232948F); + const SimdFloat CC3(-0.08670413896296343F); + const SimdFloat CC2(-0.27124782687240334F); + const SimdFloat CC1(-0.0007502488047806069F); + const SimdFloat CC0(0.5642114853803148F); // Coefficients for expansion of exp(x) in [0,0.1] // CD0 and CD1 are both 1.0, so no need to declare them separately - const SimdFloat CD2(0.5000066608081202f); - const SimdFloat CD3(0.1664795422874624f); - const SimdFloat CD4(0.04379839977652482f); - const SimdFloat one(1.0f); - const SimdFloat two(2.0f); + const SimdFloat CD2(0.5000066608081202F); + const SimdFloat CD3(0.1664795422874624F); + const SimdFloat CD4(0.04379839977652482F); + const SimdFloat one(1.0F); + const SimdFloat two(2.0F); /* We need to use a small trick here, since we cannot assume all SIMD * architectures support integers, and the flag we want (0xfffff000) would @@ -739,7 +739,7 @@ erfc(SimdFloat x) * we can at least hope it is evaluated at compile-time. */ #if GMX_SIMD_HAVE_LOGICAL - const SimdFloat sieve(SimdFloat(-5.965323564e+29f) | SimdFloat(7.05044434e-30f)); + const SimdFloat sieve(SimdFloat(-5.965323564e+29F) | SimdFloat(7.05044434e-30F)); #else const int isieve = 0xFFFFF000; alignas(GMX_SIMD_ALIGNMENT) float mem[GMX_SIMD_FLOAT_WIDTH]; @@ -774,7 +774,7 @@ erfc(SimdFloat x) // Calculate erfc y = abs(x); - msk_erf = SimdFloat(0.75f) <= y; + msk_erf = SimdFloat(0.75F) <= y; t = maskzInv(y, msk_erf); w = t - one; t2 = t * t; @@ -870,18 +870,18 @@ sincos(SimdFloat x, SimdFloat *sinval, SimdFloat *cosval) { // Constants to subtract Pi/4*x from y while minimizing precision loss const SimdFloat argred0(-1.5703125); - const SimdFloat argred1(-4.83751296997070312500e-04f); - const SimdFloat argred2(-7.54953362047672271729e-08f); - const SimdFloat argred3(-2.56334406825708960298e-12f); - const SimdFloat two_over_pi(static_cast(2.0f/M_PI)); - const SimdFloat const_sin2(-1.9515295891e-4f); - const SimdFloat const_sin1( 8.3321608736e-3f); - const SimdFloat const_sin0(-1.6666654611e-1f); - const SimdFloat const_cos2( 2.443315711809948e-5f); - const SimdFloat const_cos1(-1.388731625493765e-3f); - const SimdFloat const_cos0( 4.166664568298827e-2f); - const SimdFloat half(0.5f); - const SimdFloat one(1.0f); + const SimdFloat argred1(-4.83751296997070312500e-04F); + const SimdFloat argred2(-7.54953362047672271729e-08F); + const SimdFloat argred3(-2.56334406825708960298e-12F); + const SimdFloat two_over_pi(static_cast(2.0F/M_PI)); + const SimdFloat const_sin2(-1.9515295891e-4F); + const SimdFloat const_sin1( 8.3321608736e-3F); + const SimdFloat const_sin0(-1.6666654611e-1F); + const SimdFloat const_cos2( 2.443315711809948e-5F); + const SimdFloat const_cos1(-1.388731625493765e-3F); + const SimdFloat const_cos0( 4.166664568298827e-2F); + const SimdFloat half(0.5F); + const SimdFloat one(1.0F); SimdFloat ssign, csign; SimdFloat x2, y, z, psin, pcos, sss, ccc; SimdFBool m; @@ -1018,10 +1018,10 @@ static inline SimdFloat gmx_simdcall tan(SimdFloat x) { const SimdFloat argred0(-1.5703125); - const SimdFloat argred1(-4.83751296997070312500e-04f); - const SimdFloat argred2(-7.54953362047672271729e-08f); - const SimdFloat argred3(-2.56334406825708960298e-12f); - const SimdFloat two_over_pi(static_cast(2.0f/M_PI)); + const SimdFloat argred1(-4.83751296997070312500e-04F); + const SimdFloat argred2(-7.54953362047672271729e-08F); + const SimdFloat argred3(-2.56334406825708960298e-12F); + const SimdFloat two_over_pi(static_cast(2.0F/M_PI)); const SimdFloat CT6(0.009498288995810566122993911); const SimdFloat CT5(0.002895755790837379295226923); const SimdFloat CT4(0.02460087336161924491836265); @@ -1090,15 +1090,15 @@ tan(SimdFloat x) static inline SimdFloat gmx_simdcall asin(SimdFloat x) { - const SimdFloat limitlow(1e-4f); - const SimdFloat half(0.5f); - const SimdFloat one(1.0f); - const SimdFloat halfpi(static_cast(M_PI/2.0f)); - const SimdFloat CC5(4.2163199048E-2f); - const SimdFloat CC4(2.4181311049E-2f); - const SimdFloat CC3(4.5470025998E-2f); - const SimdFloat CC2(7.4953002686E-2f); - const SimdFloat CC1(1.6666752422E-1f); + const SimdFloat limitlow(1e-4F); + const SimdFloat half(0.5F); + const SimdFloat one(1.0F); + const SimdFloat halfpi(static_cast(M_PI/2.0F)); + const SimdFloat CC5(4.2163199048E-2F); + const SimdFloat CC4(2.4181311049E-2F); + const SimdFloat CC3(4.5470025998E-2F); + const SimdFloat CC2(7.4953002686E-2F); + const SimdFloat CC1(1.6666752422E-1F); SimdFloat xabs; SimdFloat z, z1, z2, q, q1, q2; SimdFloat pA, pB; @@ -1140,10 +1140,10 @@ asin(SimdFloat x) static inline SimdFloat gmx_simdcall acos(SimdFloat x) { - const SimdFloat one(1.0f); - const SimdFloat half(0.5f); + const SimdFloat one(1.0F); + const SimdFloat half(0.5F); const SimdFloat pi(static_cast(M_PI)); - const SimdFloat halfpi(static_cast(M_PI/2.0f)); + const SimdFloat halfpi(static_cast(M_PI/2.0F)); SimdFloat xabs; SimdFloat z, z1, z2, z3; SimdFBool m1, m2, m3; @@ -1175,16 +1175,16 @@ acos(SimdFloat x) static inline SimdFloat gmx_simdcall atan(SimdFloat x) { - const SimdFloat halfpi(static_cast(M_PI/2.0f)); - const SimdFloat CA17(0.002823638962581753730774f); - const SimdFloat CA15(-0.01595690287649631500244f); - const SimdFloat CA13(0.04250498861074447631836f); - const SimdFloat CA11(-0.07489009201526641845703f); - const SimdFloat CA9 (0.1063479334115982055664f); - const SimdFloat CA7 (-0.1420273631811141967773f); - const SimdFloat CA5 (0.1999269574880599975585f); - const SimdFloat CA3 (-0.3333310186862945556640f); - const SimdFloat one (1.0f); + const SimdFloat halfpi(static_cast(M_PI/2.0F)); + const SimdFloat CA17(0.002823638962581753730774F); + const SimdFloat CA15(-0.01595690287649631500244F); + const SimdFloat CA13(0.04250498861074447631836F); + const SimdFloat CA11(-0.07489009201526641845703F); + const SimdFloat CA9 (0.1063479334115982055664F); + const SimdFloat CA7 (-0.1420273631811141967773F); + const SimdFloat CA5 (0.1999269574880599975585F); + const SimdFloat CA3 (-0.3333310186862945556640F); + const SimdFloat one (1.0F); SimdFloat x2, x3, x4, pA, pB; SimdFBool m, m2; @@ -1333,19 +1333,19 @@ atan2(SimdFloat y, SimdFloat x) static inline SimdFloat gmx_simdcall pmeForceCorrection(SimdFloat z2) { - const SimdFloat FN6(-1.7357322914161492954e-8f); - const SimdFloat FN5(1.4703624142580877519e-6f); - const SimdFloat FN4(-0.000053401640219807709149f); - const SimdFloat FN3(0.0010054721316683106153f); - const SimdFloat FN2(-0.019278317264888380590f); - const SimdFloat FN1(0.069670166153766424023f); - const SimdFloat FN0(-0.75225204789749321333f); - - const SimdFloat FD4(0.0011193462567257629232f); - const SimdFloat FD3(0.014866955030185295499f); - const SimdFloat FD2(0.11583842382862377919f); - const SimdFloat FD1(0.50736591960530292870f); - const SimdFloat FD0(1.0f); + const SimdFloat FN6(-1.7357322914161492954e-8F); + const SimdFloat FN5(1.4703624142580877519e-6F); + const SimdFloat FN4(-0.000053401640219807709149F); + const SimdFloat FN3(0.0010054721316683106153F); + const SimdFloat FN2(-0.019278317264888380590F); + const SimdFloat FN1(0.069670166153766424023F); + const SimdFloat FN0(-0.75225204789749321333F); + + const SimdFloat FD4(0.0011193462567257629232F); + const SimdFloat FD3(0.014866955030185295499F); + const SimdFloat FD2(0.11583842382862377919F); + const SimdFloat FD1(0.50736591960530292870F); + const SimdFloat FD0(1.0F); SimdFloat z4; SimdFloat polyFN0, polyFN1, polyFD0, polyFD1; @@ -1411,18 +1411,18 @@ pmeForceCorrection(SimdFloat z2) static inline SimdFloat gmx_simdcall pmePotentialCorrection(SimdFloat z2) { - const SimdFloat VN6(1.9296833005951166339e-8f); - const SimdFloat VN5(-1.4213390571557850962e-6f); - const SimdFloat VN4(0.000041603292906656984871f); - const SimdFloat VN3(-0.00013134036773265025626f); - const SimdFloat VN2(0.038657983986041781264f); - const SimdFloat VN1(0.11285044772717598220f); - const SimdFloat VN0(1.1283802385263030286f); - - const SimdFloat VD3(0.0066752224023576045451f); - const SimdFloat VD2(0.078647795836373922256f); - const SimdFloat VD1(0.43336185284710920150f); - const SimdFloat VD0(1.0f); + const SimdFloat VN6(1.9296833005951166339e-8F); + const SimdFloat VN5(-1.4213390571557850962e-6F); + const SimdFloat VN4(0.000041603292906656984871F); + const SimdFloat VN3(-0.00013134036773265025626F); + const SimdFloat VN2(0.038657983986041781264F); + const SimdFloat VN1(0.11285044772717598220F); + const SimdFloat VN0(1.1283802385263030286F); + + const SimdFloat VD3(0.0066752224023576045451F); + const SimdFloat VD2(0.078647795836373922256F); + const SimdFloat VD1(0.43336185284710920150F); + const SimdFloat VD0(1.0F); SimdFloat z4; SimdFloat polyVN0, polyVN1, polyVD0, polyVD1; @@ -4108,8 +4108,8 @@ static inline Simd4Float gmx_simdcall rsqrtIter(Simd4Float lu, Simd4Float x) { Simd4Float tmp1 = x*lu; - Simd4Float tmp2 = Simd4Float(-0.5f)*lu; - tmp1 = fma(tmp1, lu, Simd4Float(-3.0f)); + Simd4Float tmp2 = Simd4Float(-0.5F)*lu; + tmp1 = fma(tmp1, lu, Simd4Float(-3.0F)); return tmp1*tmp2; } @@ -4164,8 +4164,8 @@ static inline Simd4Double gmx_simdcall rsqrtIter(Simd4Double lu, Simd4Double x) { Simd4Double tmp1 = x*lu; - Simd4Double tmp2 = Simd4Double(-0.5f)*lu; - tmp1 = fma(tmp1, lu, Simd4Double(-3.0f)); + Simd4Double tmp2 = Simd4Double(-0.5F)*lu; + tmp1 = fma(tmp1, lu, Simd4Double(-3.0F)); return tmp1*tmp2; } diff --git a/src/gromacs/simd/tests/scalar_math.cpp b/src/gromacs/simd/tests/scalar_math.cpp index 8ce6a3d519..557ff3085a 100644 --- a/src/gromacs/simd/tests/scalar_math.cpp +++ b/src/gromacs/simd/tests/scalar_math.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2014,2015,2016,2017,2018, by the GROMACS development team, led by + * Copyright (c) 2014,2015,2016,2017,2018,2019, 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. @@ -255,7 +255,7 @@ TEST(SimdScalarMathTest, invSingleAccuracy) { double x0 = c1; - EXPECT_EQ(1.0f/static_cast(x0), + EXPECT_EQ(1.0F/static_cast(x0), static_cast(invSingleAccuracy(x0))); } @@ -265,7 +265,7 @@ TEST(SimdScalarMathTest, maskzInvsqrtSingleAccuracy) EXPECT_EQ(invsqrt(static_cast(x0)), static_cast(maskzInvsqrtSingleAccuracy(x0, true))); - EXPECT_EQ(0.0f, + EXPECT_EQ(0.0F, static_cast(maskzInvsqrtSingleAccuracy(x0, false))); } diff --git a/src/gromacs/tools/mk_angndx.cpp b/src/gromacs/tools/mk_angndx.cpp index 0f59fee73a..cfa29e7d51 100644 --- a/src/gromacs/tools/mk_angndx.cpp +++ b/src/gromacs/tools/mk_angndx.cpp @@ -178,7 +178,7 @@ static void fill_ang(int nft, const int *ft, int fac, } } } - if (hq != 0.0f) + if (hq != 0.0F) { for (j = 0; j < fac; j++) { diff --git a/src/gromacs/tools/tune_pme.cpp b/src/gromacs/tools/tune_pme.cpp index 4663f6f516..5771c25724 100644 --- a/src/gromacs/tools/tune_pme.cpp +++ b/src/gromacs/tools/tune_pme.cpp @@ -465,7 +465,7 @@ static gmx_bool analyze_data( { /* Somehow the performance number was not aquired for this run, * therefor set the average to some negative value: */ - pd->ns_per_day_Av = -1.0f*nrepeats; + pd->ns_per_day_Av = -1.0F*nrepeats; break; } } diff --git a/src/gromacs/trajectoryanalysis/analysissettings.cpp b/src/gromacs/trajectoryanalysis/analysissettings.cpp index c54d3801f7..5e3baaf465 100644 --- a/src/gromacs/trajectoryanalysis/analysissettings.cpp +++ b/src/gromacs/trajectoryanalysis/analysissettings.cpp @@ -101,7 +101,7 @@ TrajectoryAnalysisSettings::flags() const bool TrajectoryAnalysisSettings::hasFlag(unsigned long flag) const { - return (impl_->flags & flag) != 0u; + return (impl_->flags & flag) != 0U; } diff --git a/src/gromacs/utility/bitmask.h b/src/gromacs/utility/bitmask.h index cfae126c94..8d3d8659d6 100644 --- a/src/gromacs/utility/bitmask.h +++ b/src/gromacs/utility/bitmask.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2014,2018, by the GROMACS development team, led by + * Copyright (c) 2014,2018,2019, 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. @@ -103,7 +103,7 @@ inline static bool bitmask_is_set(gmx_bitmask_t m, int b) /*! \brief Test if both bitmasks have no common bits enabled */ inline static bool bitmask_is_disjoint(gmx_bitmask_t a, gmx_bitmask_t b) { - return (a & b) == 0u; + return (a & b) == 0U; } /*! \brief Test if both bitmasks are equal */ @@ -115,7 +115,7 @@ inline static bool bitmask_is_equal(gmx_bitmask_t a, gmx_bitmask_t b) /*! \brief Test if bitmask has no enabled bits */ inline static bool bitmask_is_zero(gmx_bitmask_t m) { - return m == 0u; + return m == 0U; } /*! \brief Set all bits enabled in either mask and write into a */ @@ -161,7 +161,7 @@ inline static bool bitmask_is_disjoint(gmx_bitmask_t a, gmx_bitmask_t b) bool r = true; for (i = 0; i < BITMASK_ALEN; i++) { - r = r && ((a[i] & b[i]) == 0u); + r = r && ((a[i] & b[i]) == 0U); } return r; } @@ -183,7 +183,7 @@ inline static bool bitmask_is_zero(gmx_bitmask_t m) bool r = true; for (i = 0; i < BITMASK_ALEN; i++) { - r = r && (m[i] == 0u); + r = r && (m[i] == 0U); } return r; } diff --git a/src/gromacs/utility/real.h b/src/gromacs/utility/real.h index d327fa6fa5..e5e0fa6efd 100644 --- a/src/gromacs/utility/real.h +++ b/src/gromacs/utility/real.h @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013,2014,2015,2017,2018, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2017,2018,2019, 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. @@ -78,7 +78,7 @@ # define GMX_DOUBLE_NEGZERO (-0.0) /*! \brief Negative zero in float */ -# define GMX_FLOAT_NEGZERO (-0.0f) +# define GMX_FLOAT_NEGZERO (-0.0F) #endif /*! \typedef real diff --git a/src/testutils/tests/refdata_tests.cpp b/src/testutils/tests/refdata_tests.cpp index c6efbe2029..689005ffd2 100644 --- a/src/testutils/tests/refdata_tests.cpp +++ b/src/testutils/tests/refdata_tests.cpp @@ -92,7 +92,7 @@ TEST(ReferenceDataTest, HandlesSimpleData) TEST(ReferenceDataTest, HandlesFloatingPointData) { - const float floatValue = 4.0f/3.0f; + const float floatValue = 4.0F/3.0F; const double doubleValue = 4.0/3.0; { @@ -158,7 +158,7 @@ TEST(ReferenceDataTest, HandlesStringBlockData) TEST(ReferenceDataTest, HandlesVectorData) { int veci[3] = { -1, 3, 5 }; - float vecf[3] = { -2.3f, 1.43f, 2.5f }; + float vecf[3] = { -2.3F, 1.43F, 2.5F }; double vecd[3] = { -2.3, 1.43, 2.5 }; { diff --git a/src/testutils/tests/testasserts_tests.cpp b/src/testutils/tests/testasserts_tests.cpp index 4089f65d2b..cb781cc469 100644 --- a/src/testutils/tests/testasserts_tests.cpp +++ b/src/testutils/tests/testasserts_tests.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2014,2017,2018, by the GROMACS development team, led by + * Copyright (c) 2014,2017,2018,2019, 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. @@ -79,7 +79,7 @@ TEST(FloatingPointDifferenceTest, HandlesEqualValues) // TODO: Use typed tests to run all the tests for single and double. TEST(FloatingPointDifferenceTest, HandlesFloatValues) { - FloatingPointDifference diff(1.2f, 1.2f); + FloatingPointDifference diff(1.2F, 1.2F); EXPECT_FALSE(diff.isDouble()); EXPECT_FALSE(diff.isNaN()); EXPECT_EQ(0.0, diff.asAbsolute()); @@ -156,14 +156,14 @@ TEST(FloatingPointToleranceTest, UlpTolerance) using gmx::test::ulpTolerance; FloatingPointDifference fequal(1.0, 1.0); - FloatingPointDifference fulp2(1.0f, addUlps(1.0f, 2)); + FloatingPointDifference fulp2(1.0F, addUlps(1.0F, 2)); EXPECT_TRUE(ulpTolerance(0).isWithin(fequal)); EXPECT_FALSE(ulpTolerance(1).isWithin(fulp2)); EXPECT_TRUE(ulpTolerance(2).isWithin(fulp2)); FloatingPointDifference dequal(1.0, 1.0); FloatingPointDifference dulp2(1.0, addUlps(1.0, 2)); - FloatingPointDifference dulp2f(1.0, static_cast(addUlps(1.0f, 2))); + FloatingPointDifference dulp2f(1.0, static_cast(addUlps(1.0F, 2))); EXPECT_TRUE(ulpTolerance(0).isWithin(dequal)); EXPECT_TRUE(ulpTolerance(2).isWithin(dulp2)); EXPECT_FALSE(ulpTolerance(2).isWithin(dulp2f)); @@ -173,11 +173,11 @@ TEST(FloatingPointToleranceTest, RelativeToleranceAsFloatingPoint) { using gmx::test::relativeToleranceAsFloatingPoint; - FloatingPointDifference fequal(1.0f, 1.0f); - FloatingPointDifference fulp2(1.0f, addUlps(1.0f, 2)); - FloatingPointDifference fdiff(1.0f, 1.011f); - FloatingPointDifference fsmall(0.1f, 0.111f); - FloatingPointDifference fsmall2(0.1f, 0.121f); + FloatingPointDifference fequal(1.0F, 1.0F); + FloatingPointDifference fulp2(1.0F, addUlps(1.0F, 2)); + FloatingPointDifference fdiff(1.0F, 1.011F); + FloatingPointDifference fsmall(0.1F, 0.111F); + FloatingPointDifference fsmall2(0.1F, 0.121F); EXPECT_TRUE(relativeToleranceAsFloatingPoint(1.0, 1e-2).isWithin(fequal)); EXPECT_TRUE(relativeToleranceAsFloatingPoint(1.0, 1e-9).isWithin(fequal)); EXPECT_TRUE(relativeToleranceAsFloatingPoint(1.0, 1e-2).isWithin(fulp2)); @@ -189,7 +189,7 @@ TEST(FloatingPointToleranceTest, RelativeToleranceAsFloatingPoint) EXPECT_FALSE(relativeToleranceAsFloatingPoint(1.0, 2e-2).isWithin(fsmall2)); FloatingPointDifference dequal(1.0, 1.0); - FloatingPointDifference dulp2f(1.0, static_cast(addUlps(1.0f, 2))); + FloatingPointDifference dulp2f(1.0, static_cast(addUlps(1.0F, 2))); FloatingPointDifference ddiff(1.0, 1.011); FloatingPointDifference dsmall(0.1, 0.111); FloatingPointDifference dsmall2(0.1, 0.121); @@ -208,10 +208,10 @@ TEST(FloatingPointToleranceTest, RelativeToleranceAsUlp) { using gmx::test::relativeToleranceAsUlp; - FloatingPointDifference fequal(1.0f, 1.0f); - FloatingPointDifference fulp4(1.0f, addUlps(1.0f, 4)); - FloatingPointDifference fsmall(0.1f, addUlps(1.0f, 2) - 0.9f); - FloatingPointDifference fsmall2(0.1f, addUlps(1.0f, 6) - 0.9f); + FloatingPointDifference fequal(1.0F, 1.0F); + FloatingPointDifference fulp4(1.0F, addUlps(1.0F, 4)); + FloatingPointDifference fsmall(0.1F, addUlps(1.0F, 2) - 0.9F); + FloatingPointDifference fsmall2(0.1F, addUlps(1.0F, 6) - 0.9F); EXPECT_TRUE(relativeToleranceAsUlp(1.0, 2).isWithin(fequal)); EXPECT_FALSE(relativeToleranceAsUlp(1.0, 2).isWithin(fulp4)); EXPECT_TRUE(relativeToleranceAsUlp(1.0, 4).isWithin(fulp4)); @@ -221,7 +221,7 @@ TEST(FloatingPointToleranceTest, RelativeToleranceAsUlp) FloatingPointDifference dequal(1.0, 1.0); FloatingPointDifference dulp4(1.0, addUlps(1.0, 4)); - FloatingPointDifference dulp4f(1.0, static_cast(addUlps(1.0f, 4))); + FloatingPointDifference dulp4f(1.0, static_cast(addUlps(1.0F, 4))); FloatingPointDifference dsmall(0.1, addUlps(1.0, 2) - 0.9); FloatingPointDifference dsmall2(0.1, addUlps(1.0, 6) - 0.9); EXPECT_TRUE(relativeToleranceAsUlp(1.0, 2).isWithin(dequal)); @@ -238,11 +238,11 @@ TEST(FloatingPointToleranceTest, DefaultFloatTolerance) using gmx::test::defaultFloatTolerance; // Differences within 4 single-precision ULPs are within the tolerance - FloatingPointDifference fequal(1.0f, 1.0f); - FloatingPointDifference fulp4(1.0f, addUlps(1.0f, 4)); - FloatingPointDifference fulp8(1.0f, addUlps(1.0f, 8)); - FloatingPointDifference fsmall(0.1f, addUlps(1.0f, 2) - 0.9f); - FloatingPointDifference fsmall2(0.1f, addUlps(1.0f, 6) - 0.9f); + FloatingPointDifference fequal(1.0F, 1.0F); + FloatingPointDifference fulp4(1.0F, addUlps(1.0F, 4)); + FloatingPointDifference fulp8(1.0F, addUlps(1.0F, 8)); + FloatingPointDifference fsmall(0.1F, addUlps(1.0F, 2) - 0.9F); + FloatingPointDifference fsmall2(0.1F, addUlps(1.0F, 6) - 0.9F); EXPECT_TRUE(defaultFloatTolerance().isWithin(fequal)); EXPECT_TRUE(defaultFloatTolerance().isWithin(fulp4)); EXPECT_FALSE(defaultFloatTolerance().isWithin(fulp8)); @@ -254,10 +254,10 @@ TEST(FloatingPointToleranceTest, DefaultFloatTolerance) FloatingPointDifference dequal(1.0, 1.0); FloatingPointDifference dulp4(1.0, addUlps(1.0, 4)); FloatingPointDifference dulp8(1.0, addUlps(1.0, 8)); - FloatingPointDifference dulp4f(1.0, static_cast(addUlps(1.0f, 4))); - FloatingPointDifference dulp8f(1.0, static_cast(addUlps(1.0f, 8))); - FloatingPointDifference dsmallf(0.1, static_cast(addUlps(1.0f, 2) - 0.9f)); - FloatingPointDifference dsmall2f(0.1, static_cast(addUlps(1.0f, 6) - 0.9f)); + FloatingPointDifference dulp4f(1.0, static_cast(addUlps(1.0F, 4))); + FloatingPointDifference dulp8f(1.0, static_cast(addUlps(1.0F, 8))); + FloatingPointDifference dsmallf(0.1, static_cast(addUlps(1.0F, 2) - 0.9F)); + FloatingPointDifference dsmall2f(0.1, static_cast(addUlps(1.0F, 6) - 0.9F)); EXPECT_TRUE(defaultFloatTolerance().isWithin(dequal)); EXPECT_TRUE(defaultFloatTolerance().isWithin(dulp4)); EXPECT_TRUE(defaultFloatTolerance().isWithin(dulp8)); -- 2.22.0