From 2073aef795f74e5c24b7992d6c2f0fadde3fa271 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Tue, 18 Nov 2025 21:56:06 +0100 Subject: Making ref work? --- modules/remote-sycl/tests/data_ref.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'modules/remote-sycl/tests') diff --git a/modules/remote-sycl/tests/data_ref.cpp b/modules/remote-sycl/tests/data_ref.cpp index 61a2c8e..8fb5be4 100644 --- a/modules/remote-sycl/tests/data_ref.cpp +++ b/modules/remote-sycl/tests/data_ref.cpp @@ -13,6 +13,19 @@ SAW_TEST("Data Ref Basics"){ acpp::sycl::queue sycl_q; data, encode::Sycl> dat{{{100u}},sycl_q}; + + data>, encode::Sycl> dat_ref{dat}; + auto dat_ptr = dat_ref.get_internal_data(); + + sycl_q.parallel_for(100u, [=](acpp::sycl::id<1> idx){ + size_t i = idx[0]; + + dat_ptr[i] = {static_cast(i)}; + }).wait(); + + for(uint64_t i = 0u; i < 100u; ++i){ + SAW_EXPECT(dat_ptr[i].get() == i, std::string{"Unexpected value: "} + std::to_string(i)); + } } } -- cgit v1.2.3