From 729307460e77f62a532ee9841dcaed9c47f46419 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Wed, 26 Jun 2024 09:39:34 +0200 Subject: Added better structure for the data server --- modules/remote-sycl/c++/device.hpp | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'modules/remote-sycl/c++/device.hpp') 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 final { +private: + cl::sycl::queue cmd_queue_; +public: + device() = default; + + SAW_FORBID_COPY(device); + SAW_FORBID_MOVE(device); + + /** + * Copy data to device + */ + template + error_or> copy_to_device(const data& host_data){ + return data::copy_to_device(host_data, *this); + } + + /** + * Copy data to host + */ + template + error_or> copy_to_host(const data& dev_data){ + return dev_data.copy_to_host(); + } + + /** + * Get a reference to the handle + */ + cl::sycl::queue& get_handle(){ + return cmd_queue_; + } +}; } -- cgit v1.2.3