Add bitmask type
[alexxy/gromacs.git] / src / gromacs / mdlib / nbnxn_kernels / nbnxn_kernel_common.c
index 2fded68209937ef2b29ca72c1e4548d9461dc353..9663861948f3f4fb1829fe884f338d6c8ab8f69a 100644 (file)
@@ -53,16 +53,16 @@ static void
 clear_f_flagged(const nbnxn_atomdata_t *nbat, int output_index, real *f)
 {
     const nbnxn_buffer_flags_t *flags;
-    unsigned                    our_flag;
+    gmx_bitmask_t               our_flag;
     int g, b, a0, a1, i;
 
     flags = &nbat->buffer_flags;
 
-    our_flag = (1U << output_index);
+    bitmask_init_bit(&our_flag, output_index);
 
     for (b = 0; b < flags->nflag; b++)
     {
-        if (flags->flag[b] & our_flag)
+        if (!bitmask_is_disjoint(flags->flag[b], our_flag))
         {
             a0 = b*NBNXN_BUFFERFLAG_SIZE;
             a1 = a0 + NBNXN_BUFFERFLAG_SIZE;