|
7 | 7 | //===----------------------------------------------------------------------===//
|
8 | 8 | // REQUIRES: gpu
|
9 | 9 | // UNSUPPORTED: cuda || hip
|
10 |
| -// TODO the test started failing on Linux apprently due to host-side changes in |
11 |
| -// code generation for log/exp, as device code remained the same as earlier, |
12 |
| -// when the test passed. |
13 |
| -// XFAIL: linux |
14 | 10 | // RUN: %clangxx -fsycl %s -o %t.out
|
15 | 11 | // RUN: %GPU_RUN_PLACEHOLDER %t.out
|
16 | 12 |
|
@@ -58,7 +54,7 @@ struct InitDataInRange0_5 {
|
58 | 54 |
|
59 | 55 | // --- Math operation identification
|
60 | 56 |
|
61 |
| -enum class MathOp { sin, cos, exp, sqrt, inv, log, rsqrt, trunc }; |
| 57 | +enum class MathOp { sin, cos, exp, sqrt, inv, log, rsqrt, trunc, exp2, log2 }; |
62 | 58 |
|
63 | 59 | // --- Template functions calculating given math operation on host and device
|
64 | 60 |
|
@@ -95,14 +91,16 @@ template <MathOp Op> float HostMathFunc(float X);
|
95 | 91 | } \
|
96 | 92 | }
|
97 | 93 |
|
98 |
| -DEFINE_SIMD_OVERLOADED_STD_SYCL_OP(sin, sin); |
99 |
| -DEFINE_SIMD_OVERLOADED_STD_SYCL_OP(cos, cos); |
100 |
| -DEFINE_SIMD_OVERLOADED_STD_SYCL_OP(exp, exp); |
101 |
| -DEFINE_SIMD_OVERLOADED_STD_SYCL_OP(log, log); |
| 94 | +DEFINE_SIMD_OVERLOADED_STD_SYCL_OP(sin, std::sin); |
| 95 | +DEFINE_SIMD_OVERLOADED_STD_SYCL_OP(cos, std::cos); |
| 96 | +DEFINE_SIMD_OVERLOADED_STD_SYCL_OP(exp, std::exp); |
| 97 | +DEFINE_SIMD_OVERLOADED_STD_SYCL_OP(log, std::log); |
102 | 98 | DEFINE_ESIMD_OP(inv, 1.0f /);
|
103 |
| -DEFINE_ESIMD_OP(sqrt, sqrt); |
104 |
| -DEFINE_ESIMD_OP(rsqrt, 1.0f / sqrt); |
105 |
| -DEFINE_ESIMD_RT_OP(trunc, trunc); |
| 99 | +DEFINE_ESIMD_OP(sqrt, std::sqrt); |
| 100 | +DEFINE_ESIMD_OP(rsqrt, 1.0f / std::sqrt); |
| 101 | +DEFINE_ESIMD_OP(exp2, std::exp2); |
| 102 | +DEFINE_ESIMD_OP(log2, std::log2); |
| 103 | +DEFINE_ESIMD_RT_OP(trunc, std::trunc); |
106 | 104 |
|
107 | 105 | // --- Generic kernel calculating an extended math operation on array elements
|
108 | 106 |
|
@@ -199,6 +197,8 @@ template <int VL> bool test(queue &Q) {
|
199 | 197 | Pass &= test<MathOp::exp, VL>(Q, "exp", InitDataInRange0_5{});
|
200 | 198 | Pass &= test<MathOp::log, VL>(Q, "log", InitDataFuncWide{});
|
201 | 199 | Pass &= test<MathOp::trunc, VL>(Q, "trunc", InitDataFuncWide{});
|
| 200 | + Pass &= test<MathOp::exp2, VL>(Q, "exp2", InitDataFuncWide{}); |
| 201 | + Pass &= test<MathOp::log2, VL>(Q, "log2", InitDataFuncWide{}); |
202 | 202 | return Pass;
|
203 | 203 | }
|
204 | 204 |
|
|
0 commit comments