From 7095c698f5c5b7e960db9f9347501b8628f94dac Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Fri, 9 Oct 2026 13:24:17 +0200 Subject: Trying to fix things --- examples/throat_clog_2d/sim.cpp | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) (limited to 'examples/throat_clog_2d/sim.cpp') diff --git a/examples/throat_clog_2d/sim.cpp b/examples/throat_clog_2d/sim.cpp index 7fda532..b3b3cef 100644 --- a/examples/throat_clog_2d/sim.cpp +++ b/examples/throat_clog_2d/sim.cpp @@ -12,6 +12,7 @@ using namespace saw::schema; using LbmArgsStruct = Struct< Member + //,Member >; using LbmArgs = Args< @@ -80,7 +81,6 @@ saw::error_or lbm_main(const saw::data& args){ auto& sycl_q = dev.get_handle(); - sycl_q.wait(); { auto eov = init(conv,*lbm_data_ptr,*lbm_macro_data_ptr,*lbm_particle_data_ptr); if(eov.is_error()){ @@ -93,6 +93,7 @@ saw::error_or lbm_main(const saw::data& args){ return eov; } } + sycl_q.wait(); saw::data, encode::Sycl> lbm_sycl_data{sycl_q}; saw::data, encode::Sycl> lbm_sycl_macro_data{sycl_q}; @@ -215,13 +216,21 @@ saw::error_or k_main(int argc, char** argv){ auto& an = args.template get<"args">(); auto& coupling = an.template get<"coupling">(); - if(coupling.stl_view() == "hlbm"){ - return lbm_main(args); - } else if(coupling.stl_view() == "fplbm"){ - return lbm_main(args); - } else if(coupling.stl_view() == "psm"){ - return lbm_main(args); - } + auto resolution_resolve = [&](){ + lbm_main(args); + }; + + auto coupling_resolve = [&](){ + if(coupling.stl_view() == "hlbm"){ + return resolution_resolve.template operator()(); + } else if(coupling.stl_view() == "fplbm"){ + return resolution_resolve.template operator()(); + } else if(coupling.stl_view() == "psm"){ + return resolution_resolve.template operator()(); + } + }; + + coupling_resolve(); return saw::make_error("Invalid coupling"); } -- cgit v1.3.1