Specialize ArrayRef for SimdReal
commit154e896f4b3b411bd28756c63f3f123f34b0aa5c
authorRoland Schulz <roland.schulz@intel.com>
Fri, 22 Sep 2017 20:43:50 +0000 (22 13:43 -0700)
committerMark Abraham <mark.j.abraham@gmail.com>
Fri, 13 Oct 2017 06:52:09 +0000 (13 08:52 +0200)
treee529125f51c2505c36598af6457ecea801f4f477
parent52e7c9d26b55cb0b01d1d033933b02aa5566ce53
Specialize ArrayRef for SimdReal

ArrayRef<SimdReal> maps to a range of aligned memory and returns a
Simd type from operator[] (more precisely a reference to a Simd type).
This allows to iterate over memory and not have to explicitly call
load/store while also avoiding undefined behavior (strict aliasing rule)
caused by casting between reals and SimdReals.

Change-Id: I3d00df088669dacc810052cbcaebe15e62e1d530
src/gromacs/ewald/pme-solve.cpp
src/gromacs/simd/simd.h
src/gromacs/simd/simd_memory.h [new file with mode: 0644]
src/gromacs/simd/tests/CMakeLists.txt
src/gromacs/simd/tests/simd.cpp
src/gromacs/simd/tests/simd.h
src/gromacs/simd/tests/simd_memory.cpp [new file with mode: 0644]
src/gromacs/utility/arrayref.h