summaryrefslogtreecommitdiff
path: root/modules/remote-sycl/c++/device.hpp
diff options
context:
space:
mode:
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_;
+ }
+};
}