Silence clang-tidy warnings
authorAndrey Alekseenko <al42and@gmail.com>
Fri, 29 Oct 2021 14:10:14 +0000 (16:10 +0200)
committerArtem Zhmurov <zhmurov@gmail.com>
Sat, 30 Oct 2021 06:36:26 +0000 (06:36 +0000)
src/gromacs/mdlib/update_constrain_gpu_impl.cpp
src/gromacs/mdtypes/state_propagator_data_gpu_impl_gpu.cpp

index f0cf01c65d71c04d7abcf2b65f452c276c6c4025..601a740e0521bc37276575ed692d1fce9b6fe262 100644 (file)
@@ -68,7 +68,7 @@
 #include "gromacs/timing/wallcycle.h"
 #include "gromacs/topology/mtop_util.h"
 
-static constexpr bool sc_haveGpuConstraintSupport = bool(GMX_GPU_CUDA) || bool(GMX_GPU_SYCL);
+static constexpr bool sc_haveGpuConstraintSupport = (GMX_GPU_CUDA != 0) || (GMX_GPU_SYCL != 0);
 
 namespace gmx
 {
index 4e3126efbabc8b989f95a4eeb5f77461988e1752..84f26a198c85dadc1f9dfb1f72112eb132652516 100644 (file)
@@ -172,7 +172,8 @@ void StatePropagatorDataGpu::Impl::reinit(int numAtomsLocal, int numAtomsAll)
     // Clearing of the forces can be done in local stream since the nonlocal stream cannot reach
     // the force accumulation stage before syncing with the local stream. Only done in CUDA and
     // SYCL, since the force buffer ops are not implemented in OpenCL.
-    if ((bool(GMX_GPU_CUDA) || bool(GMX_GPU_SYCL)) && d_fCapacity_ != d_fOldCapacity)
+    static constexpr bool sc_haveGpuFBufferOps = ((GMX_GPU_CUDA != 0) || (GMX_GPU_SYCL != 0));
+    if (sc_haveGpuFBufferOps && d_fCapacity_ != d_fOldCapacity)
     {
         clearDeviceBufferAsync(&d_f_, 0, d_fCapacity_, *localStream_);
     }