10 #ifdef EIGEN_TEST_PART_1
11 #define EIGEN_UNALIGNED_VECTORIZE 1
14 #ifdef EIGEN_TEST_PART_2
15 #define EIGEN_UNALIGNED_VECTORIZE 0
18 #ifdef EIGEN_DEFAULT_TO_ROW_MAJOR
19 #undef EIGEN_DEFAULT_TO_ROW_MAJOR
21 #define EIGEN_DEBUG_ASSIGN
29 #if EIGEN_GNUC_AT_LEAST(6,0)
30 #pragma GCC diagnostic ignored "-Wignored-attributes"
33 using internal::demangle_flags;
34 using internal::demangle_traversal;
35 using internal::demangle_unrolling;
37 template<
typename Dst,
typename Src>
38 bool test_assign(
const Dst&,
const Src&,
int traversal,
int unrolling)
41 typedef internal::copy_using_evaluator_traits<internal::evaluator<Dst>,internal::evaluator<Src>, internal::assign_op<typename Dst::Scalar,typename Src::Scalar> > traits;
42 bool res = traits::Traversal==traversal;
46 res =
res &&
int(traits::Unrolling)==unrolling;
49 std::cerr <<
"Src: " << demangle_flags(Src::Flags) << std::endl;
50 std::cerr <<
" " << demangle_flags(internal::evaluator<Src>::Flags) << std::endl;
51 std::cerr <<
"Dst: " << demangle_flags(Dst::Flags) << std::endl;
52 std::cerr <<
" " << demangle_flags(internal::evaluator<Dst>::Flags) << std::endl;
54 std::cerr <<
" Expected Traversal == " << demangle_traversal(traversal)
55 <<
" got " << demangle_traversal(traits::Traversal) <<
"\n";
56 std::cerr <<
" Expected Unrolling == " << demangle_unrolling(unrolling)
57 <<
" got " << demangle_unrolling(traits::Unrolling) <<
"\n";
62 template<
typename Dst,
typename Src>
66 typedef internal::copy_using_evaluator_traits<internal::evaluator<Dst>,internal::evaluator<Src>, internal::assign_op<typename Dst::Scalar,typename Src::Scalar> > traits;
67 bool res = traits::Traversal==traversal && traits::Unrolling==unrolling;
70 std::cerr <<
"Src: " << demangle_flags(Src::Flags) << std::endl;
71 std::cerr <<
" " << demangle_flags(internal::evaluator<Src>::Flags) << std::endl;
72 std::cerr <<
"Dst: " << demangle_flags(Dst::Flags) << std::endl;
73 std::cerr <<
" " << demangle_flags(internal::evaluator<Dst>::Flags) << std::endl;
75 std::cerr <<
" Expected Traversal == " << demangle_traversal(traversal)
76 <<
" got " << demangle_traversal(traits::Traversal) <<
"\n";
77 std::cerr <<
" Expected Unrolling == " << demangle_unrolling(unrolling)
78 <<
" got " << demangle_unrolling(traits::Unrolling) <<
"\n";
83 template<
typename Xpr>
84 bool test_redux(
const Xpr&,
int traversal,
int unrolling)
87 typedef internal::redux_traits<internal::scalar_sum_op<Scalar,Scalar>,internal::redux_evaluator<Xpr> > traits;
89 bool res = traits::Traversal==traversal && traits::Unrolling==unrolling;
92 std::cerr << demangle_flags(Xpr::Flags) << std::endl;
93 std::cerr << demangle_flags(internal::evaluator<Xpr>::Flags) << std::endl;
96 std::cerr <<
" Expected Traversal == " << demangle_traversal(traversal)
97 <<
" got " << demangle_traversal(traits::Traversal) <<
"\n";
98 std::cerr <<
" Expected Unrolling == " << demangle_unrolling(unrolling)
99 <<
" got " << demangle_unrolling(traits::Unrolling) <<
"\n";
104 template<typename Scalar, bool Enable = internal::packet_traits<Scalar>::Vectorizable>
144 #if !EIGEN_GCC_AND_ARCH_DOESNT_WANT_STACK_ALIGNMENT
200 VERIFY(
test_assign(Matrix11(),
Matrix<Scalar,21,21>().
template block<PacketSize,PacketSize>(2,3)+
Matrix<Scalar,21,21>().
template block<PacketSize,PacketSize>(3,2),
303 #if !EIGEN_GCC_AND_ARCH_DOESNT_WANT_STACK_ALIGNMENT
346 VERIFY(
test_assign(Matrix11(),
Matrix<Scalar,17,17>().
template block<PacketSize,PacketSize>(2,3)+
Matrix<Scalar,17,17>().
template block<PacketSize,PacketSize>(8,4),
369 VERIFY(
test_redux(Matrix57().
template block<PacketSize==1?2:PacketSize,3>(1,0),
396 #ifdef EIGEN_VECTORIZE
410 if(internal::packet_traits<float>::Vectorizable)
419 if(internal::packet_traits<double>::Vectorizable)
427 #endif // EIGEN_VECTORIZE