summaryrefslogtreecommitdiff
path: root/modules/remote-sycl/tests/data_ref.cpp
diff options
context:
space:
mode:
authorClaudius "keldu" Holeksa <mail@keldu.de>2025-11-18 21:56:06 +0100
committerClaudius "keldu" Holeksa <mail@keldu.de>2025-11-18 21:56:06 +0100
commit2073aef795f74e5c24b7992d6c2f0fadde3fa271 (patch)
tree755f89cbe50260d375cbc255a46f5630f9670a1e /modules/remote-sycl/tests/data_ref.cpp
parent2116b46f784aa9bc0dcbb1b6bfc22183d979b919 (diff)
downloadforstio-forstio-2073aef795f74e5c24b7992d6c2f0fadde3fa271.tar.gz
Making ref work?
Diffstat (limited to 'modules/remote-sycl/tests/data_ref.cpp')
-rw-r--r--modules/remote-sycl/tests/data_ref.cpp13
1 files changed, 13 insertions, 0 deletions
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<sch::Array<sch::Float64>, encode::Sycl<encode::Native>> dat{{{100u}},sycl_q};
+
+ data<sch::Ref<sch::Array<sch::Float64>>, encode::Sycl<encode::Native>> 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<double>(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));
+ }
}
}