Fix SIMD C reference nbnxn kernels
authorRoland Schulz <roland@utk.edu>
Wed, 9 Oct 2013 18:16:52 +0000 (14:16 -0400)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Thu, 17 Oct 2013 13:50:30 +0000 (15:50 +0200)
Got broken by ace006a86 and 022581b388.
An additional fix for nbnxn 4x8 reference code, broken by c0cf8ce,
is in a separate patch.
Also changed the AVX256 double precision nbfp_stride from 4 to 2.

Refs #1173

Change-Id: If3b3291a7ff765acc19c29f834e856cc9798d47e

include/gmx_simd_macros.h
src/mdlib/nbnxn_kernels/nbnxn_kernel_simd_utils.h
src/mdlib/nbnxn_kernels/nbnxn_kernel_simd_utils_ref.h

index d487565b9af83ac2b16ee9f2c103226d6368ea25..3491bd5dd647c433aa16b623f9a4be4e72c05159 100644 (file)
@@ -56,8 +56,7 @@
 #define GMX_HAVE_SIMD_MACROS
 
 /* In general the reference SIMD supports any SIMD width, including 1.
- * For the nbnxn 4xn kernels all widths (2, 4 and 8) are supported.
- * The nbnxn 2xnn kernels are currently not supported.
+ * See types/nb_verlet.h for details
  */
 #define GMX_SIMD_REF_WIDTH  4
 
index 1c5794b0cd387b52119c4f2ddaa9056b60e1d16f..0962146625a77a72a9056f1a1f78422dd8fa4dd1 100644 (file)
 
 #ifdef GMX_SIMD_REFERENCE_PLAIN_C
 
+/* Set the stride for the lookup of the two LJ parameters from their
+ * (padded) array.
+ * Note that currently only arrays with stride 2 and 4 are available.
+ * Since the reference code does not require alignment, we can always use 2.
+ */
+static const int nbfp_stride = 2;
+
+/* Align a stack-based thread-local working array. */
+static gmx_inline int *
+prepare_table_load_buffer(const int *array)
+{
+    return NULL;
+}
+
 #include "nbnxn_kernel_simd_utils_ref.h"
 
 #else /* GMX_SIMD_REFERENCE_PLAIN_C */
 /* Include x86 SSE2 compatible SIMD functions */
 
 /* Set the stride for the lookup of the two LJ parameters from their
-   (padded) array. Only strides of 2 and 4 are currently supported. */
-#if defined GMX_NBNXN_SIMD_2XNN
-static const int nbfp_stride = 4;
-#elif defined GMX_DOUBLE
+ * (padded) array. We use the minimum supported SIMD memory alignment.
+ */
+#if defined GMX_DOUBLE
 static const int nbfp_stride = 2;
 #else
 static const int nbfp_stride = 4;
index a394ed6a51b0fdbfbe7e2ef17d0d5a3d9148a6ba..ac7ddec9b9fa3fc4905f3ed225743f8ac9a977b9 100644 (file)
@@ -444,7 +444,7 @@ gmx_simd_ref_load1_exclfilter(int src)
 }
 
 static gmx_inline gmx_simd_ref_exclfilter
-gmx_simd_ref_load_exclusion_filter(const unsigned *src)
+gmx_simd_ref_load_exclusion_filter(const int *src)
 {
     gmx_simd_ref_exclfilter a;
     int                     i;