@@ -58,13 +58,21 @@ namespace xt
5858 }
5959
6060 template <class T >
61- bool test_simd_linear_assign (T const & a1, T const & a2)
61+ bool test_static_simd_linear_assign (T const & a1, T const & a2)
6262 {
6363 auto tmp1 = pow (sin ((a2 - a1) / 2 .), 2 .);
6464 auto tmp2 = cos (a1);
6565 return xt::xassign_traits<T, decltype (tmp2)>::simd_linear_assign ();
6666 }
6767
68+ template <class T >
69+ bool test_dynamic_simd_linear_assign (T const & a1, T const & a2)
70+ {
71+ auto tmp1 = pow (sin ((a2 - a1) / 2 .), 2 .);
72+ auto tmp2 = cos (a1);
73+ return xt::xassign_traits<T, decltype (tmp2)>::simd_linear_assign (a1, tmp2);
74+ }
75+
6876 template <class T >
6977 bool test_linear_static_layout (T const & a1, T const & a2)
7078 {
@@ -115,16 +123,29 @@ namespace xt
115123 EXPECT_TRUE (test_linear_assign (c1, c2));
116124 }
117125
118- TEST_F (pyarray_traits, simd_linear_assign)
126+ TEST_F (pyarray_traits, static_simd_linear_assign)
127+ {
128+ #ifdef XTENSOR_USE_XSIMD
129+ EXPECT_FALSE (test_static_simd_linear_assign (d1, d2));
130+ EXPECT_TRUE (test_static_simd_linear_assign (r1, r2));
131+ EXPECT_TRUE (test_static_simd_linear_assign (c1, c2));
132+ #else
133+ EXPECT_FALSE (test_static_simd_linear_assign (d1, d2));
134+ EXPECT_FALSE (test_static_simd_linear_assign (r1, r2));
135+ EXPECT_FALSE (test_static_simd_linear_assign (c1, c2));
136+ #endif
137+ }
138+
139+ TEST_F (pyarray_traits, dynamic_simd_linear_assign)
119140 {
120141#ifdef XTENSOR_USE_XSIMD
121- EXPECT_FALSE ( test_simd_linear_assign (d1, d2));
122- EXPECT_TRUE (test_simd_linear_assign (r1, r2));
123- EXPECT_TRUE (test_simd_linear_assign (c1, c2));
142+ EXPECT_TRUE ( test_dynamic_simd_linear_assign (d1, d2));
143+ EXPECT_TRUE (test_dynamic_simd_linear_assign (r1, r2));
144+ EXPECT_TRUE (test_dynamic_simd_linear_assign (c1, c2));
124145#else
125- EXPECT_FALSE (test_simd_linear_assign (d1, d2));
126- EXPECT_FALSE (test_simd_linear_assign (r1, r2));
127- EXPECT_FALSE (test_simd_linear_assign (c1, c2));
146+ EXPECT_FALSE (test_dynamic_simd_linear_assign (d1, d2));
147+ EXPECT_FALSE (test_dynamic_simd_linear_assign (r1, r2));
148+ EXPECT_FALSE (test_dynamic_simd_linear_assign (c1, c2));
128149#endif
129150 }
130151
0 commit comments