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
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
64 namespace impl {
65
67 std::vector<shamalgs::impl_param> get_default_impl_list_clbvh_dual_tree_traversal();
68
71
74 const std::string &impl, const std::string &param = "");
75
76 } // namespace impl
77
78} // namespace shamtree
A buffer allocated in USM (Unified Shared Memory)
void set_impl_clbvh_dual_tree_traversal(const std::string &impl, const std::string &param="")
Set the implementation for dual tree traversal.
shamalgs::impl_param get_current_impl_clbvh_dual_tree_traversal_impl()
Get the current implementation for dual tree traversal.
std::vector< shamalgs::impl_param > get_default_impl_list_clbvh_dual_tree_traversal()
Get list of available dual tree traversal implementations.
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.