diff options
author | Claudius "keldu" Holeksa <mail@keldu.de> | 2023-12-19 13:47:22 +0100 |
---|---|---|
committer | Claudius "keldu" Holeksa <mail@keldu.de> | 2023-12-19 13:47:42 +0100 |
commit | 9de31a58c0ba5d7045ee5a9e1436cb01906fc6de (patch) | |
tree | 29c63e7d51c2a16f3372e65e2f7ba6982d854cd9 /modules/device-hip/c++ | |
parent | 5caba5f17292941a62b527e3e6c492e919974049 (diff) |
codec, device-hip: Dangling things
Diffstat (limited to 'modules/device-hip/c++')
-rw-r--r-- | modules/device-hip/c++/SConscript | 38 | ||||
-rw-r--r-- | modules/device-hip/c++/rpc.h | 47 |
2 files changed, 85 insertions, 0 deletions
diff --git a/modules/device-hip/c++/SConscript b/modules/device-hip/c++/SConscript new file mode 100644 index 0000000..4ab02d6 --- /dev/null +++ b/modules/device-hip/c++/SConscript @@ -0,0 +1,38 @@ +#!/bin/false + +import os +import os.path +import glob + + +Import('env') + +dir_path = Dir('.').abspath + +# Environment for base library +dev_hip_env = env.Clone(); + +dev_hip_env.sources = sorted(glob.glob(dir_path + "/*.cpp")) +dev_hip_env.headers = sorted(glob.glob(dir_path + "/*.h")) + +env.sources += dev_hip_env.sources; +env.headers += dev_hip_env.headers; + +## Shared lib +objects_shared = [] +dev_hip_env.add_source_files(objects_shared, dev_hip_env.sources, shared=True); +dev_hip_env.library_shared = dev_hip_env.SharedLibrary('#build/forstio-device-hip', [objects_shared]); + +## Static lib +objects_static = [] +dev_hip_env.add_source_files(objects_static, dev_hip_env.sources, shared=False); +dev_hip_env.library_static = dev_hip_env.StaticLibrary('#build/forstio-device-hip', [objects_static]); + +# Set Alias +env.Alias('library_device-hip', [dev_hip_env.library_shared, dev_hip_env.library_static]); + +env.targets += ['library_device-hip']; + +# Install +env.Install('$prefix/lib/', [dev_hip_env.library_shared, dev_hip_env.library_static]); +env.Install('$prefix/include/forstio/device/hip/', [dev_hip_env.headers]); diff --git a/modules/device-hip/c++/rpc.h b/modules/device-hip/c++/rpc.h new file mode 100644 index 0000000..0bcda0c --- /dev/null +++ b/modules/device-hip/c++/rpc.h @@ -0,0 +1,47 @@ +#pragma once + +#include <hip.h> + +namespace saw { +namespace rmt { +struct DeviceHip {}; +} + +template<> +class remote<rmt::DeviceHip> { +private: +public: + template<typename Iface> + error_or<rpc_client<rmt::DeviceHip, Iface>> connect(){ + return make_error<err::not_implemented>(); + } +}; + +error_or<remote<rmt::DeviceHip>> create_remote(){ + auto rc = hipInit(0); + + return make_error<err::not_implemented>(); +} + +template<typename Iface> +class rpc_client<rmt::DeviceHip, Iface> { +public: + template<typename... T> + struct request { + std::tuple<id<T>...> ids; + + error_or<data<schema::Tuple<T...>>> wait(); + }; +}; + +template<typename Iface> +class rpc_server<rmt::DeviceHip, Iface> { +private: + /** + * Needs a variant ptr of all possible return types + */ + struct data_storage { + }; + +}; +} |