diff options
author | Gael Guennebaud <g.gael@free.fr> | 2015-06-09 17:42:09 +0200 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2015-06-09 17:42:09 +0200 |
commit | 785b9c0127a508cb7d573cdad895707b6d5bc77e (patch) | |
tree | 0ce2ce93aff7edc6e8ca47dd029400363a4d6c35 /Eigen/src/Core/MapBase.h | |
parent | 0eb06f1391ffa151e6a09979df31b406c28b3772 (diff) |
bug #1003: assert in MapBase if the provided pointer is not aligned on scalar while it is expected to be. Also add a EIGEN_ALIGN8 macro.
Diffstat (limited to 'Eigen/src/Core/MapBase.h')
-rw-r--r-- | Eigen/src/Core/MapBase.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Eigen/src/Core/MapBase.h b/Eigen/src/Core/MapBase.h index fe61d2a28..0d85085c8 100644 --- a/Eigen/src/Core/MapBase.h +++ b/Eigen/src/Core/MapBase.h @@ -160,6 +160,8 @@ template<typename Derived> class MapBase<Derived, ReadOnlyAccessors> EIGEN_DEVICE_FUNC void checkSanity() const { + eigen_assert(EIGEN_IMPLIES(internal::packet_traits<Scalar>::AlignedOnScalar, (size_t(m_data) % sizeof(Scalar)) == 0) + && "input pointer is not aligned on scalar boundary, e.g., use \"EIGEN_ALIGN8 T ptr[N];\" for double or complex<float>"); eigen_assert(EIGEN_IMPLIES(internal::traits<Derived>::IsAligned, (size_t(m_data) % EIGEN_ALIGN_BYTES) == 0) && "data is not aligned"); } |