mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-01-18 14:34:17 +08:00
Fix geo_* unit tests with respect to AVX
This commit is contained in:
parent
052aedd394
commit
6f123d209e
@ -129,9 +129,9 @@ template<typename Scalar> void hyperplane_alignment()
|
||||
typedef Hyperplane<Scalar,3,AutoAlign> Plane3a;
|
||||
typedef Hyperplane<Scalar,3,DontAlign> Plane3u;
|
||||
|
||||
EIGEN_ALIGN16 Scalar array1[4];
|
||||
EIGEN_ALIGN16 Scalar array2[4];
|
||||
EIGEN_ALIGN16 Scalar array3[4+1];
|
||||
EIGEN_ALIGN_DEFAULT Scalar array1[4];
|
||||
EIGEN_ALIGN_DEFAULT Scalar array2[4];
|
||||
EIGEN_ALIGN_DEFAULT Scalar array3[4+1];
|
||||
Scalar* array3u = array3+1;
|
||||
|
||||
Plane3a *p1 = ::new(reinterpret_cast<void*>(array1)) Plane3a;
|
||||
@ -146,7 +146,7 @@ template<typename Scalar> void hyperplane_alignment()
|
||||
VERIFY_IS_APPROX(p1->coeffs(), p3->coeffs());
|
||||
|
||||
#if defined(EIGEN_VECTORIZE) && EIGEN_ALIGN_STATICALLY
|
||||
if(internal::packet_traits<Scalar>::Vectorizable)
|
||||
if(internal::packet_traits<Scalar>::Vectorizable && internal::packet_traits<Scalar>::size<=4)
|
||||
VERIFY_RAISES_ASSERT((::new(reinterpret_cast<void*>(array3u)) Plane3a));
|
||||
#endif
|
||||
}
|
||||
|
@ -86,7 +86,7 @@ template<typename Scalar> void parametrizedline_alignment()
|
||||
VERIFY_IS_APPROX(p1->direction(), p3->direction());
|
||||
|
||||
#if defined(EIGEN_VECTORIZE) && EIGEN_ALIGN_STATICALLY
|
||||
if(internal::packet_traits<Scalar>::Vectorizable)
|
||||
if(internal::packet_traits<Scalar>::Vectorizable && internal::packet_traits<Scalar>::size<=4)
|
||||
VERIFY_RAISES_ASSERT((::new(reinterpret_cast<void*>(array3u)) Line4a));
|
||||
#endif
|
||||
}
|
||||
|
@ -181,9 +181,9 @@ template<typename Scalar> void mapQuaternion(void){
|
||||
v1 = Vector3::Random();
|
||||
Scalar a = internal::random<Scalar>(-Scalar(M_PI), Scalar(M_PI));
|
||||
|
||||
EIGEN_ALIGN16 Scalar array1[4];
|
||||
EIGEN_ALIGN16 Scalar array2[4];
|
||||
EIGEN_ALIGN16 Scalar array3[4+1];
|
||||
EIGEN_ALIGN_DEFAULT Scalar array1[4];
|
||||
EIGEN_ALIGN_DEFAULT Scalar array2[4];
|
||||
EIGEN_ALIGN_DEFAULT Scalar array3[4+1];
|
||||
Scalar* array3unaligned = array3+1;
|
||||
|
||||
MQuaternionA mq1(array1);
|
||||
@ -232,9 +232,9 @@ template<typename Scalar> void quaternionAlignment(void){
|
||||
typedef Quaternion<Scalar,AutoAlign> QuaternionA;
|
||||
typedef Quaternion<Scalar,DontAlign> QuaternionUA;
|
||||
|
||||
EIGEN_ALIGN16 Scalar array1[4];
|
||||
EIGEN_ALIGN16 Scalar array2[4];
|
||||
EIGEN_ALIGN16 Scalar array3[4+1];
|
||||
EIGEN_ALIGN_DEFAULT Scalar array1[4];
|
||||
EIGEN_ALIGN_DEFAULT Scalar array2[4];
|
||||
EIGEN_ALIGN_DEFAULT Scalar array3[4+1];
|
||||
Scalar* arrayunaligned = array3+1;
|
||||
|
||||
QuaternionA *q1 = ::new(reinterpret_cast<void*>(array1)) QuaternionA;
|
||||
@ -248,7 +248,7 @@ template<typename Scalar> void quaternionAlignment(void){
|
||||
VERIFY_IS_APPROX(q1->coeffs(), q2->coeffs());
|
||||
VERIFY_IS_APPROX(q1->coeffs(), q3->coeffs());
|
||||
#if defined(EIGEN_VECTORIZE) && EIGEN_ALIGN_STATICALLY
|
||||
if(internal::packet_traits<Scalar>::Vectorizable)
|
||||
if(internal::packet_traits<Scalar>::Vectorizable && internal::packet_traits<Scalar>::size<=4)
|
||||
VERIFY_RAISES_ASSERT((::new(reinterpret_cast<void*>(arrayunaligned)) QuaternionA));
|
||||
#endif
|
||||
}
|
||||
|
@ -404,9 +404,9 @@ template<typename Scalar> void transform_alignment()
|
||||
typedef Transform<Scalar,3,Projective,AutoAlign> Projective3a;
|
||||
typedef Transform<Scalar,3,Projective,DontAlign> Projective3u;
|
||||
|
||||
EIGEN_ALIGN16 Scalar array1[16];
|
||||
EIGEN_ALIGN16 Scalar array2[16];
|
||||
EIGEN_ALIGN16 Scalar array3[16+1];
|
||||
EIGEN_ALIGN_DEFAULT Scalar array1[16];
|
||||
EIGEN_ALIGN_DEFAULT Scalar array2[16];
|
||||
EIGEN_ALIGN_DEFAULT Scalar array3[16+1];
|
||||
Scalar* array3u = array3+1;
|
||||
|
||||
Projective3a *p1 = ::new(reinterpret_cast<void*>(array1)) Projective3a;
|
||||
|
Loading…
Reference in New Issue
Block a user