summaryrefslogtreecommitdiff
path: root/modules/remote-sycl/c++/data.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/remote-sycl/c++/data.hpp')
-rw-r--r--modules/remote-sycl/c++/data.hpp36
1 files changed, 36 insertions, 0 deletions
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<AccessMode>(h);
}
};
+
+template<typename Sch, uint64_t Dim>
+class data<schema::Array<Sch, Dim>, encode::Sycl<encode::Native>> {
+public:
+ using Schema = schema::Array<Sch,Dim>;
+private:
+ cl::sycl::buffer<data<Sch, encode::Native>> data_;
+ data<schema::UInt64, encode::Native> size_;
+public:
+ data(const data<Schema, encode::Native>& 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<schema::UInt64, encode::Native> size() const {
+ return size_;
+ }
+
+ template<cl::sycl::access::mode AccessMode>
+ auto access(cl::sycl::handler& h){
+ return data_.template get_access<AccessMode>(h);
+ }
+
+ template<cl::sycl::access::mode AccessMode>
+ auto access(cl::sycl::handler& h) const {
+ return data_.template get_access<AccessMode>(h);
+ }
+};
}