summaryrefslogtreecommitdiff
path: root/modules/remote-sycl/c++/remote.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/remote-sycl/c++/remote.hpp')
-rw-r--r--modules/remote-sycl/c++/remote.hpp32
1 files changed, 24 insertions, 8 deletions
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<data<T,Encoding>> on_receive(); /// Stopped here
};
+
+template<typename T, uint64_t D>
+class data<schema::Array<T,D>, encode::Native<rmt::Sycl>> {
+private:
+ cl::sycl::buffer<typename native_data_type<T>::type, D> device_data_;
+
+ static_assert(D==1u, "For now we only support 1D Arrays");
+public:
+};
+
namespace impl {
template<typename Iface, typename Encoding>
@@ -53,8 +63,10 @@ struct rpc_id_map_helper<schema::Interface<Members...>, Encoding> {
*/
template<typename Iface, typename Encoding>
class rpc_server<Iface, Encoding, rmt::Sycl> {
+public:
+ using InterfaceCtxT = cl::sycl::queue*;
+ using InterfaceT = interface<Iface, Encoding, InterfaceCtxT>;
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<Iface, Encoding, IfaceCtx> cl_interface_;
+ interface<Iface, Encoding, InterfaceCtxT> cl_interface_;
/**
*
*/
impl::rpc_id_map_helper<Iface, Encoding> storage_;
public:
- rpc_server(interface<Iface, Encoding, IfaceCtx> cl_iface):
+ rpc_server(interface<Iface, Encoding, InterfaceCtxT> cl_iface):
cmd_queue_{},
cl_interface_{std::move(cl_iface)},
storage_{}
@@ -87,9 +99,9 @@ public:
template<string_literal Name>
error_or<
id<
- typename schema_member_type<Name, Iface>::type::ValueType::ResponseT
+ typename schema_member_type<Name, Iface>::type::ResponseT
>
- > call(data_or_id<typename schema_member_type<Name, Iface>::type::ValueType::RequestT, Encoding> input){
+ > call(data_or_id<typename schema_member_type<Name, Iface>::type::RequestT, Encoding> input){
auto eod = cl_interface_.template call<Name>(std::move(input), &cmd_queue_);
@@ -97,7 +109,9 @@ public:
return std::move(eod.get_error());
}
- return id<typename schema_member_type<Name, Iface>::type::ValueType::ResponseT>{};
+ // using ResponseTMap = id_map<data<>>
+
+ return id<typename schema_member_type<Name, Iface>::type::ResponseT>{};
}
};
@@ -139,8 +153,10 @@ public:
* Spin up a rpc server
*/
template<typename Iface, typename Encoding>
- conveyor<rpc_server<Iface, Encoding, rmt::Sycl>> listen(const remote_address<rmt::Sycl>&){
- return {};
+ rpc_server<Iface, Encoding, rmt::Sycl> listen(const remote_address<rmt::Sycl>&, typename rpc_server<Iface, Encoding, rmt::Sycl>::InterfaceT iface){
+ using RpcServerT = rpc_server<Iface, Encoding, rmt::Sycl>;
+ using InterfaceT = typename RpcServerT::InterfaceT;
+ return {std::move(iface)};
}
};