@@ -58,13 +58,21 @@ namespace xt
58
58
}
59
59
60
60
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)
62
62
{
63
63
auto tmp1 = pow (sin ((a2 - a1) / 2 .), 2 .);
64
64
auto tmp2 = cos (a1);
65
65
return xt::xassign_traits<T, decltype (tmp2)>::simd_linear_assign ();
66
66
}
67
67
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
+
68
76
template <class T >
69
77
bool test_linear_static_layout (T const & a1, T const & a2)
70
78
{
@@ -115,16 +123,29 @@ namespace xt
115
123
EXPECT_TRUE (test_linear_assign (c1, c2));
116
124
}
117
125
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)
119
140
<
9819
code class="diff-text syntax-highlighted-line"> {
120
141
#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));
124
145
#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));
128
149
#endif
129
150
}
130
151
0 commit comments