diff options
| author | Claudius "keldu" Holeksa <mail@keldu.de> | 2025-11-18 21:56:06 +0100 |
|---|---|---|
| committer | Claudius "keldu" Holeksa <mail@keldu.de> | 2025-11-18 21:56:06 +0100 |
| commit | 2073aef795f74e5c24b7992d6c2f0fadde3fa271 (patch) | |
| tree | 755f89cbe50260d375cbc255a46f5630f9670a1e /modules/remote-sycl/c++ | |
| parent | 2116b46f784aa9bc0dcbb1b6bfc22183d979b919 (diff) | |
| download | forstio-forstio-2073aef795f74e5c24b7992d6c2f0fadde3fa271.tar.gz | |
Making ref work?
Diffstat (limited to 'modules/remote-sycl/c++')
| -rw-r--r-- | modules/remote-sycl/c++/data.hpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/modules/remote-sycl/c++/data.hpp b/modules/remote-sycl/c++/data.hpp index 149e3f2..763e4c3 100644 --- a/modules/remote-sycl/c++/data.hpp +++ b/modules/remote-sycl/c++/data.hpp @@ -50,7 +50,7 @@ public: data_{size_.get(),sycl_alloc_} {} - auto* get_internal_data() { + data<Sch,Encode>* get_internal_data() { if(data_.empty()){ return nullptr; } @@ -135,11 +135,23 @@ private: public: data() = delete; - data(ref<data<schema::FixedArray<schema::UInt64, Dim>, Encode>> ref_data__): + data(ref<data<schema::Array<Sch, Dim>, encode::Sycl<Encode>>> ref_data__): internal_data_ptr_{ref_data__().get_internal_data()}, dims_{ref_data__().dims()}, size_{ref_data__().size()} {} + + auto* get_internal_data() { + return internal_data_ptr_; + } + + constexpr data<Sch, Encode>& at(const data<schema::FixedArray<schema::UInt64, Dim>, Encode>& i){ + return internal_data_ptr_[this->get_flat_index(i)]; + } + + constexpr const data<Sch, Encode>& at(const data<schema::FixedArray<schema::UInt64, Dim>, Encode>& i)const{ + return internal_data_ptr_[this->get_flat_index(i)]; + } private: template<typename U> uint64_t get_flat_index(const U& i) const { |
