diff --git a/sycl/test-e2e/syclcompat/math/math_extend.cpp b/sycl/test-e2e/syclcompat/math/math_extend.cpp index 1323d2121b22b..3dc877e782ab4 100644 --- a/sycl/test-e2e/syclcompat/math/math_extend.cpp +++ b/sycl/test-e2e/syclcompat/math/math_extend.cpp @@ -40,6 +40,7 @@ #include #include +#include #define CHECK(S, REF) \ { \ @@ -169,14 +170,16 @@ void test(const sycl::stream &s, int *ec) { int main() { sycl::queue q = syclcompat::get_default_queue(); - int *ec = nullptr; - ec = sycl::malloc_shared(1, q); - *ec = 0; + int *ec = syclcompat::malloc(1); + syclcompat::fill(ec, 0, 1); q.submit([&](sycl::handler &cgh) { sycl::stream out(1024, 256, cgh); cgh.parallel_for(1, [=](sycl::item<1> it) { test(out, ec); }); }); q.wait_and_throw(); - return *ec; + int ec_h; + syclcompat::memcpy(&ec_h, ec, 1); + + return ec_h; }