Fix unaligned access with AVX512
authorPaul Bauer <paul.bauer.q@gmail.com>
Fri, 29 Nov 2019 13:21:44 +0000 (14:21 +0100)
committerPaul Bauer <paul.bauer.q@gmail.com>
Fri, 29 Nov 2019 16:21:18 +0000 (17:21 +0100)
Found and debugged by Gilles Gouaillardet

Change-Id: I9203593c94eb745020274b126601d30e49d7aac2

src/gromacs/nbnxm/pairlist_simd_2xmm.h

index fb6302028ba3543df36fcb6b11942b794defc5b1..20037e050fe60a2d1c1b567a3cc9aa9063276504 100644 (file)
@@ -34,7 +34,9 @@
  */
 
 /* Stride of the packed x coordinate array */
-static constexpr int c_xStride2xNN = c_nbnxnCpuIClusterSize;
+static constexpr int c_xStride2xNN = (GMX_SIMD_REAL_WIDTH >= 2 * c_nbnxnCpuIClusterSize)
+                                             ? GMX_SIMD_REAL_WIDTH / 2
+                                             : c_nbnxnCpuIClusterSize;
 
 /* Copies PBC shifted i-cell packed atom coordinates to working array */
 static inline void icell_set_x_simd_2xnn(int  ci,