From 0a8dd2541e20f59812db21e8bad069b50cf8ebaf Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Fri, 23 Jan 2026 12:04:35 +0100 Subject: Preparing for SYCL accesors --- lib/core/c++/chunk.hpp | 14 +++++++++++--- lib/core/c++/flatten.hpp | 2 -- 2 files changed, 11 insertions(+), 5 deletions(-) (limited to 'lib/core/c++') diff --git a/lib/core/c++/chunk.hpp b/lib/core/c++/chunk.hpp index ad7de34..6b028ba 100644 --- a/lib/core/c++/chunk.hpp +++ b/lib/core/c++/chunk.hpp @@ -47,7 +47,7 @@ public: data& ghost_at(const data>& index){ return values_.at(index); } - + const data& ghost_at(const data>& index) const { return values_.at(index); } @@ -55,7 +55,7 @@ public: static constexpr auto get_ghost_dims() { return data::get_dims(); } - + data& at(const data>& index){ std::decay_t ind; for(uint64_t i = 0u; i < sizeof...(Sides); ++i){ @@ -63,7 +63,7 @@ public: } return values_.at(ind); } - + const data& at(const data>& index) const { std::decay_t ind; for(uint64_t i = 0u; i < sizeof...(Sides); ++i){ @@ -75,6 +75,14 @@ public: static constexpr auto get_dims(){ return data,Encode>{{Sides...}}; } + + auto flat_data(){ + return values_.flat_data(); + } + + static constexpr auto flat_size() { + return data::flat_size(); + } }; template diff --git a/lib/core/c++/flatten.hpp b/lib/core/c++/flatten.hpp index 164bb77..1609589 100644 --- a/lib/core/c++/flatten.hpp +++ b/lib/core/c++/flatten.hpp @@ -20,7 +20,6 @@ public: return 1u; } - private: /// 2,3,4 => 2,6,24 /// i + j * 2 + k * 3*2 @@ -35,7 +34,6 @@ private: public: static saw::data apply(const saw::data>& index, const saw::data>& meta){ saw::data flat_ind{0u}; - apply_i<0u>(flat_ind, index, meta); return flat_ind; } -- cgit v1.2.3