From 8be0ee7f948c52c1e71e2437bf6e15800daca47d Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Mon, 2 Mar 2026 21:11:15 +0100 Subject: Dangling --- examples/poiseulle_particles_2d_gpu/sim.cpp | 43 ++++++++++------------------- 1 file changed, 15 insertions(+), 28 deletions(-) (limited to 'examples') diff --git a/examples/poiseulle_particles_2d_gpu/sim.cpp b/examples/poiseulle_particles_2d_gpu/sim.cpp index 0f7c97b..4bc9dfb 100644 --- a/examples/poiseulle_particles_2d_gpu/sim.cpp +++ b/examples/poiseulle_particles_2d_gpu/sim.cpp @@ -220,9 +220,9 @@ saw::error_or step( [&](){ uint64_t target_t_i = 64u; if(t_i.get() < target_t_i){ - return 1.0 + (0.015 / target_t_i) * t_i.get(); + return 1.0 + (0.0015 / target_t_i) * t_i.get(); } - return 1.015; + return 1.0015; }() }; component,encode::Sycl> flow_out{1.0}; @@ -240,10 +240,16 @@ saw::error_or step( case 0u: break; case 1u: - // bb.apply(fields,index,t_i); + bb.apply(fields,index,t_i); break; case 2u: + flow_in.apply(fields,index,t_i); + collision.apply(fields,macros,index,t_i); + break; case 3u: + flow_out.apply(fields,index,t_i); + collision.apply(fields,macros,index,t_i); + break; case 4u: collision.apply(fields,macros,index,t_i); break; @@ -270,24 +276,6 @@ saw::error_or step( }); }).wait(); - q.submit([&](acpp::sycl::handler& h){ - h.parallel_for(acpp::sycl::range{dim_x,dim_y}, [=](acpp::sycl::id idx){ - switch(info.get()){ - case 1u: - bb.apply(fields,index,t_i); - break; - case 3u: - // equi.apply(fields,index,t_i); - flow_in.apply(fields,index,t_i); - break; - case 4u: - // equi.apply(fields,index,t_i); - flow_out.apply(fields,index,t_i); - break; - } - }); - }).wait(); - // Step /* q.submit([&](acpp::sycl::handler& h){ @@ -395,6 +383,12 @@ saw::error_or lbm_main(int argc, char** argv){ saw::data time_steps{4096ul}; for(saw::data i{0u}; i < time_steps and krun; ++i){ + { + auto eov = dev.copy_to_host(lbm_sycl_macro_data,*lbm_macro_data_ptr); + if(eov.is_error()){ + return eov; + } + } { { auto eov = write_vtk_file(out_dir,"t",i.get(), *lbm_macro_data_ptr); @@ -409,13 +403,6 @@ saw::error_or lbm_main(int argc, char** argv){ return eov; } } - { - auto eov = dev.copy_to_host(lbm_sycl_macro_data,*lbm_macro_data_ptr); - if(eov.is_error()){ - return eov; - } - } - wait.poll(); if(print_status){ std::cout<<"Status: "<().get() * 100 / time_steps.get())<<"%"<