diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/mapped_matrix.cpp | 20 | ||||
-rw-r--r-- | test/unalignedassert.cpp | 12 | ||||
-rw-r--r-- | test/vectorization_logic.cpp | 5 |
3 files changed, 18 insertions, 19 deletions
diff --git a/test/mapped_matrix.cpp b/test/mapped_matrix.cpp index f080ca7ed..7c7099792 100644 --- a/test/mapped_matrix.cpp +++ b/test/mapped_matrix.cpp @@ -25,15 +25,15 @@ template<typename VectorType> void map_class_vector(const VectorType& m) Scalar* array1 = internal::aligned_new<Scalar>(size); Scalar* array2 = internal::aligned_new<Scalar>(size); Scalar* array3 = new Scalar[size+1]; - Scalar* array3unaligned = size_t(array3)%EIGEN_MAX_ALIGN_BYTES == 0 ? array3+1 : array3; + Scalar* array3unaligned = (std::size_t(array3)%EIGEN_MAX_ALIGN_BYTES) == 0 ? array3+1 : array3; Scalar array4[EIGEN_TESTMAP_MAX_SIZE]; - Map<VectorType, Aligned>(array1, size) = VectorType::Random(size); - Map<VectorType, Aligned>(array2, size) = Map<VectorType,Aligned>(array1, size); + Map<VectorType, AlignedMax>(array1, size) = VectorType::Random(size); + Map<VectorType, AlignedMax>(array2, size) = Map<VectorType,AlignedMax>(array1, size); Map<VectorType>(array3unaligned, size) = Map<VectorType>(array1, size); - Map<VectorType>(array4, size) = Map<VectorType,Aligned>(array1, size); - VectorType ma1 = Map<VectorType, Aligned>(array1, size); - VectorType ma2 = Map<VectorType, Aligned>(array2, size); + Map<VectorType>(array4, size) = Map<VectorType,AlignedMax>(array1, size); + VectorType ma1 = Map<VectorType, AlignedMax>(array1, size); + VectorType ma2 = Map<VectorType, AlignedMax>(array2, size); VectorType ma3 = Map<VectorType>(array3unaligned, size); VectorType ma4 = Map<VectorType>(array4, size); VERIFY_IS_EQUAL(ma1, ma2); @@ -41,7 +41,7 @@ template<typename VectorType> void map_class_vector(const VectorType& m) VERIFY_IS_EQUAL(ma1, ma4); #ifdef EIGEN_VECTORIZE if(internal::packet_traits<Scalar>::Vectorizable) - VERIFY_RAISES_ASSERT((Map<VectorType,Aligned>(array3unaligned, size))) + VERIFY_RAISES_ASSERT((Map<VectorType,AlignedMax>(array3unaligned, size))) #endif internal::aligned_delete(array1, size); @@ -71,7 +71,7 @@ template<typename MatrixType> void map_class_matrix(const MatrixType& m) for(int i = 0; i < size; i++) array4[i] = Scalar(1); Map<MatrixType> map1(array1, rows, cols); - Map<MatrixType, Aligned> map2(array2, rows, cols); + Map<MatrixType, AlignedMax> map2(array2, rows, cols); Map<MatrixType> map3(array3unaligned, rows, cols); Map<MatrixType> map4(array4, rows, cols); @@ -154,9 +154,9 @@ template<typename PlainObjectType> void check_const_correctness(const PlainObjec // verify that map-to-const don't have LvalueBit typedef typename internal::add_const<PlainObjectType>::type ConstPlainObjectType; VERIFY( !(internal::traits<Map<ConstPlainObjectType> >::Flags & LvalueBit) ); - VERIFY( !(internal::traits<Map<ConstPlainObjectType, Aligned> >::Flags & LvalueBit) ); + VERIFY( !(internal::traits<Map<ConstPlainObjectType, AlignedMax> >::Flags & LvalueBit) ); VERIFY( !(Map<ConstPlainObjectType>::Flags & LvalueBit) ); - VERIFY( !(Map<ConstPlainObjectType, Aligned>::Flags & LvalueBit) ); + VERIFY( !(Map<ConstPlainObjectType, AlignedMax>::Flags & LvalueBit) ); } template<typename Scalar> diff --git a/test/unalignedassert.cpp b/test/unalignedassert.cpp index f53f167b4..014cc834b 100644 --- a/test/unalignedassert.cpp +++ b/test/unalignedassert.cpp @@ -162,12 +162,12 @@ void unalignedassert() } for(int b=8; b<EIGEN_MAX_ALIGN_BYTES; b+=8) { - VERIFY_RAISES_ASSERT(construct_at_boundary<Vector8f>(b)); - VERIFY_RAISES_ASSERT(construct_at_boundary<Matrix4f>(b)); - VERIFY_RAISES_ASSERT(construct_at_boundary<Vector4d>(b)); - VERIFY_RAISES_ASSERT(construct_at_boundary<Matrix2d>(b)); - VERIFY_RAISES_ASSERT(construct_at_boundary<Matrix4d>(b)); - VERIFY_RAISES_ASSERT(construct_at_boundary<Vector2cd>(b)); + if(b<32) VERIFY_RAISES_ASSERT(construct_at_boundary<Vector8f>(b)); + if(b<64) VERIFY_RAISES_ASSERT(construct_at_boundary<Matrix4f>(b)); + if(b<32) VERIFY_RAISES_ASSERT(construct_at_boundary<Vector4d>(b)); + if(b<32) VERIFY_RAISES_ASSERT(construct_at_boundary<Matrix2d>(b)); + if(b<128) VERIFY_RAISES_ASSERT(construct_at_boundary<Matrix4d>(b)); + if(b<32) VERIFY_RAISES_ASSERT(construct_at_boundary<Vector2cd>(b)); } #endif } diff --git a/test/vectorization_logic.cpp b/test/vectorization_logic.cpp index 97477072a..18dad6b5d 100644 --- a/test/vectorization_logic.cpp +++ b/test/vectorization_logic.cpp @@ -35,7 +35,6 @@ std::string demangle_flags(int f) if(f&LinearAccessBit) res += " | Linear"; if(f&LvalueBit) res += " | Lvalue"; if(f&DirectAccessBit) res += " | Direct"; - if(f&AlignedBit) res += " | Aligned"; if(f&NestByRefBit) res += " | NestByRef"; if(f&NoPreferredStorageOrderBit) res += " | NoPreferredStorageOrderBit"; @@ -204,12 +203,12 @@ template<typename Scalar, bool Enable = internal::packet_traits<Scalar>::Vectori LinearVectorizedTraversal,CompleteUnrolling)); VERIFY((test_assign< - Map<Matrix22, Aligned, OuterStride<3*PacketSize> >, + Map<Matrix22, AlignedMax, OuterStride<3*PacketSize> >, Matrix22 >(InnerVectorizedTraversal,CompleteUnrolling))); VERIFY((test_assign< - Map<Matrix<Scalar,EIGEN_PLAIN_ENUM_MAX(2,PacketSize),EIGEN_PLAIN_ENUM_MAX(2,PacketSize)>, Aligned, InnerStride<3*PacketSize> >, + Map<Matrix<Scalar,EIGEN_PLAIN_ENUM_MAX(2,PacketSize),EIGEN_PLAIN_ENUM_MAX(2,PacketSize)>, AlignedMax, InnerStride<3*PacketSize> >, Matrix<Scalar,EIGEN_PLAIN_ENUM_MAX(2,PacketSize),EIGEN_PLAIN_ENUM_MAX(2,PacketSize)> >(DefaultTraversal,CompleteUnrolling))); |