diff --git a/Eigen/src/Core/Assign.h b/Eigen/src/Core/Assign.h index 758858165..cdfd0b302 100644 --- a/Eigen/src/Core/Assign.h +++ b/Eigen/src/Core/Assign.h @@ -157,12 +157,13 @@ struct ei_assign_innervec_CompleteUnrolling : Index % Derived1::RowsAtCompileTime, col = int(Derived1::Flags)&RowMajorBit ? Index % int(Derived1::ColsAtCompileTime) - : Index / Derived1::RowsAtCompileTime + : Index / Derived1::RowsAtCompileTime, + SrcAlignment = ei_assign_traits::SrcAlignment }; inline static void run(Derived1 &dst, const Derived2 &src) { - dst.template copyPacket(row, col, src); + dst.template copyPacket(row, col, src); ei_assign_innervec_CompleteUnrolling::size, Stop>::run(dst, src); } diff --git a/test/map.cpp b/test/map.cpp index e7c1cf03d..705a74c3a 100644 --- a/test/map.cpp +++ b/test/map.cpp @@ -33,13 +33,21 @@ template void tmap(const VectorType& m) // test Map.h Scalar* array1 = ei_aligned_malloc(size); Scalar* array2 = ei_aligned_malloc(size); + Scalar* array3 = new Scalar[size+1]; + Scalar* array3unaligned = size_t(array3)%16 == 0 ? array3+1 : array3; + Map(array1, size) = VectorType::Random(size); Map(array2, size) = Map(array1, size); + Map(array3unaligned, size) = Map(array1, size); VectorType ma1 = Map(array1, size); VectorType ma2 = Map(array2, size); + VectorType ma3 = Map(array3unaligned, size); VERIFY_IS_APPROX(ma1, ma2); + VERIFY_IS_APPROX(ma1, ma3); + ei_aligned_free(array1); ei_aligned_free(array2); + delete[] array3; } void test_map()