Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
BufferEventHandler.hpp
Go to the documentation of this file.
1// -------------------------------------------------------//
2//
3// SHAMROCK code for hydrodynamics
4// Copyright (c) 2021-2026 Timothée David--Cléris <tim.shamrock@proton.me>
5// SPDX-License-Identifier: CeCILL Free Software License Agreement v2.1
6// Shamrock is licensed under the CeCILL 2.1 License, see LICENSE for more information
7//
8// -------------------------------------------------------//
9
10#pragma once
11
19#include "shambase/string.hpp"
20#include "shambackends/sycl.hpp"
22
23namespace shamalgs {
24 u32 gen_buf_hash();
25
27 std::vector<sycl::event> event_last_read;
28 sycl::event event_last_write;
29
30 const u32 id_hash = gen_buf_hash();
31 inline u32 get_hash() { return id_hash; }
32 inline std::string get_hash_log() { return shambase::format("id = {} |", id_hash); }
33
34 bool up_to_date_events = true;
35
36 enum LastEvent { READ, READ_WRITE } last_event_create;
37
38 void add_read_dependancies(std::vector<sycl::event> &depends_list);
39
40 void add_read_write_dependancies(std::vector<sycl::event> &depends_list);
41
42 void register_read_event(const sycl::event &e);
43
44 void register_read_write_event(const sycl::event &e);
45
46 void synchronize();
47 };
48
49} // namespace shamalgs
std::uint32_t u32
32 bit unsigned integer
namespace to contain everything implemented by shamalgs
Definition algorithm.hpp:21