summaryrefslogtreecommitdiff
path: root/modules/remote-sycl
diff options
context:
space:
mode:
authorClaudius "keldu" Holeksa <mail@keldu.de>2025-08-30 19:02:15 +0200
committerClaudius "keldu" Holeksa <mail@keldu.de>2025-08-30 19:04:11 +0200
commita1583da62ea0f7e9affe868cd509557b5e91fae3 (patch)
tree5d5261d24c81f33f81a930bdfc42fe9904915d9e /modules/remote-sycl
parent6379fe9ca2cad3d0c9d886e7808b1d579ce349c2 (diff)
Fixing sycldev
Diffstat (limited to 'modules/remote-sycl')
-rw-r--r--modules/remote-sycl/.nix/derivation.nix11
-rw-r--r--modules/remote-sycl/c++/remote.hpp26
-rw-r--r--modules/remote-sycl/examples/sycl_basic.cpp4
3 files changed, 24 insertions, 17 deletions
diff --git a/modules/remote-sycl/.nix/derivation.nix b/modules/remote-sycl/.nix/derivation.nix
index 28e3cc8..33317eb 100644
--- a/modules/remote-sycl/.nix/derivation.nix
+++ b/modules/remote-sycl/.nix/derivation.nix
@@ -7,7 +7,7 @@
, openmp
, keldu
, ocl-icd
-, lld_15
+, lld_17
, python3
, bash
@@ -16,7 +16,12 @@
}:
let
-
+ adaptivecpp_custom = (import ((builtins.fetchGit {
+ url = "git@git.keldu.de:forstio/forstio";
+ ref = "dev";
+ }).outPath + "/default.nix"){
+ inherit stdenv;
+ });
in stdenv.mkDerivation {
pname = "forstio-remote-sycl";
inherit version;
@@ -38,7 +43,7 @@ in stdenv.mkDerivation {
keldu.adaptivecpp-dev
ocl-icd
openmp
- lld_15
+ lld_17
];
buildPhase = ''
diff --git a/modules/remote-sycl/c++/remote.hpp b/modules/remote-sycl/c++/remote.hpp
index a481740..fd2f64a 100644
--- a/modules/remote-sycl/c++/remote.hpp
+++ b/modules/remote-sycl/c++/remote.hpp
@@ -28,19 +28,21 @@ private:
SAW_FORBID_MOVE(remote);
struct key_t {
- uint64_t device_id;
- uint32_t sch_id;
- uint32_t enc_id;
-
+ std::array<uint64_t,3> data;
+
+ template<typename Schema, typename Encoding>
+ static key_t create(const remote_address<rmt::Loopback>& addr){
+ key_t k;
+ k.data = std::array<uint64_t,3>{addr.get_address_id().get(), schema_hash<Schema>::apply(), schema_hash<Encoding>::apply()};
+
+ return k;
+ }
+
bool operator<(const key_t& rhs) const {
- if(device_id != rhs.device_id){
- return device_id < rhs.device_id;
- }
- if(sch_id != rhs.sch_id){
- return sch_id < rhs.sch_id;
- }
- if(enc_id != rhs.enc_id){
- return enc_id < rhs.enc_id;
+ for(uint64_t i = 0u; i < 3; ++i){
+ if(data[i] != rhs.data[i]){
+ return data[i] < rhs.data[i];
+ }
}
return false;
}
diff --git a/modules/remote-sycl/examples/sycl_basic.cpp b/modules/remote-sycl/examples/sycl_basic.cpp
index 499ef2b..63d3713 100644
--- a/modules/remote-sycl/examples/sycl_basic.cpp
+++ b/modules/remote-sycl/examples/sycl_basic.cpp
@@ -36,7 +36,7 @@ int main(){
id_zero = eov.get_value();
}
{
- auto rmt_data = rpc_server.request_data<schema::Array<schema::UInt64>>(id_zero);
+ auto rmt_data = rpc_server.template request_data<schema::Array<schema::UInt64>>(id_zero);
auto eo_rd = rmt_data.wait();
if(eo_rd.is_error()){
auto& err = eo_rd.get_error();
@@ -62,7 +62,7 @@ int main(){
id_one = eov.get_value();
}
{
- auto rmt_data = rpc_server.request_data<schema::Array<schema::UInt64>>(id_one);
+ auto rmt_data = rpc_server.template request_data<schema::Array<schema::UInt64>>(id_one);
auto eo_rd = rmt_data.wait();
if(eo_rd.is_error()){
auto& err = eo_rd.get_error();