From eb74bfa4c8a28798caf8cb5bb5fa922d87829d62 Mon Sep 17 00:00:00 2001 From: Andrey Alekseenko Date: Mon, 11 Oct 2021 16:41:28 +0200 Subject: [PATCH] Fix clang-tidy complaints - False-positives after "if constexpr". - "empty()" instead of "size() > 0". - "auto *" instead of "auto". --- src/gromacs/domdec/gpuhaloexchange_impl.cu | 4 ++-- src/gromacs/listed_forces/pairs.cpp | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/gromacs/domdec/gpuhaloexchange_impl.cu b/src/gromacs/domdec/gpuhaloexchange_impl.cu index b0dab24e8a..4a62a89532 100644 --- a/src/gromacs/domdec/gpuhaloexchange_impl.cu +++ b/src/gromacs/domdec/gpuhaloexchange_impl.cu @@ -352,9 +352,9 @@ void GpuHaloExchange::Impl::communicateHaloForces(bool accumulateForces, // ToDo: We need further refinement here as communicateHaloData includes launch time for cudamemcpyasync wallcycle_start(wcycle_, WallCycleCounter::MoveF); - while (dependencyEvents->size() > 0) + while (!dependencyEvents->empty()) { - auto dependency = dependencyEvents->back(); + auto* dependency = dependencyEvents->back(); dependency->enqueueWaitEvent(*haloStream_); dependencyEvents->pop_back(); } diff --git a/src/gromacs/listed_forces/pairs.cpp b/src/gromacs/listed_forces/pairs.cpp index 4d2d7ae882..064c837756 100644 --- a/src/gromacs/listed_forces/pairs.cpp +++ b/src/gromacs/listed_forces/pairs.cpp @@ -242,6 +242,7 @@ static real free_energy_evaluate_single(real } sigma_pow[i] = sigma6[i]; } + // NOLINTNEXTLINE(readability-misleading-indentation) remove when clang-tidy-13 is required if constexpr (softcoreType == KernelSoftcoreType::Gapsys) { if ((c6[i] > 0) && (c12[i] > 0)) @@ -258,6 +259,7 @@ static real free_energy_evaluate_single(real } } + // NOLINTNEXTLINE(readability-misleading-indentation) remove when clang-tidy-13 is required if constexpr (softcoreType == KernelSoftcoreType::Beutler) { /* only use softcore if one of the states has a zero endstate - softcore is for avoiding infinities!*/ @@ -272,6 +274,7 @@ static real free_energy_evaluate_single(real alpha_coul_eff = scParams.alphaCoulomb; } } + // NOLINTNEXTLINE(readability-misleading-indentation) remove when clang-tidy-13 is required if constexpr (softcoreType == KernelSoftcoreType::Gapsys) { /* only use softcore if one of the states has a zero endstate - softcore is for avoiding infinities!*/ @@ -288,6 +291,7 @@ static real free_energy_evaluate_single(real } /* Loop over A and B states again */ + // NOLINTNEXTLINE(readability-misleading-indentation) remove when clang-tidy-13 is required for (i = 0; i < 2; i++) { fscal_elec[i] = 0; @@ -314,6 +318,7 @@ static real free_energy_evaluate_single(real r_coul = r; } + // NOLINTNEXTLINE(readability-misleading-indentation) remove when clang-tidy-13 is required if constexpr (softcoreType == KernelSoftcoreType::Gapsys) { if ((facel != 0) && (LFC[i] < 1)) @@ -333,6 +338,7 @@ static real free_energy_evaluate_single(real } } + // NOLINTNEXTLINE(readability-misleading-indentation) remove when clang-tidy-13 is required if ((softcoreType == KernelSoftcoreType::Gapsys) && (r < rQ)) { real rInvQ = one / rQ; @@ -397,6 +403,7 @@ static real free_energy_evaluate_single(real } } + // NOLINTNEXTLINE(readability-misleading-indentation) remove when clang-tidy-13 is required if ((softcoreType == KernelSoftcoreType::Gapsys) && (r < rLJ)) { // scaled values for c6 and c12 @@ -487,6 +494,7 @@ static real free_energy_evaluate_single(real dvdl_coul_sum += dvdl_elec[i]; dvdl_vdw_sum += dvdl_vdw[i]; } + // NOLINTNEXTLINE(readability-misleading-indentation) remove when clang-tidy-13 is required dvdl_coul_sum += velec[i] * DLF[i]; dvdl_vdw_sum += vvdw[i] * DLF[i]; if constexpr (softcoreType == KernelSoftcoreType::Beutler) -- 2.22.0