diff --git a/sycl/test-e2e/DeviceLib/exp/exp-std-complex-edge-cases.hpp b/sycl/test-e2e/DeviceLib/exp/exp-std-complex-edge-cases.hpp index 92362c6186979..4e500344dba7b 100644 --- a/sycl/test-e2e/DeviceLib/exp/exp-std-complex-edge-cases.hpp +++ b/sycl/test-e2e/DeviceLib/exp/exp-std-complex-edge-cases.hpp @@ -1,17 +1,10 @@ // This test checks edge cases handling for std::exp(std::complex) used // in SYCL kernels. -// -// REQUIRES: aspect-fp64 -// UNSUPPORTED: hip || cuda -// -// RUN: %{build} -o %t.out -// RUN: %{run} %t.out #include #include #include -#include bool check(bool cond, const std::string &cond_str, int line, unsigned testcase) { @@ -203,12 +196,14 @@ template bool test() { constexpr unsigned N = sizeof(testcases) / sizeof(testcases[0]); + sycl::buffer> data(testcases, sycl::range{N}); sycl::buffer> results(sycl::range{N}); q.submit([&](sycl::handler &cgh) { + sycl::accessor acc_data(data, cgh, sycl::read_only); sycl::accessor acc(results, cgh, sycl::write_only); cgh.parallel_for(sycl::range{N}, [=](sycl::item<1> it) { - acc[it] = std::exp(testcases[it]); + acc[it] = std::exp(acc_data[it]); }); }).wait_and_throw(); @@ -227,7 +222,8 @@ template bool test() { for (unsigned i = 0; i < N; ++i) { std::complex r = acc[i]; // If z is (+/-0, +0), the result is (1, +0) - if (testcases[i].real() == 0 && testcases[i].imag() == 0) { + if (testcases[i].real() == 0 && testcases[i].imag() == 0 && + !std::signbit(testcases[i].imag())) { CHECK(r.real() == 1.0, passed, i); CHECK(r.imag() == 0, passed, i); CHECK(std::signbit(testcases[i].imag()) == std::signbit(r.imag()), @@ -294,8 +290,13 @@ template bool test() { } else if (std::isfinite(testcases[i].imag()) && std::abs(testcases[i].imag()) <= 1) { CHECK(!std::signbit(r.real()), passed, i); +// TODO: This case fails on win. Need to investigate and remove this macro +// check. +// CMPLRLLVM-62905 +#ifndef _WIN32 CHECK(std::signbit(r.imag()) == std::signbit(testcases[i].imag()), passed, i); +#endif // Those tests were taken from oneDPL, not sure what is the corner case // they are covering here } else if (std::isinf(r.real()) && testcases[i].imag() == 0) {