diff options
| author | Claudius "keldu" Holeksa <mail@keldu.de> | 2026-01-19 16:23:49 +0100 |
|---|---|---|
| committer | Claudius "keldu" Holeksa <mail@keldu.de> | 2026-01-19 16:23:49 +0100 |
| commit | 2d9cd68ba5f79453487b0f6be4d984a0d556077a (patch) | |
| tree | f699da7a36806e8aa899881e824af49dd106fd17 /modules/remote-sycl/tests | |
| parent | 45104cfba44c9aead0b14ef831f3eef7893e1931 (diff) | |
| download | forstio-forstio-2d9cd68ba5f79453487b0f6be4d984a0d556077a.tar.gz | |
Sycl changes and CT multiply
Diffstat (limited to 'modules/remote-sycl/tests')
| -rw-r--r-- | modules/remote-sycl/tests/data_ref.cpp | 25 | ||||
| -rw-r--r-- | modules/remote-sycl/tests/remote.foo (renamed from modules/remote-sycl/tests/remote.cpp) | 2 |
2 files changed, 20 insertions, 7 deletions
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<rmt::Sycl> dev; + acpp::sycl::queue& sycl_q = dev.get_handle(); constexpr uint64_t dat_size = 1000u; - data<sch::Array<sch::UInt64>, encode::Sycl<encode::Native>> dat{{{dat_size}},sycl_q}; + data<sch::Array<sch::UInt64>, encode::Native> dat{{{dat_size}}}; + auto eo_syc_dat = dev.template allocate_on_device<sch::Array<sch::UInt64>,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<sch::Ref<sch::Array<sch::UInt64>>, encode::Sycl<encode::Native>> 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<sch::Ref<sch::Array<sch::UInt64>>, encode::Sycl<encode::Native>> 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<sch::UInt64> i = 0u; i < saw::data<sch::UInt64>{dat_size}; ++i){ + SAW_EXPECT(dat.at({i}) == i, std::string{"Unexpected value: "} + std::to_string(i.get())); } } } diff --git a/modules/remote-sycl/tests/remote.cpp b/modules/remote-sycl/tests/remote.foo index e580f17..698c333 100644 --- a/modules/remote-sycl/tests/remote.cpp +++ b/modules/remote-sycl/tests/remote.foo @@ -17,7 +17,7 @@ SAW_TEST("Remote Basics"){ auto& sycl_addr = eo_sycl_addr.get_value(); - auto eo_dat_srv = sycl_rmt.data_listen(sycl_addr); + auto eo_dat_srv = sycl_rmt.data_listen<sch::Struct<>,saw::encode::Native>(*sycl_addr); SAW_EOV_EXPECT(eo_dat_srv); auto& dat_srv = eo_dat_srv.get_value(); |
