From 4bce6c96d0c49161b840796b277baab7972c0214 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Sun, 12 Oct 2025 15:42:56 +0200 Subject: Fixed and added Array for sycl --- modules/remote-sycl/c++/common.hpp | 1 + modules/remote-sycl/c++/data.hpp | 36 ++++++++++++++++++++++++++++++++++++ modules/remote-sycl/c++/remote.hpp | 4 ++-- 3 files changed, 39 insertions(+), 2 deletions(-) (limited to 'modules/remote-sycl/c++') diff --git a/modules/remote-sycl/c++/common.hpp b/modules/remote-sycl/c++/common.hpp index 3859dad..822dae5 100644 --- a/modules/remote-sycl/c++/common.hpp +++ b/modules/remote-sycl/c++/common.hpp @@ -2,6 +2,7 @@ #include #include +#include #include #include diff --git a/modules/remote-sycl/c++/data.hpp b/modules/remote-sycl/c++/data.hpp index 7763952..91f74f8 100644 --- a/modules/remote-sycl/c++/data.hpp +++ b/modules/remote-sycl/c++/data.hpp @@ -41,4 +41,40 @@ public: return data_.template get_access(h); } }; + +template +class data, encode::Sycl> { +public: + using Schema = schema::Array; +private: + cl::sycl::buffer> data_; + data size_; +public: + data(const data& host_data__): + data_{&host_data__.at({0u}),host_data__.size().get()}, + size_{host_data__.size()} + {} + + auto& get_handle() { + return data_; + } + + const auto& get_handle() const { + return data_; + } + + data size() const { + return size_; + } + + template + auto access(cl::sycl::handler& h){ + return data_.template get_access(h); + } + + template + auto access(cl::sycl::handler& h) const { + return data_.template get_access(h); + } +}; } diff --git a/modules/remote-sycl/c++/remote.hpp b/modules/remote-sycl/c++/remote.hpp index fd2f64a..65f645e 100644 --- a/modules/remote-sycl/c++/remote.hpp +++ b/modules/remote-sycl/c++/remote.hpp @@ -31,9 +31,9 @@ private: std::array data; template - static key_t create(const remote_address& addr){ + static key_t create(const remote_address& addr){ key_t k; - k.data = std::array{addr.get_address_id().get(), schema_hash::apply(), schema_hash::apply()}; + k.data = std::array{addr.get_device_id(), schema_hash::apply(), schema_hash::apply()}; return k; } -- cgit v1.2.3