Fixed Verlet buffer issue with 2-wide SIMD
[alexxy/gromacs.git] / src / gromacs / gmxpreprocess / calc_verletbuf.c
index 0387dd1483353b22b6f26afddde41037e57d32f8..28f2d91664fe2ef2e20e8b506cd863546524630a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -49,6 +49,7 @@
 #include "coulomb.h"
 #include "calc_verletbuf.h"
 #include "../mdlib/nbnxn_consts.h"
+#include "../mdlib/nbnxn_simd.h"
 
 #ifdef GMX_NBNXN_SIMD
 /* The include below sets the SIMD instruction type (precision+width)
@@ -117,25 +118,28 @@ typedef struct
     int                           n;    /* #atoms of this type in the system */
 } verletbuf_atomtype_t;
 
-void verletbuf_get_list_setup(gmx_bool                bGPU,
+void verletbuf_get_list_setup(gmx_bool gmx_unused     bSIMD,
+                              gmx_bool                bGPU,
                               verletbuf_list_setup_t *list_setup)
 {
-    list_setup->cluster_size_i     = NBNXN_CPU_CLUSTER_I_SIZE;
-
     if (bGPU)
     {
-        list_setup->cluster_size_j = NBNXN_GPU_CLUSTER_SIZE;
+        list_setup->cluster_size_i     = NBNXN_GPU_CLUSTER_SIZE;
+        list_setup->cluster_size_j     = NBNXN_GPU_CLUSTER_SIZE;
     }
     else
     {
-#ifndef GMX_NBNXN_SIMD
-        list_setup->cluster_size_j = NBNXN_CPU_CLUSTER_I_SIZE;
-#else
-        list_setup->cluster_size_j = GMX_SIMD_REAL_WIDTH;
+        list_setup->cluster_size_i     = NBNXN_CPU_CLUSTER_I_SIZE;
+        list_setup->cluster_size_j     = NBNXN_CPU_CLUSTER_I_SIZE;
+#ifdef GMX_NBNXN_SIMD
+        if (bSIMD)
+        {
+            list_setup->cluster_size_j = GMX_SIMD_REAL_WIDTH;
 #ifdef GMX_NBNXN_SIMD_2XNN
-        /* We assume the smallest cluster size to be on the safe side */
-        list_setup->cluster_size_j /= 2;
+            /* We assume the smallest cluster size to be on the safe side */
+            list_setup->cluster_size_j /= 2;
 #endif
+        }
 #endif
     }
 }