From e60db388693b63be6d7e4c03234976b567378e94 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Wed, 21 Jan 2026 17:20:08 +0100 Subject: Fixing compilation errors --- lib/sycl/c++/SConscript | 9 ++------- lib/sycl/c++/data.hpp | 25 ++++++++++++++----------- lib/sycl/c++/lbm.hpp | 3 +++ 3 files changed, 19 insertions(+), 18 deletions(-) create mode 100644 lib/sycl/c++/lbm.hpp (limited to 'lib/sycl/c++') diff --git a/lib/sycl/c++/SConscript b/lib/sycl/c++/SConscript index 85a078f..2ed63ba 100644 --- a/lib/sycl/c++/SConscript +++ b/lib/sycl/c++/SConscript @@ -15,18 +15,13 @@ core_env = env.Clone(); core_env.sources = sorted(glob.glob(dir_path + "/*.cpp")); core_env.headers = sorted(glob.glob(dir_path + "/*.hpp")); -core_env.particle_headers = sorted(glob.glob(dir_path + "/particle/*.hpp")); -core_env.particle_geometry_headers = sorted(glob.glob(dir_path + "/particle/geometry/*.hpp")); - env.sources += core_env.sources; env.headers += core_env.headers; ## Static lib objects = [] core_env.add_source_files(objects, core_env.sources, shared=False); -env.library_static = core_env.StaticLibrary('#build/kel-lbm', [objects]); +env.library_static = core_env.StaticLibrary('#build/kel-lbm-sycl', [objects]); env.Install('$prefix/lib/', env.library_static); -env.Install('$prefix/include/kel/lbm/', core_env.headers); -env.Install('$prefix/include/kel/lbm/particle/', core_env.particle_headers); -env.Install('$prefix/include/kel/lbm/particle/geometry/', core_env.particle_geometry_headers); +env.Install('$prefix/include/kel/lbm/sycl/', core_env.headers); diff --git a/lib/sycl/c++/data.hpp b/lib/sycl/c++/data.hpp index 44bc5dc..bb8b4bf 100644 --- a/lib/sycl/c++/data.hpp +++ b/lib/sycl/c++/data.hpp @@ -1,6 +1,7 @@ #pragma once #include "common.hpp" +#include namespace kel { namespace lbm { @@ -19,9 +20,9 @@ struct struct_has_only_equal_dimension_array{}; namespace saw { template -class data, Keys>...>, kel::lbm::encode::Sycl> final { +class data, Keys>...>, kel::lbm::encode::Sycl > final { public: - static constexpr data> meta = {{Meta...}}; using StorageT = std::tuple*...>; private: @@ -50,14 +51,14 @@ public: if(not arg){ return; } - sycl::free(arg,*q_); + acpp::sycl::free(arg,*q_); arg = nullptr; },members_); } template auto* get_ptr(){ - return std::get::value(members_); + return std::get::value>(members_); } template @@ -67,6 +68,7 @@ public: return *ptr; } }; +} namespace kel { namespace lbm { @@ -76,14 +78,15 @@ struct sycl_malloc_struct_helper; template struct sycl_malloc_struct_helper, Encode> final { + using Schema = sch::Struct; + template - static saw::error_or allocate_on_device_member(typename data>::StorageT& storage, sycl::queue& q){ + static saw::error_or allocate_on_device_member(typename saw::data::type::ValueType,encode::Sycl>::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); + ptr = sycl::malloc_device(1u,q); return allocate_on_device_member(storage,q); } @@ -91,8 +94,8 @@ struct sycl_malloc_struct_helper, Encode> final { return saw::make_void(); } - static saw::error_or allocate_on_device(data>& sycl_data, sycl::queue& q){ - typename data>::StorageT storage; + static saw::error_or allocate_on_device(saw::data>& sycl_data, sycl::queue& q){ + typename saw::data>::StorageT storage; auto eov = allocate_on_device_member<0u>(storage,q); sycl_data = {storage, q}; @@ -112,8 +115,8 @@ public: ~device() = default; template - saw::error_or allocate_on_device(data>& sycl_data){ - auto eov = sycl_malloc_struct_helper::allocate_on_device(sycl_data, q_); + saw::error_or allocate_on_device(saw::data>& sycl_data){ + auto eov = impl::sycl_malloc_struct_helper::allocate_on_device(sycl_data, q_); if(eov.is_error()){ return eov; } diff --git a/lib/sycl/c++/lbm.hpp b/lib/sycl/c++/lbm.hpp new file mode 100644 index 0000000..3e67ae6 --- /dev/null +++ b/lib/sycl/c++/lbm.hpp @@ -0,0 +1,3 @@ +#pragma once + +#include "data.hpp" -- cgit v1.2.3