summaryrefslogtreecommitdiff
path: root/modules/remote-sycl/c++/device.hpp
diff options
context:
space:
mode:
authorClaudius "keldu" Holeksa <mail@keldu.de>2024-06-26 09:39:34 +0200
committerClaudius "keldu" Holeksa <mail@keldu.de>2024-06-26 09:39:34 +0200
commit729307460e77f62a532ee9841dcaed9c47f46419 (patch)
tree0b52ddbfa47d9d148907de90e7a2987d72ed7d73 /modules/remote-sycl/c++/device.hpp
parent51b50882d2906b83c5275c732a56ff333ae6696f (diff)
Added better structure for the data server
Diffstat (limited to 'modules/remote-sycl/c++/device.hpp')
-rw-r--r--modules/remote-sycl/c++/device.hpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/modules/remote-sycl/c++/device.hpp b/modules/remote-sycl/c++/device.hpp
index 30eed2f..6d133ae 100644
--- a/modules/remote-sycl/c++/device.hpp
+++ b/modules/remote-sycl/c++/device.hpp
@@ -1,5 +1,43 @@
#pragma once
+#include "common.hpp"
+
namespace saw {
+/**
+ * Represents a remote Sycl device.
+ */
+template<>
+class device<rmt::Sycl> final {
+private:
+ cl::sycl::queue cmd_queue_;
+public:
+ device() = default;
+
+ SAW_FORBID_COPY(device);
+ SAW_FORBID_MOVE(device);
+
+ /**
+ * Copy data to device
+ */
+ template<typename Schema, typename Encoding, typename Storage>
+ error_or<data<Schema, Encoding, rmt::Sycl>> copy_to_device(const data<Schema, Encoding, Storage>& host_data){
+ return data<Schema, Encoding, rmt::Sycl>::copy_to_device(host_data, *this);
+ }
+
+ /**
+ * Copy data to host
+ */
+ template<typename Schema, typename Encoding, typename Storage>
+ error_or<data<Schema, Encoding, Storage>> copy_to_host(const data<Schema, Encoding, rmt::Sycl>& dev_data){
+ return dev_data.copy_to_host();
+ }
+
+ /**
+ * Get a reference to the handle
+ */
+ cl::sycl::queue& get_handle(){
+ return cmd_queue_;
+ }
+};
}