1 // This file is part of Eigen, a lightweight C++ template library
4 // Copyright (C) 2015 Gael Guennebaud <gael.guennebaud@inria.fr>
6 // This Source Code Form is subject to the terms of the Mozilla
7 // Public License v. 2.0. If a copy of the MPL was not distributed
8 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
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
25 using internal::demangle_flags
;
26 using internal::demangle_traversal
;
27 using internal::demangle_unrolling
;
29 template<typename Dst
, typename Src
>
30 bool test_assign(const Dst
&, const Src
&, int traversal
, int unrolling
)
32 typedef internal::copy_using_evaluator_traits
<internal::evaluator
<Dst
>,internal::evaluator
<Src
>, internal::assign_op
<typename
Dst::Scalar
,typename
Src::Scalar
> > traits
;
33 bool res
= traits::Traversal
==traversal
;
34 if(unrolling
==InnerUnrolling
+CompleteUnrolling
)
35 res
= res
&& (int(traits::Unrolling
)==InnerUnrolling
|| int(traits::Unrolling
)==CompleteUnrolling
);
37 res
= res
&& int(traits::Unrolling
)==unrolling
;
40 std::cerr
<< "Src: " << demangle_flags(Src::Flags
) << std::endl
;
41 std::cerr
<< " " << demangle_flags(internal::evaluator
<Src
>::Flags
) << std::endl
;
42 std::cerr
<< "Dst: " << demangle_flags(Dst::Flags
) << std::endl
;
43 std::cerr
<< " " << demangle_flags(internal::evaluator
<Dst
>::Flags
) << std::endl
;
45 std::cerr
<< " Expected Traversal == " << demangle_traversal(traversal
)
46 << " got " << demangle_traversal(traits::Traversal
) << "\n";
47 std::cerr
<< " Expected Unrolling == " << demangle_unrolling(unrolling
)
48 << " got " << demangle_unrolling(traits::Unrolling
) << "\n";
53 template<typename Dst
, typename Src
>
54 bool test_assign(int traversal
, int unrolling
)
56 typedef internal::copy_using_evaluator_traits
<internal::evaluator
<Dst
>,internal::evaluator
<Src
>, internal::assign_op
<typename
Dst::Scalar
,typename
Src::Scalar
> > traits
;
57 bool res
= traits::Traversal
==traversal
&& traits::Unrolling
==unrolling
;
60 std::cerr
<< "Src: " << demangle_flags(Src::Flags
) << std::endl
;
61 std::cerr
<< " " << demangle_flags(internal::evaluator
<Src
>::Flags
) << std::endl
;
62 std::cerr
<< "Dst: " << demangle_flags(Dst::Flags
) << std::endl
;
63 std::cerr
<< " " << demangle_flags(internal::evaluator
<Dst
>::Flags
) << std::endl
;
65 std::cerr
<< " Expected Traversal == " << demangle_traversal(traversal
)
66 << " got " << demangle_traversal(traits::Traversal
) << "\n";
67 std::cerr
<< " Expected Unrolling == " << demangle_unrolling(unrolling
)
68 << " got " << demangle_unrolling(traits::Unrolling
) << "\n";
73 template<typename Xpr
>
74 bool test_redux(const Xpr
&, int traversal
, int unrolling
)
76 typedef typename
Xpr::Scalar Scalar
;
77 typedef internal::redux_traits
<internal::scalar_sum_op
<Scalar
,Scalar
>,internal::redux_evaluator
<Xpr
> > traits
;
79 bool res
= traits::Traversal
==traversal
&& traits::Unrolling
==unrolling
;
82 std::cerr
<< demangle_flags(Xpr::Flags
) << std::endl
;
83 std::cerr
<< demangle_flags(internal::evaluator
<Xpr
>::Flags
) << std::endl
;
86 std::cerr
<< " Expected Traversal == " << demangle_traversal(traversal
)
87 << " got " << demangle_traversal(traits::Traversal
) << "\n";
88 std::cerr
<< " Expected Unrolling == " << demangle_unrolling(unrolling
)
89 << " got " << demangle_unrolling(traits::Unrolling
) << "\n";
94 template<typename Scalar
, bool Enable
= internal::packet_traits
<Scalar
>::Vectorizable
>
95 struct vectorization_logic
97 typedef internal::packet_traits
<Scalar
> PacketTraits
;
99 typedef typename
internal::packet_traits
<Scalar
>::type PacketType
;
100 typedef typename
internal::unpacket_traits
<PacketType
>::half HalfPacketType
;
102 PacketSize
= internal::unpacket_traits
<PacketType
>::size
,
103 HalfPacketSize
= internal::unpacket_traits
<HalfPacketType
>::size
108 typedef Matrix
<Scalar
,PacketSize
,1> Vector1
;
109 typedef Matrix
<Scalar
,Dynamic
,1> VectorX
;
110 typedef Matrix
<Scalar
,Dynamic
,Dynamic
> MatrixXX
;
111 typedef Matrix
<Scalar
,PacketSize
,PacketSize
> Matrix11
;
112 typedef Matrix
<Scalar
,2*PacketSize
,2*PacketSize
> Matrix22
;
113 typedef Matrix
<Scalar
,(Matrix11::Flags
&RowMajorBit
)?16:4*PacketSize
,(Matrix11::Flags
&RowMajorBit
)?4*PacketSize
:16> Matrix44
;
114 typedef Matrix
<Scalar
,(Matrix11::Flags
&RowMajorBit
)?16:4*PacketSize
,(Matrix11::Flags
&RowMajorBit
)?4*PacketSize
:16,DontAlign
|EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION
> Matrix44u
;
115 typedef Matrix
<Scalar
,4*PacketSize
,4*PacketSize
,ColMajor
> Matrix44c
;
116 typedef Matrix
<Scalar
,4*PacketSize
,4*PacketSize
,RowMajor
> Matrix44r
;
118 typedef Matrix
<Scalar
,
119 (PacketSize
==8 ? 4 : PacketSize
==4 ? 2 : PacketSize
==2 ? 1 : /*PacketSize==1 ?*/ 1),
120 (PacketSize
==8 ? 2 : PacketSize
==4 ? 2 : PacketSize
==2 ? 2 : /*PacketSize==1 ?*/ 1)
123 typedef Matrix
<Scalar
,
124 (PacketSize
==8 ? 4 : PacketSize
==4 ? 2 : PacketSize
==2 ? 1 : /*PacketSize==1 ?*/ 1),
125 (PacketSize
==8 ? 2 : PacketSize
==4 ? 2 : PacketSize
==2 ? 2 : /*PacketSize==1 ?*/ 1),
126 DontAlign
|((Matrix1::Flags
&RowMajorBit
)?RowMajor
:ColMajor
)> Matrix1u
;
128 // this type is made such that it can only be vectorized when viewed as a linear 1D vector
129 typedef Matrix
<Scalar
,
130 (PacketSize
==8 ? 4 : PacketSize
==4 ? 6 : PacketSize
==2 ? ((Matrix11::Flags
&RowMajorBit
)?2:3) : /*PacketSize==1 ?*/ 1),
131 (PacketSize
==8 ? 6 : PacketSize
==4 ? 2 : PacketSize
==2 ? ((Matrix11::Flags
&RowMajorBit
)?3:2) : /*PacketSize==1 ?*/ 3)
134 #if !EIGEN_GCC_AND_ARCH_DOESNT_WANT_STACK_ALIGNMENT
135 VERIFY(test_assign(Vector1(),Vector1(),
136 InnerVectorizedTraversal
,CompleteUnrolling
));
137 VERIFY(test_assign(Vector1(),Vector1()+Vector1(),
138 InnerVectorizedTraversal
,CompleteUnrolling
));
139 VERIFY(test_assign(Vector1(),Vector1().cwiseProduct(Vector1()),
140 InnerVectorizedTraversal
,CompleteUnrolling
));
141 VERIFY(test_assign(Vector1(),Vector1().template cast
<Scalar
>(),
142 InnerVectorizedTraversal
,CompleteUnrolling
));
145 VERIFY(test_assign(Vector1(),Vector1(),
146 InnerVectorizedTraversal
,CompleteUnrolling
));
147 VERIFY(test_assign(Vector1(),Vector1()+Vector1(),
148 InnerVectorizedTraversal
,CompleteUnrolling
));
149 VERIFY(test_assign(Vector1(),Vector1().cwiseProduct(Vector1()),
150 InnerVectorizedTraversal
,CompleteUnrolling
));
152 VERIFY(test_assign(Matrix44(),Matrix44()+Matrix44(),
153 InnerVectorizedTraversal
,InnerUnrolling
));
155 VERIFY(test_assign(Matrix44u(),Matrix44()+Matrix44(),
156 EIGEN_UNALIGNED_VECTORIZE
? InnerVectorizedTraversal
: LinearTraversal
,
157 EIGEN_UNALIGNED_VECTORIZE
? InnerUnrolling
: NoUnrolling
));
159 VERIFY(test_assign(Matrix1(),Matrix1()+Matrix1(),
160 (Matrix1::InnerSizeAtCompileTime
% PacketSize
)==0 ? InnerVectorizedTraversal
: LinearVectorizedTraversal
,
163 VERIFY(test_assign(Matrix1u(),Matrix1()+Matrix1(),
164 EIGEN_UNALIGNED_VECTORIZE
? ((Matrix1::InnerSizeAtCompileTime
% PacketSize
)==0 ? InnerVectorizedTraversal
: LinearVectorizedTraversal
)
165 : LinearTraversal
, CompleteUnrolling
));
167 VERIFY(test_assign(Matrix44c().col(1),Matrix44c().col(2)+Matrix44c().col(3),
168 InnerVectorizedTraversal
,CompleteUnrolling
));
170 VERIFY(test_assign(Matrix44r().row(2),Matrix44r().row(1)+Matrix44r().row(1),
171 InnerVectorizedTraversal
,CompleteUnrolling
));
175 typedef Matrix
<Scalar
,3,3,ColMajor
> Matrix33c
;
176 typedef Matrix
<Scalar
,3,1,ColMajor
> Vector3
;
177 VERIFY(test_assign(Matrix33c().row(2),Matrix33c().row(1)+Matrix33c().row(1),
178 LinearTraversal
,CompleteUnrolling
));
179 VERIFY(test_assign(Vector3(),Vector3()+Vector3(),
180 EIGEN_UNALIGNED_VECTORIZE
? (HalfPacketSize
==1 ? InnerVectorizedTraversal
: LinearVectorizedTraversal
) : (HalfPacketSize
==1 ? InnerVectorizedTraversal
: LinearTraversal
), CompleteUnrolling
));
181 VERIFY(test_assign(Matrix33c().col(0),Matrix33c().col(1)+Matrix33c().col(1),
182 EIGEN_UNALIGNED_VECTORIZE
? (HalfPacketSize
==1 ? InnerVectorizedTraversal
: LinearVectorizedTraversal
) : (HalfPacketSize
==1 ? SliceVectorizedTraversal
: LinearTraversal
),
183 ((!EIGEN_UNALIGNED_VECTORIZE
) && HalfPacketSize
==1) ? NoUnrolling
: CompleteUnrolling
));
185 VERIFY(test_assign(Matrix3(),Matrix3().cwiseProduct(Matrix3()),
186 LinearVectorizedTraversal
,CompleteUnrolling
));
188 VERIFY(test_assign(Matrix
<Scalar
,17,17>(),Matrix
<Scalar
,17,17>()+Matrix
<Scalar
,17,17>(),
189 HalfPacketSize
==1 ? InnerVectorizedTraversal
:
190 EIGEN_UNALIGNED_VECTORIZE
? LinearVectorizedTraversal
:
194 VERIFY(test_assign(Matrix11(), Matrix11()+Matrix11(),InnerVectorizedTraversal
,CompleteUnrolling
));
197 VERIFY(test_assign(Matrix11(),Matrix
<Scalar
,17,17>().template block
<PacketSize
,PacketSize
>(2,3)+Matrix
<Scalar
,17,17>().template block
<PacketSize
,PacketSize
>(8,4),
198 (EIGEN_UNALIGNED_VECTORIZE
) ? InnerVectorizedTraversal
: DefaultTraversal
, CompleteUnrolling
|InnerUnrolling
));
200 VERIFY(test_assign(Vector1(),Matrix11()*Vector1(),
201 InnerVectorizedTraversal
,CompleteUnrolling
));
203 VERIFY(test_assign(Matrix11(),Matrix11().lazyProduct(Matrix11()),
204 InnerVectorizedTraversal
,InnerUnrolling
+CompleteUnrolling
));
207 VERIFY(test_redux(Vector1(),
208 LinearVectorizedTraversal
,CompleteUnrolling
));
210 VERIFY(test_redux(Matrix
<Scalar
,PacketSize
,3>(),
211 LinearVectorizedTraversal
,CompleteUnrolling
));
213 VERIFY(test_redux(Matrix3(),
214 LinearVectorizedTraversal
,CompleteUnrolling
));
216 VERIFY(test_redux(Matrix44(),
217 LinearVectorizedTraversal
,NoUnrolling
));
219 VERIFY(test_redux(Matrix44().template block
<(Matrix1::Flags
&RowMajorBit
)?4:PacketSize
,(Matrix1::Flags
&RowMajorBit
)?PacketSize
:4>(1,2),
220 DefaultTraversal
,CompleteUnrolling
));
222 VERIFY(test_redux(Matrix44c().template block
<2*PacketSize
,1>(1,2),
223 LinearVectorizedTraversal
,CompleteUnrolling
));
225 VERIFY(test_redux(Matrix44r().template block
<1,2*PacketSize
>(2,1),
226 LinearVectorizedTraversal
,CompleteUnrolling
));
229 Map
<Matrix22
, AlignedMax
, OuterStride
<3*PacketSize
> >,
231 >(InnerVectorizedTraversal
,CompleteUnrolling
)));
234 Map
<Matrix
<Scalar
,EIGEN_PLAIN_ENUM_MAX(2,PacketSize
),EIGEN_PLAIN_ENUM_MAX(2,PacketSize
)>, AlignedMax
, InnerStride
<3*PacketSize
> >,
235 Matrix
<Scalar
,EIGEN_PLAIN_ENUM_MAX(2,PacketSize
),EIGEN_PLAIN_ENUM_MAX(2,PacketSize
)>
236 >(DefaultTraversal
,PacketSize
>=8?InnerUnrolling
:CompleteUnrolling
)));
238 VERIFY((test_assign(Matrix11(), Matrix
<Scalar
,PacketSize
,EIGEN_PLAIN_ENUM_MIN(2,PacketSize
)>()*Matrix
<Scalar
,EIGEN_PLAIN_ENUM_MIN(2,PacketSize
),PacketSize
>(),
239 InnerVectorizedTraversal
, CompleteUnrolling
)));
242 VERIFY(test_assign(MatrixXX(10,10),MatrixXX(20,20).block(10,10,2,3),
243 SliceVectorizedTraversal
,NoUnrolling
));
245 VERIFY(test_redux(VectorX(10),
246 LinearVectorizedTraversal
,NoUnrolling
));
250 template<typename Scalar
> struct vectorization_logic
<Scalar
,false>
255 template<typename Scalar
, bool Enable
= !internal::is_same
<typename
internal::unpacket_traits
<typename
internal::packet_traits
<Scalar
>::type
>::half
,
256 typename
internal::packet_traits
<Scalar
>::type
>::value
>
257 struct vectorization_logic_half
259 typedef internal::packet_traits
<Scalar
> PacketTraits
;
260 typedef typename
internal::unpacket_traits
<typename
internal::packet_traits
<Scalar
>::type
>::half PacketType
;
262 PacketSize
= internal::unpacket_traits
<PacketType
>::size
267 typedef Matrix
<Scalar
,PacketSize
,1> Vector1
;
268 typedef Matrix
<Scalar
,PacketSize
,PacketSize
> Matrix11
;
269 typedef Matrix
<Scalar
,5*PacketSize
,7,ColMajor
> Matrix57
;
270 typedef Matrix
<Scalar
,3*PacketSize
,5,ColMajor
> Matrix35
;
271 typedef Matrix
<Scalar
,5*PacketSize
,7,DontAlign
|ColMajor
> Matrix57u
;
272 // typedef Matrix<Scalar,(Matrix11::Flags&RowMajorBit)?16:4*PacketSize,(Matrix11::Flags&RowMajorBit)?4*PacketSize:16> Matrix44;
273 // typedef Matrix<Scalar,(Matrix11::Flags&RowMajorBit)?16:4*PacketSize,(Matrix11::Flags&RowMajorBit)?4*PacketSize:16,DontAlign|EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION> Matrix44u;
274 // typedef Matrix<Scalar,4*PacketSize,4*PacketSize,ColMajor> Matrix44c;
275 // typedef Matrix<Scalar,4*PacketSize,4*PacketSize,RowMajor> Matrix44r;
277 typedef Matrix
<Scalar
,
278 (PacketSize
==8 ? 4 : PacketSize
==4 ? 2 : PacketSize
==2 ? 1 : /*PacketSize==1 ?*/ 1),
279 (PacketSize
==8 ? 2 : PacketSize
==4 ? 2 : PacketSize
==2 ? 2 : /*PacketSize==1 ?*/ 1)
282 typedef Matrix
<Scalar
,
283 (PacketSize
==8 ? 4 : PacketSize
==4 ? 2 : PacketSize
==2 ? 1 : /*PacketSize==1 ?*/ 1),
284 (PacketSize
==8 ? 2 : PacketSize
==4 ? 2 : PacketSize
==2 ? 2 : /*PacketSize==1 ?*/ 1),
285 DontAlign
|((Matrix1::Flags
&RowMajorBit
)?RowMajor
:ColMajor
)> Matrix1u
;
287 // this type is made such that it can only be vectorized when viewed as a linear 1D vector
288 typedef Matrix
<Scalar
,
289 (PacketSize
==8 ? 4 : PacketSize
==4 ? 6 : PacketSize
==2 ? ((Matrix11::Flags
&RowMajorBit
)?2:3) : /*PacketSize==1 ?*/ 1),
290 (PacketSize
==8 ? 6 : PacketSize
==4 ? 2 : PacketSize
==2 ? ((Matrix11::Flags
&RowMajorBit
)?3:2) : /*PacketSize==1 ?*/ 3)
293 #if !EIGEN_GCC_AND_ARCH_DOESNT_WANT_STACK_ALIGNMENT
294 VERIFY(test_assign(Vector1(),Vector1(),
295 InnerVectorizedTraversal
,CompleteUnrolling
));
296 VERIFY(test_assign(Vector1(),Vector1()+Vector1(),
297 InnerVectorizedTraversal
,CompleteUnrolling
));
298 VERIFY(test_assign(Vector1(),Vector1().template segment
<PacketSize
>(0).derived(),
299 EIGEN_UNALIGNED_VECTORIZE
? InnerVectorizedTraversal
: LinearVectorizedTraversal
,CompleteUnrolling
));
300 VERIFY(test_assign(Vector1(),Scalar(2.1)*Vector1()-Vector1(),
301 InnerVectorizedTraversal
,CompleteUnrolling
));
302 VERIFY(test_assign(Vector1(),(Scalar(2.1)*Vector1().template segment
<PacketSize
>(0)-Vector1().template segment
<PacketSize
>(0)).derived(),
303 EIGEN_UNALIGNED_VECTORIZE
? InnerVectorizedTraversal
: LinearVectorizedTraversal
,CompleteUnrolling
));
304 VERIFY(test_assign(Vector1(),Vector1().cwiseProduct(Vector1()),
305 InnerVectorizedTraversal
,CompleteUnrolling
));
306 VERIFY(test_assign(Vector1(),Vector1().template cast
<Scalar
>(),
307 InnerVectorizedTraversal
,CompleteUnrolling
));
310 VERIFY(test_assign(Vector1(),Vector1(),
311 InnerVectorizedTraversal
,CompleteUnrolling
));
312 VERIFY(test_assign(Vector1(),Vector1()+Vector1(),
313 InnerVectorizedTraversal
,CompleteUnrolling
));
314 VERIFY(test_assign(Vector1(),Vector1().cwiseProduct(Vector1()),
315 InnerVectorizedTraversal
,CompleteUnrolling
));
317 VERIFY(test_assign(Matrix57(),Matrix57()+Matrix57(),
318 InnerVectorizedTraversal
,InnerUnrolling
));
320 VERIFY(test_assign(Matrix57u(),Matrix57()+Matrix57(),
321 EIGEN_UNALIGNED_VECTORIZE
? InnerVectorizedTraversal
: LinearTraversal
,
322 EIGEN_UNALIGNED_VECTORIZE
? InnerUnrolling
: NoUnrolling
));
324 VERIFY(test_assign(Matrix1u(),Matrix1()+Matrix1(),
325 EIGEN_UNALIGNED_VECTORIZE
? ((Matrix1::InnerSizeAtCompileTime
% PacketSize
)==0 ? InnerVectorizedTraversal
: LinearVectorizedTraversal
) : LinearTraversal
,CompleteUnrolling
));
329 typedef Matrix
<Scalar
,3,3,ColMajor
> Matrix33c
;
330 VERIFY(test_assign(Matrix33c().row(2),Matrix33c().row(1)+Matrix33c().row(1),
331 LinearTraversal
,CompleteUnrolling
));
332 VERIFY(test_assign(Matrix33c().col(0),Matrix33c().col(1)+Matrix33c().col(1),
333 EIGEN_UNALIGNED_VECTORIZE
? (PacketSize
==1 ? InnerVectorizedTraversal
: LinearVectorizedTraversal
) : LinearTraversal
,CompleteUnrolling
));
335 VERIFY(test_assign(Matrix3(),Matrix3().cwiseQuotient(Matrix3()),
336 PacketTraits::HasDiv
? LinearVectorizedTraversal
: LinearTraversal
,CompleteUnrolling
));
338 VERIFY(test_assign(Matrix
<Scalar
,17,17>(),Matrix
<Scalar
,17,17>()+Matrix
<Scalar
,17,17>(),
339 EIGEN_UNALIGNED_VECTORIZE
? (PacketSize
==1 ? InnerVectorizedTraversal
: LinearVectorizedTraversal
) : LinearTraversal
,
342 VERIFY(test_assign(Matrix11(),Matrix
<Scalar
,17,17>().template block
<PacketSize
,PacketSize
>(2,3)+Matrix
<Scalar
,17,17>().template block
<PacketSize
,PacketSize
>(8,4),
343 EIGEN_UNALIGNED_VECTORIZE
? InnerVectorizedTraversal
: DefaultTraversal
,PacketSize
>4?InnerUnrolling
:CompleteUnrolling
));
345 VERIFY(test_assign(Vector1(),Matrix11()*Vector1(),
346 InnerVectorizedTraversal
,CompleteUnrolling
));
348 VERIFY(test_assign(Matrix11(),Matrix11().lazyProduct(Matrix11()),
349 InnerVectorizedTraversal
,InnerUnrolling
+CompleteUnrolling
));
352 VERIFY(test_redux(Vector1(),
353 LinearVectorizedTraversal
,CompleteUnrolling
));
355 VERIFY(test_redux(Matrix
<Scalar
,PacketSize
,3>(),
356 LinearVectorizedTraversal
,CompleteUnrolling
));
358 VERIFY(test_redux(Matrix3(),
359 LinearVectorizedTraversal
,CompleteUnrolling
));
361 VERIFY(test_redux(Matrix35(),
362 LinearVectorizedTraversal
,CompleteUnrolling
));
364 VERIFY(test_redux(Matrix57().template block
<PacketSize
,3>(1,0),
365 DefaultTraversal
,CompleteUnrolling
));
368 Map
<Matrix
<Scalar
,EIGEN_PLAIN_ENUM_MAX(2,PacketSize
),EIGEN_PLAIN_ENUM_MAX(2,PacketSize
)>, AlignedMax
, InnerStride
<3*PacketSize
> >,
369 Matrix
<Scalar
,EIGEN_PLAIN_ENUM_MAX(2,PacketSize
),EIGEN_PLAIN_ENUM_MAX(2,PacketSize
)>
370 >(DefaultTraversal
,CompleteUnrolling
)));
372 VERIFY((test_assign(Matrix57(), Matrix
<Scalar
,5*PacketSize
,3>()*Matrix
<Scalar
,3,7>(),
373 InnerVectorizedTraversal
, InnerUnrolling
|CompleteUnrolling
)));
378 template<typename Scalar
> struct vectorization_logic_half
<Scalar
,false>
383 void test_vectorization_logic()
386 #ifdef EIGEN_VECTORIZE
388 CALL_SUBTEST( vectorization_logic
<int>::run() );
389 CALL_SUBTEST( vectorization_logic
<float>::run() );
390 CALL_SUBTEST( vectorization_logic
<double>::run() );
391 CALL_SUBTEST( vectorization_logic
<std::complex<float> >::run() );
392 CALL_SUBTEST( vectorization_logic
<std::complex<double> >::run() );
394 CALL_SUBTEST( vectorization_logic_half
<int>::run() );
395 CALL_SUBTEST( vectorization_logic_half
<float>::run() );
396 CALL_SUBTEST( vectorization_logic_half
<double>::run() );
397 CALL_SUBTEST( vectorization_logic_half
<std::complex<float> >::run() );
398 CALL_SUBTEST( vectorization_logic_half
<std::complex<double> >::run() );
400 if(internal::packet_traits
<float>::Vectorizable
)
402 VERIFY(test_assign(Matrix
<float,3,3>(),Matrix
<float,3,3>()+Matrix
<float,3,3>(),
403 EIGEN_UNALIGNED_VECTORIZE
? LinearVectorizedTraversal
: LinearTraversal
,CompleteUnrolling
));
405 VERIFY(test_redux(Matrix
<float,5,2>(),
406 EIGEN_UNALIGNED_VECTORIZE
? LinearVectorizedTraversal
: DefaultTraversal
,CompleteUnrolling
));
409 if(internal::packet_traits
<double>::Vectorizable
)
411 VERIFY(test_assign(Matrix
<double,3,3>(),Matrix
<double,3,3>()+Matrix
<double,3,3>(),
412 EIGEN_UNALIGNED_VECTORIZE
? LinearVectorizedTraversal
: LinearTraversal
,CompleteUnrolling
));
414 VERIFY(test_redux(Matrix
<double,7,3>(),
415 EIGEN_UNALIGNED_VECTORIZE
? LinearVectorizedTraversal
: DefaultTraversal
,CompleteUnrolling
));
417 #endif // EIGEN_VECTORIZE