19template<
class Tvec,
class Tgr
idVec>
20void shammodels::zeus::modules::WriteBack<Tvec, TgridVec>::write_back_merged_data() {
24 using namespace shamrock::patch;
27 using Block =
typename Config::AMRBlock;
36 MergedPDat &mpdat = storage.merged_patchdata_ghost.get().get(p.id_patch);
42 PatchDataLayer &patch_dest = scheduler().patch_data.get_pdat(p.id_patch);
51 auto acc_eint_src = eint_merged.get_read_access(depends_list);
52 auto acc_vel_src = vel_merged.get_read_access(depends_list);
55 auto acc_eint_dest = eint_dest.get_write_access(depends_list);
56 auto acc_vel_dest = vel_dest.get_write_access(depends_list);
58 auto e = q.submit(depends_list, [&](sycl::handler &cgh) {
59 shambase::parallel_for(
60 cgh, mpdat.original_elements * Block::block_size,
"copy_back", [=](
u32 id) {
61 acc_rho_dest[id] = acc_rho_src[id];
62 acc_eint_dest[id] = acc_eint_src[id];
63 acc_vel_dest[id] = acc_vel_src[id];
68 eint_merged.complete_event_state(e);
69 vel_merged.complete_event_state(e);
72 eint_dest.complete_event_state(e);
73 vel_dest.complete_event_state(e);
75 if (mpdat.pdat.has_nan()) {
std::uint32_t u32
32 bit unsigned integer
A buffer allocated in USM (Unified Shared Memory).
void complete_event_state(sycl::event e) const
Complete the event state of the buffer.
T * get_write_access(sham::EventList &depends_list, SourceLocation src_loc=SourceLocation{})
Get a read-write pointer to the buffer's data.
const T * get_read_access(sham::EventList &depends_list, SourceLocation src_loc=SourceLocation{}) const
Get a read-only pointer to the buffer's data.
A SYCL queue associated with a device and a context.
Class to manage a list of SYCL events.
u32 get_field_idx(const std::string &field_name) const
Get the field id if matching name & type.
PatchDataLayer container class, the layout is described in patchdata_layout.
T & get_check_ref(const std::unique_ptr< T > &ptr, SourceLocation loc=SourceLocation())
Takes a std::unique_ptr and returns a reference to the object it holds. It throws a std::runtime_erro...
ExcptTypes make_except_with_loc(std::string message, SourceLocation loc=SourceLocation{})
Create an exception with a message and a location.
namespace for the main framework
void err_ln(std::string module_name, Types... var2)
Prints a log message with multiple arguments followed by a newline.
shambase::details::BasicStackEntry StackEntry
Alias for shambase::details::BasicStackEntry.
Patch object that contain generic patch information.