Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
AMRStencilCache.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
20#include "shambackends/sycl.hpp"
23
25
27
28 using cell_stencil_el_buf = std::unique_ptr<sycl::buffer<amr::cell::StencilElement>>;
29
31 std::unordered_map<u32, dd_cell_stencil_el_buf> storage;
32
33 void insert_data(u32 map_id, dd_cell_stencil_el_buf &&stencil_element) {
34 storage.emplace(map_id, std::forward<dd_cell_stencil_el_buf>(stencil_element));
35 }
36
37 sycl::buffer<amr::cell::StencilElement> &get_stencil_element(u64 patch_id, u32 map_id) {
38 return shambase::get_check_ref(storage.at(map_id).get(patch_id));
39 }
40 };
41
42} // namespace shammodels::basegodunov
utility to manipulate AMR blocks
utility to manipulate AMR blocks
std::uint32_t u32
32 bit unsigned integer
std::uint64_t u64
64 bit unsigned integer
Represents a collection of objects distributed across patches identified by a u64 id.
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...
Definition memory.hpp:110
namespace for the basegodunov model