Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
CLBVHDualTreeTraversal.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
22#include "shambackends/vec.hpp"
24
25namespace shamtree {
26
28 struct DTTResult {
33
35 sham::DeviceBuffer<u32> offset_m2l;
36 sham::DeviceBuffer<u32> offset_p2p;
37 };
38
39 std::optional<OrderedResult> ordered_result;
40
41 bool is_ordered() const { return ordered_result.has_value(); }
42 };
43
55 template<class Tmorton, class Tvec, u32 dim>
56 DTTResult clbvh_dual_tree_traversal(
57 sham::DeviceScheduler_ptr dev_sched,
58 const CompressedLeafBVH<Tmorton, Tvec, dim> &bvh,
59 shambase::VecComponent<Tvec> theta_crit,
60 bool ordered_result = false,
61 bool allow_leaf_lowering = false);
62
63} // namespace shamtree
A buffer allocated in USM (Unified Shared Memory).
Result structure for dual tree traversal operations.
sham::DeviceBuffer< u32_2 > node_interactions_m2l
Pairs of nodes that interact using M2L interactions.
sham::DeviceBuffer< u32_2 > node_interactions_p2p
Pairs of nodes that interact using P2P interactions.