From da7878360b0b4c58af922b491f5d775a867b191a Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Mon, 19 Jan 2026 17:10:19 +0100 Subject: Moving the ghost layers --- default.nix | 2 +- lib/core/c++/chunk.hpp | 3 +++ lib/sycl/c++/data.hpp | 25 +++++++++++++++---------- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/default.nix b/default.nix index 1befac1..b41c5a8 100644 --- a/default.nix +++ b/default.nix @@ -39,7 +39,7 @@ let forstio = (import ((builtins.fetchTarball { url = "https://git.keldu.de/forstio-forstio/snapshot/master.tar.gz"; - sha256 = "sha256:19050mb1j4qq9j9y24y0ffhlj997bzn4my2wiprsgml58azf600m"; + sha256 = "sha256:1l305m2vsm4vxflip9ij9f8q7qbiy85k06kwqi7jwm0b1j23jrin"; }) + "/default.nix"){ inherit stdenv; inherit clang-tools; diff --git a/lib/core/c++/chunk.hpp b/lib/core/c++/chunk.hpp index bfef358..38b567b 100644 --- a/lib/core/c++/chunk.hpp +++ b/lib/core/c++/chunk.hpp @@ -32,7 +32,10 @@ using SuperChunk = Array; namespace saw { template class data,Encode> final { +public: + using Schema = kel::lbm::sch::Chunk; private: + data public: }; } diff --git a/lib/sycl/c++/data.hpp b/lib/sycl/c++/data.hpp index 67422e2..53a35bc 100644 --- a/lib/sycl/c++/data.hpp +++ b/lib/sycl/c++/data.hpp @@ -12,7 +12,7 @@ struct Sycl { namespace impl { template -struct struct_has_only_equal_dimension_array +struct struct_has_only_equal_dimension_array{}; } } } @@ -37,9 +37,14 @@ public: q_{nullptr} {} + data(StorageT members__, kel::lbm::sycl::queue& q__): + members_{members__}, + q_{&q__} + {} + ~data(){ SAW_ASSERT(q_){ - exit(-1); + return; } std::visit([this](auto arg){ if(not arg){ @@ -61,14 +66,8 @@ public: SAW_ASSERT(ptr); return *ptr; } - - void set_queue(kel::lbm::sycl::queue& q){ - q_ = &q; - } }; -} - namespace kel { namespace lbm { namespace impl { @@ -80,9 +79,11 @@ struct sycl_malloc_struct_helper, Encode> final { template static saw::error_or allocate_on_device_member(typename data>::StorageT& storage, sycl::queue& q){ if constexpr (i < sizeof...(Members)){ + using M = typename saw::parameter_pack_type::type; auto& ptr = std::get(storage); + ptr = sycl::malloc_device(,q); - return allocate_on_device_member(sycl_data,q); + return allocate_on_device_member(storage,q); } return saw::make_void(); @@ -90,7 +91,11 @@ struct sycl_malloc_struct_helper, Encode> final { static saw::error_or allocate_on_device(data>& sycl_data, sycl::queue& q){ typename data>::StorageT storage; - return allocate_on_device_member<0u>(storage,q); + + auto eov = allocate_on_device_member<0u>(storage,q); + sycl_data = {storage, q}; + + return eov; } }; } -- cgit v1.2.3