fixed nbnxn 4x8 pair search without AVX
authorBerk Hess <hess@kth.se>
Thu, 10 Oct 2013 10:53:05 +0000 (12:53 +0200)
committerBerk Hess <hess@kth.se>
Thu, 10 Oct 2013 10:53:05 +0000 (12:53 +0200)
This bug was introduced recently.
Note that nbnxn 4x8 without AVX was only possible when manually
changing the code to use plain-C reference SIMD.

Change-Id: I5effe4076bc5ff270ebeb366f9c2b8a13c256025

src/mdlib/nbnxn_search.c

index 1d4e929080a132fd0976d8a0cdcf5821538321cb..738ffac64446632e3dc659b1764eb266cf4ff24f 100644 (file)
@@ -935,16 +935,16 @@ static void combine_bounding_box_pairs(nbnxn_grid_t *grid, const nbnxn_bb_t *bb)
 #else
             for (j = 0; j < NNBSBB_C; j++)
             {
-                grid->bbj[c2].lower[j] = min(bb[c2*2].lower[j],
-                                             bb[c2*2].lower[j]);
-                grid->bbj[c2].upper[j] = max(bb[c2*2].upper[j],
-                                             bb[c2*2].upper[j]);
+                grid->bbj[c2].lower[j] = min(bb[c2*2+0].lower[j],
+                                             bb[c2*2+1].lower[j]);
+                grid->bbj[c2].upper[j] = max(bb[c2*2+0].upper[j],
+                                             bb[c2*2+1].upper[j]);
             }
 #endif
         }
         if (((grid->cxy_na[i]+3)>>2) & 1)
         {
-            /* Copy the last bb for odd bb count in this column */
+            /* The bb count in this column is odd: duplicate the last bb */
             for (j = 0; j < NNBSBB_C; j++)
             {
                 grid->bbj[c2].lower[j] = bb[c2*2].lower[j];