From 2d9cd68ba5f79453487b0f6be4d984a0d556077a Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Mon, 19 Jan 2026 16:23:49 +0100 Subject: Sycl changes and CT multiply --- modules/remote-sycl/tests/data_ref.cpp | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) (limited to 'modules/remote-sycl/tests/data_ref.cpp') diff --git a/modules/remote-sycl/tests/data_ref.cpp b/modules/remote-sycl/tests/data_ref.cpp index e92c693..7f5bb1b 100644 --- a/modules/remote-sycl/tests/data_ref.cpp +++ b/modules/remote-sycl/tests/data_ref.cpp @@ -10,14 +10,23 @@ using namespace saw::schema; SAW_TEST("Data Ref Basics"){ using namespace saw; - acpp::sycl::queue sycl_q; + device dev; + acpp::sycl::queue& sycl_q = dev.get_handle(); constexpr uint64_t dat_size = 1000u; - data, encode::Sycl> dat{{{dat_size}},sycl_q}; + data, encode::Native> dat{{{dat_size}}}; + auto eo_syc_dat = dev.template allocate_on_device,encode::Native>({{dat_size}}); + SAW_EXPECT(eo_syc_dat.is_value(), "Couldn't allocate on device"); + auto& sycl_dat = eo_syc_dat.get_value(); - data>, encode::Sycl> dat_ref{dat}; - auto dat_ptr = dat_ref.get_internal_data(); + { + auto eov = dev.copy_to_device(dat,sycl_dat); + SAW_EXPECT_EOV(eov); + } + + data>, encode::Sycl> sdat_ref{sycl_dat}; + auto dat_ptr = sdat_ref.get_internal_data(); sycl_q.parallel_for(dat_size, [=](acpp::sycl::id<1> idx){ size_t i = idx[0]; @@ -25,8 +34,12 @@ SAW_TEST("Data Ref Basics"){ dat_ptr[i] = {i}; }).wait(); - for(uint64_t i = 0u; i < dat_size; ++i){ - SAW_EXPECT(dat_ptr[i].get() == i, std::string{"Unexpected value: "} + std::to_string(i)); + { + auto eov = dev.copy_to_host(sycl_dat,dat); + SAW_EXPECT_EOV(eov); + } + for(saw::data i = 0u; i < saw::data{dat_size}; ++i){ + SAW_EXPECT(dat.at({i}) == i, std::string{"Unexpected value: "} + std::to_string(i.get())); } } } -- cgit v1.2.3