Use enum class for nbnxm locality
[alexxy/gromacs.git] / src / gromacs / nbnxm / gpu_common_utils.h
index 40bffbb7b3b94bd0de8b157d9f9a38f995fff34b..02febb47ab082b0570f4944971aecc9dbf87d1df 100644 (file)
@@ -54,6 +54,9 @@
 #include "opencl/nbnxm_ocl_types.h"
 #endif
 
+namespace Nbnxm
+{
+
 /*! \brief An early return condition for empty NB GPU workloads
  *
  * This is currently used for non-local kernels/transfers only.
  * local part of the force array also depends on the non-local kernel.
  * The skip of the local kernel is taken care of separately.
  */
-static inline bool canSkipWork(const gmx_nbnxn_gpu_t *nb, int iloc)
+static inline bool canSkipWork(const gmx_nbnxn_gpu_t &nb,
+                               InteractionLocality    iloc)
 {
-    assert(nb && nb->plist[iloc]);
-    return (iloc == eintNonlocal) && (nb->plist[iloc]->nsci == 0);
+    assert(nb.plist[iloc]);
+    return (iloc == InteractionLocality::NonLocal &&
+            nb.plist[iloc]->nsci == 0);
 }
 
+} // namespace Nbnxm
+
 #endif