Silence Clang's constant-logical-operand warning
authorAndrey Alekseenko <al42and@gmail.com>
Sat, 23 Oct 2021 11:20:34 +0000 (13:20 +0200)
committerJoe Jordan <ejjordan12@gmail.com>
Mon, 25 Oct 2021 08:11:03 +0000 (08:11 +0000)
src/gromacs/mdlib/update_constrain_gpu_impl.cpp
src/gromacs/mdtypes/state_propagator_data_gpu_impl_gpu.cpp

index 9b8d102d2533889d8a305248b7d939f08ec58954..f0cf01c65d71c04d7abcf2b65f452c276c6c4025 100644 (file)
@@ -68,7 +68,7 @@
 #include "gromacs/timing/wallcycle.h"
 #include "gromacs/topology/mtop_util.h"
 
-static constexpr bool sc_haveGpuConstraintSupport = GMX_GPU_CUDA || GMX_GPU_SYCL;
+static constexpr bool sc_haveGpuConstraintSupport = bool(GMX_GPU_CUDA) || bool(GMX_GPU_SYCL);
 
 namespace gmx
 {
index c08c8f59000e13330acb727f470b63fe6c0cd5bb..9bac56b2160451c9b7ccd95599d5c18c6771875d 100644 (file)
@@ -173,7 +173,7 @@ 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 ((GMX_GPU_CUDA || GMX_GPU_SYCL) && d_fCapacity_ != d_fOldCapacity)
+    if ((bool(GMX_GPU_CUDA) || bool(GMX_GPU_SYCL)) && d_fCapacity_ != d_fOldCapacity)
     {
         clearDeviceBufferAsync(&d_f_, 0, d_fCapacity_, *localStream_);
     }
@@ -334,7 +334,7 @@ void StatePropagatorDataGpu::Impl::copyCoordinatesToGpu(const gmx::ArrayRef<cons
     //   - it's not needed, copy is done in the same stream as the only consumer task (PME)
     //   - we don't consume the events in OpenCL which is not allowed by GpuEventSynchronizer (would leak memory).
     // TODO: remove this by adding an event-mark free flavor of this function
-    if (GMX_GPU_CUDA || GMX_GPU_SYCL)
+    if (bool(GMX_GPU_CUDA) || bool(GMX_GPU_SYCL))
     {
         xReadyOnDevice_[atomLocality].markEvent(*deviceStream);
     }