From 97ec4b9edfa88302878b523baf09674503d19fab Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Wed, 22 May 2024 17:22:18 +0200 Subject: Progress in fixing remote-sycl and ammended minor parts in echo_client --- modules/remote-sycl/c++/remote.hpp | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) (limited to 'modules/remote-sycl/c++/remote.hpp') diff --git a/modules/remote-sycl/c++/remote.hpp b/modules/remote-sycl/c++/remote.hpp index 86799b6..d4b114a 100644 --- a/modules/remote-sycl/c++/remote.hpp +++ b/modules/remote-sycl/c++/remote.hpp @@ -36,6 +36,16 @@ public: */ conveyor> on_receive(); /// Stopped here }; + +template +class data, encode::Native> { +private: + cl::sycl::buffer::type, D> device_data_; + + static_assert(D==1u, "For now we only support 1D Arrays"); +public: +}; + namespace impl { template @@ -53,8 +63,10 @@ struct rpc_id_map_helper, Encoding> { */ template class rpc_server { +public: + using InterfaceCtxT = cl::sycl::queue*; + using InterfaceT = interface; private: - using IfaceCtx = cl::sycl::queue*; /** * Command queue for the sycl backend */ @@ -63,14 +75,14 @@ private: /** * The interface including the relevant context class. */ - interface cl_interface_; + interface cl_interface_; /** * */ impl::rpc_id_map_helper storage_; public: - rpc_server(interface cl_iface): + rpc_server(interface cl_iface): cmd_queue_{}, cl_interface_{std::move(cl_iface)}, storage_{} @@ -87,9 +99,9 @@ public: template error_or< id< - typename schema_member_type::type::ValueType::ResponseT + typename schema_member_type::type::ResponseT > - > call(data_or_id::type::ValueType::RequestT, Encoding> input){ + > call(data_or_id::type::RequestT, Encoding> input){ auto eod = cl_interface_.template call(std::move(input), &cmd_queue_); @@ -97,7 +109,9 @@ public: return std::move(eod.get_error()); } - return id::type::ValueType::ResponseT>{}; + // using ResponseTMap = id_map> + + return id::type::ResponseT>{}; } }; @@ -139,8 +153,10 @@ public: * Spin up a rpc server */ template - conveyor> listen(const remote_address&){ - return {}; + rpc_server listen(const remote_address&, typename rpc_server::InterfaceT iface){ + using RpcServerT = rpc_server; + using InterfaceT = typename RpcServerT::InterfaceT; + return {std::move(iface)}; } }; -- cgit v1.2.3