diff options
author | Claudius "keldu" Holeksa <mail@keldu.de> | 2024-06-26 09:39:34 +0200 |
---|---|---|
committer | Claudius "keldu" Holeksa <mail@keldu.de> | 2024-06-26 09:39:34 +0200 |
commit | 729307460e77f62a532ee9841dcaed9c47f46419 (patch) | |
tree | 0b52ddbfa47d9d148907de90e7a2987d72ed7d73 /modules/remote-sycl/c++/data.hpp | |
parent | 51b50882d2906b83c5275c732a56ff333ae6696f (diff) |
Added better structure for the data server
Diffstat (limited to 'modules/remote-sycl/c++/data.hpp')
-rw-r--r-- | modules/remote-sycl/c++/data.hpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/modules/remote-sycl/c++/data.hpp b/modules/remote-sycl/c++/data.hpp index 7ecf1ae..3ad1d9c 100644 --- a/modules/remote-sycl/c++/data.hpp +++ b/modules/remote-sycl/c++/data.hpp @@ -4,4 +4,27 @@ namespace saw { +/** + * Generic wrapper class which stores data on the sycl side. + * Most of the times this will be a root object. + */ +template<typename Schema> +class data<Schema, encode::Native, rmt::Sycl> { +private: + cl::sycl::buffer<data<Schema, encode::Native, storage::Default>> data_; +public: + data(data<Schema, encode::Native, storage::Default>& data__): + data_{&data__, 1u} + {} + + auto& get_handle() { + return data_; + } + + template<cl::sycl::access::mode AccessMode> + auto access(cl::sycl::handler& h){ + return data_.template get_access<AccessMode>(h); + } +}; + } |