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#include <string>
25#include <vector>
26
27namespace shamtree {
28
30 struct DTTResult {
35
37 sham::DeviceBuffer<u32> offset_m2l;
38 sham::DeviceBuffer<u32> offset_p2p;
39 };
40
41 std::optional<OrderedResult> ordered_result;
42
43 bool is_ordered() const { return ordered_result.has_value(); }
44 };
45
57 template<class Tmorton, class Tvec, u32 dim>
58 DTTResult clbvh_dual_tree_traversal(
59 sham::DeviceScheduler_ptr dev_sched,
60 const CompressedLeafBVH<Tmorton, Tvec, dim> &bvh,
61 shambase::VecComponent<Tvec> theta_crit,
62 bool ordered_result = false,
63 bool allow_leaf_lowering = false);
64
66 namespace impl {
67
69 std::vector<std::string> get_default_impl_list_clbvh_dual_tree_traversal();
70
73
76
78 void set_impl_clbvh_dual_tree_traversal(const std::string &impl);
79
81 void autoselect_impl_clbvh_dual_tree_traversal(const sham::DeviceScheduler_ptr &dev_sched);
82
83 } // namespace impl
84
85} // namespace shamtree
A buffer allocated in USM (Unified Shared Memory).
namespace to control implementation behavior
bool is_impl_set_clbvh_dual_tree_traversal()
Check if an implementation has been selected for dual tree traversal.
void autoselect_impl_clbvh_dual_tree_traversal(const sham::DeviceScheduler_ptr &dev_sched)
Select the default implementation for dual tree traversal.
void set_impl_clbvh_dual_tree_traversal(const std::string &impl)
Set the implementation for dual tree traversal, from a config json string.
std::vector< std::string > get_default_impl_list_clbvh_dual_tree_traversal()
Get list of available dual tree traversal implementations, as config json strings.
std::string get_current_impl_clbvh_dual_tree_traversal_impl()
Get the current implementation for dual tree traversal, as a config json string.
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.