@@ -21,12 +21,12 @@ namespace s = sycl;
21
21
constexpr s::access::mode sycl_read = s::access::mode::read;
22
22
constexpr s::access::mode sycl_write = s::access::mode::write;
23
23
24
- #define TEST_NUM 62
24
+ #define TEST_NUM 61
25
25
26
- float ref[TEST_NUM] = {1 , 1 , 0 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0.5 , 0 , 0 , 1 ,
27
- 0 , 2 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 2 , 0 , 1 , 2 , 5 , 0 ,
28
- 0 , 0 , 0 , 0 .5 , 0.5 , NAN, NAN, 2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
29
- 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 };
26
+ float ref[TEST_NUM] = {1 , 0 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0.5 , 0 , 0 , 1 , 0 ,
27
+ 2 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 2 , 0 , 1 , 2 , 5 , 0 , 0 ,
28
+ 0 , 0 , 0.5 , 0.5 , NAN, NAN, 2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
29
+ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 };
30
30
31
31
float refIptr = 1 ;
32
32
@@ -56,7 +56,6 @@ template <class T> void device_cmath_test_1(s::queue &deviceQueue) {
56
56
float subnormal;
57
57
*((uint32_t *)&subnormal) = 0x7FFFFF ;
58
58
59
- res_access[i++] = std::fabs (-1 .0f );
60
59
res_access[i++] = std::cos (0 .0f );
61
60
res_access[i++] = std::sin (0 .0f );
62
61
res_access[i++] = std::round (1 .0f );
@@ -144,15 +143,15 @@ template <class T> void device_cmath_test_1(s::queue &deviceQueue) {
144
143
assert (quo == 0 );
145
144
}
146
145
147
- // MSVC implements std::ldexp<float> and std::frexp<float> by invoking the
148
- // 'double' version of corresponding C math functions(ldexp and frexp). Those
149
- // 2 functions can only work on Windows with fp64 extension support from
150
- // underlying device.
146
+ // MSVC implements std::ldexp<float>, std::fabs<float> and std::frexp<float> by
147
+ // invoking the 'double' version of corresponding C math functions(ldexp, fabs
148
+ // and frexp). Those functions can only work on Windows with fp64 extension
149
+ // support from underlying device.
151
150
#ifndef _WIN32
152
151
template <class T > void device_cmath_test_2 (s::queue &deviceQueue) {
153
152
s::range<1 > numOfItems{2 };
154
153
T result[2 ] = {-1 };
155
- T ref[2 ] = {0 , 2 };
154
+ T ref[3 ] = {0 , 2 , 1 };
156
155
// Variable exponent is an integer value to store the exponent in frexp
157
156
// function
158
157
int exponent = -1 ;
@@ -167,6 +166,7 @@ template <class T> void device_cmath_test_2(s::queue &deviceQueue) {
167
166
int i = 0 ;
168
167
res_access[i++] = std::frexp (0 .0f , &exp_access[0 ]);
169
168
res_access[i++] = std::ldexp (1 .0f , 1 );
169
+ res_access[i++] = std::fabs (-1 .0f );
170
170
});
171
171
});
172
172
}
0 commit comments