From 8bc7955f5d95521f7c932b9551a3b71a62117630 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Thu, 16 Jul 2026 21:49:56 +0200 Subject: Fixed stupid issue regarding device code --- .../moving_poiseulle_particles_2d_hlbm_gpu/sim.cpp | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'examples') diff --git a/examples/moving_poiseulle_particles_2d_hlbm_gpu/sim.cpp b/examples/moving_poiseulle_particles_2d_hlbm_gpu/sim.cpp index 749c951..a4cae03 100644 --- a/examples/moving_poiseulle_particles_2d_hlbm_gpu/sim.cpp +++ b/examples/moving_poiseulle_particles_2d_hlbm_gpu/sim.cpp @@ -13,7 +13,7 @@ namespace lbm { constexpr uint64_t dim_y = 256ul; constexpr uint64_t dim_x = dim_y * 20ul; -// constexpr uint64_t particle_amount = 1ul; +constexpr uint64_t particle_amount = 1ul; namespace sch { using namespace saw::schema; @@ -149,14 +149,13 @@ saw::error_or setup_initial_conditions( rad.at({}) = 2.0f; saw::data> dense; dense.at({}) = 1.0f; - particles = create_spheroid_particle_group(rad,dense,{16u}); + particles = create_spheroid_particle_group(rad,dense,{16u}); { auto& rb = particles.template get<"particles">().at({0u}).template get<"rigid_body">(); auto& rbp = rb.template get<"position">(); - rbp.at({0u}) = 0.25 * dim_x; - rbp.at({1u}) = 0.5 * dim_y; + rbp.at({{0u}}) = 0.25 * dim_x; + rbp.at({{1u}}) = 0.5 * dim_y; auto& rbp_old = rbp; - } return saw::make_void(); @@ -175,24 +174,22 @@ saw::error_or step( auto& porous_f = macros.template get<"porosity">(); q.submit([&](acpp::sycl::handler& h){ - component> hlbm_one_part; + component> hlbm_one_part; - h.parallel_for(acpp::sycl::range<1u>{1u}, [=](acpp::sycl::id<1u> idx){ + h.parallel_for(acpp::sycl::range<1u>{particle_amount}, [=](acpp::sycl::id<1u> idx){ saw::data> index; for(uint64_t i = 0u; i < 1u; ++i){ index.at({{i}}).set(idx[i]); } hlbm_one_part.apply(fields,macros,particles,index,t_i); - }); }).wait(); // auto coll_ev = q.submit([&](acpp::sycl::handler& h){ - component> collision{0.65}; + component> collision{0.8}; component> bb; - component,encode::Sycl> abb; component,encode::Sycl> flow_in{ [&](){ @@ -225,12 +222,10 @@ saw::error_or step( break; case 3u: flow_in.apply(fields,index,t_i); - // equi.apply(fields,index,t_i); collision.apply(fields,macros,index,t_i); break; case 4u: flow_out.apply(fields,index,t_i); - // equi.apply(fields,index,t_i); collision.apply(fields,macros,index,t_i); break; default: -- cgit v1.2.3