From afc0998f10882af12c136cbffee85f40573f2b40 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Wed, 25 Mar 2026 13:40:32 +0100 Subject: Moving to finally implementing particles on gpu --- examples/settling_cubes_2d_ibm_gpu/sim.cpp | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) (limited to 'examples/settling_cubes_2d_ibm_gpu/sim.cpp') diff --git a/examples/settling_cubes_2d_ibm_gpu/sim.cpp b/examples/settling_cubes_2d_ibm_gpu/sim.cpp index 05a4a09..bb6ab59 100644 --- a/examples/settling_cubes_2d_ibm_gpu/sim.cpp +++ b/examples/settling_cubes_2d_ibm_gpu/sim.cpp @@ -53,13 +53,19 @@ using MacroStruct = Struct< //using ParticleArray = Array< // Particle //>; + +template +using ParticleGroups = Tuple< + ParticleGroup< + T,Desc::D + > +>; } template saw::error_or setup_initial_conditions( saw::data>& fields, - saw::data>& macros, - saw::data, particle_amount>>& particles + saw::data>& macros ){ auto& info_f = fields.template get<"info">(); // Set everything as walls @@ -111,7 +117,6 @@ template saw::error_or step( saw::data>,encode::Sycl>& fields, saw::data>,encode::Sycl>& macros, - saw::data, particle_amount>>& particles, saw::data t_i, device& dev ){ @@ -119,10 +124,6 @@ saw::error_or step( auto& info_f = fields.template get<"info">(); { - auto& p = particles.at({{0u}}); - - auto& p_coll = p.template get<"collision">(); - auto& p_rad = p_coll.template get<"radius">(); } @@ -204,7 +205,6 @@ saw::error_or lbm_main(int argc, char** argv){ // saw::data> meta{{dim_x,dim_y}}; auto lbm_data_ptr = saw::heap>>(); auto lbm_macro_data_ptr = saw::heap>>(); - auto lbm_particle_data_ptr = saw::heap, particle_amount>>>(); std::cout<<"Estimated Bytes: "<,sch::MacroStruct>().get()< lbm_main(int argc, char** argv){ sycl_q.wait(); { - auto eov = setup_initial_conditions(*lbm_data_ptr,*lbm_macro_data_ptr,*lbm_particle_data_ptr); + auto eov = setup_initial_conditions(*lbm_data_ptr,*lbm_macro_data_ptr); if(eov.is_error()){ return eov; } @@ -244,7 +244,6 @@ saw::error_or lbm_main(int argc, char** argv){ saw::data, encode::Sycl> lbm_sycl_data{sycl_q}; saw::data, encode::Sycl> lbm_sycl_macro_data{sycl_q}; - saw::data, particle_amount>, encode::Sycl> lbm_sycl_particle_data{sycl_q}; sycl_q.wait(); auto lsd_view = make_chunk_struct_view(lbm_sycl_data); @@ -261,12 +260,6 @@ saw::error_or lbm_main(int argc, char** argv){ return eov; } } - { - auto eov = dev.copy_to_device(*lbm_particle_data_ptr,lbm_sycl_particle_data); - if(eov.is_error()){ - return eov; - } - } sycl_q.wait(); saw::data time_steps{16u*4096ul}; @@ -275,7 +268,7 @@ saw::error_or lbm_main(int argc, char** argv){ for(saw::data i{0u}; i < time_steps and krun; ++i){ // BC + Collision { - auto eov = step(lsd_view,lsdm_view,*lbm_particle_data_ptr,i,dev); + auto eov = step(lsd_view,lsdm_view,i,dev); if(eov.is_error()){ return eov; } -- cgit v1.2.3