Skip to content

Commit b24f1e3

Browse files
[SYCL][E2E] Add non-zero "delta" for degrees/radians tests (#15217)
We've observed some failures due to produced results being not exact 180/`M_PI`, e.g. due to the use of FMA instructions. `half` versions of the test cases already used a delta to perform comparison, use the same for `float`/`double`.
1 parent a689b8d commit b24f1e3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

sycl/test-e2e/Basic/built-ins/marray_common.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ int main() {
3737
test(F(clamp), marray<float, 2>{1.0f, 2.0f}, ma1, 1.0f, 3.0f);
3838
test(has_fp64, F(clamp), marray<double, 2>{1.0, 2.0}, ma4, 1.0, 3.0);
3939
// degrees
40-
test(F(degrees), marray<float, 3>{180, 180, 180}, ma5);
41-
test(has_fp64, F(degrees), marray<double, 3>{180, 180, 180}, ma6);
40+
test(0.2, F(degrees), marray<float, 3>{180, 180, 180}, ma5);
41+
test(has_fp64, 0.2, F(degrees), marray<double, 3>{180, 180, 180}, ma6);
4242
test(has_fp16, 0.2, F(degrees), marray<half, 3>{180, 180, 180}, ma7);
4343
// max
4444
test(F(max), marray<float, 2>{3.0f, 2.0f}, ma1, ma3);
@@ -53,8 +53,8 @@ int main() {
5353
test(F(mix), marray<float, 2>{1.4f, 2.0f}, ma1, ma3, 0.2f);
5454
test(has_fp64, F(mix), marray<double, 2>{3.0, 5.0}, ma4, ma9, 0.5);
5555
// radians
56-
test(F(radians), marray<float, 3>{M_PI, M_PI, M_PI}, ma10);
57-
test(has_fp64, F(radians), marray<double, 3>{M_PI, M_PI, M_PI}, ma11);
56+
test(0.002, F(radians), marray<float, 3>{M_PI, M_PI, M_PI}, ma10);
57+
test(has_fp64, 0.002, F(radians), marray<double, 3>{M_PI, M_PI, M_PI}, ma11);
5858
test(has_fp16, 0.002, F(radians), marray<half, 3>{M_PI, M_PI, M_PI}, ma12);
5959
// step
6060
test(F(step), marray<float, 2>{1.0f, 1.0f}, ma1, ma3);

0 commit comments

Comments
 (0)