summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudius "keldu" Holeksa <mail@keldu.de>2024-01-28 16:03:29 +0100
committerClaudius "keldu" Holeksa <mail@keldu.de>2024-01-28 16:03:29 +0100
commit6f2cabfa4311eb71d70ec03a0a46b9ab55fd0820 (patch)
tree39401fc71ad2d804f10cf1c7296acb35e75dde59
parentae75e63bfaf927e10e9f2642b3a1a9dae04b7dbc (diff)
device-hip, remote-kokkos: Moving to kokkos. Easier to manage
-rw-r--r--modules/remote-kokkos/.nix/derivation.nix (renamed from modules/device-hip/.nix/derivation.nix)0
-rw-r--r--modules/remote-kokkos/SConstruct (renamed from modules/device-hip/SConstruct)0
-rw-r--r--modules/remote-kokkos/c++/SConscript (renamed from modules/device-hip/c++/SConscript)0
-rw-r--r--modules/remote-kokkos/c++/device.hpp14
-rw-r--r--modules/remote-kokkos/c++/remote.hpp48
-rw-r--r--modules/remote-kokkos/c++/rpc.hpp (renamed from modules/device-hip/c++/rpc.hpp)0
-rw-r--r--modules/remote-kokkos/tests/SConscript (renamed from modules/device-hip/tests/SConscript)0
7 files changed, 62 insertions, 0 deletions
diff --git a/modules/device-hip/.nix/derivation.nix b/modules/remote-kokkos/.nix/derivation.nix
index dc9cd94..dc9cd94 100644
--- a/modules/device-hip/.nix/derivation.nix
+++ b/modules/remote-kokkos/.nix/derivation.nix
diff --git a/modules/device-hip/SConstruct b/modules/remote-kokkos/SConstruct
index c5b2bb4..c5b2bb4 100644
--- a/modules/device-hip/SConstruct
+++ b/modules/remote-kokkos/SConstruct
diff --git a/modules/device-hip/c++/SConscript b/modules/remote-kokkos/c++/SConscript
index b66ce79..b66ce79 100644
--- a/modules/device-hip/c++/SConscript
+++ b/modules/remote-kokkos/c++/SConscript
diff --git a/modules/remote-kokkos/c++/device.hpp b/modules/remote-kokkos/c++/device.hpp
new file mode 100644
index 0000000..6c84fe1
--- /dev/null
+++ b/modules/remote-kokkos/c++/device.hpp
@@ -0,0 +1,14 @@
+#pragma once
+
+namespace saw {
+namespace dev {
+struct Hip {};
+}
+template<typename T>
+struct backend;
+
+struct backend<dev::Hip> {
+};
+
+
+}
diff --git a/modules/remote-kokkos/c++/remote.hpp b/modules/remote-kokkos/c++/remote.hpp
new file mode 100644
index 0000000..549b9ec
--- /dev/null
+++ b/modules/remote-kokkos/c++/remote.hpp
@@ -0,0 +1,48 @@
+#pragma once
+
+#include <Kokkos_Core.hpp>
+
+namespace saw {
+namespace rmt {
+struct Kokkos {};
+}
+
+template<typename T>
+struct remote;
+
+template<typename T>
+struct remote_ctx;
+
+template<>
+class remote_ctx<rmt::Kokkos> {
+private:
+ Kokkos::ScopeGuard guard_;
+
+ SAW_FORBID_COPY(remote_ctx);
+ SAW_FORBID_MOVE(remote_ctx);
+public:
+ remote_ctx(Kokkos::InitializationSettings init_settings):
+ guard_{std::move(init_settings)}
+ {}
+
+ error_or<void> create_remote(){
+ return remote<rmt::Kokkos>{*this};
+ }
+};
+
+template<>
+struct remote<rmt::Kokkos> {
+private:
+ remote_ctx<rmt::Kokkos>* ctx_;
+
+ SAW_FORBID_COPY(remote);
+ SAW_FORBID_MOVE(remote);
+public:
+ remote(remote_ctx<rmt::Kokkos>& r_ctx):
+ ctx_{&r_ctx}
+ {}
+
+ template<typename Iface>
+ error
+};
+}
diff --git a/modules/device-hip/c++/rpc.hpp b/modules/remote-kokkos/c++/rpc.hpp
index 5bce553..5bce553 100644
--- a/modules/device-hip/c++/rpc.hpp
+++ b/modules/remote-kokkos/c++/rpc.hpp
diff --git a/modules/device-hip/tests/SConscript b/modules/remote-kokkos/tests/SConscript
index f8ffc92..f8ffc92 100644
--- a/modules/device-hip/tests/SConscript
+++ b/modules/remote-kokkos/tests/SConscript