30 static constexpr std::string_view variant_type_name =
"reference";
35 static constexpr std::string_view variant_type_name =
"parallel_select";
40 static constexpr std::string_view variant_type_name =
"scan_multipass";
45 [](
const sham::DeviceScheduler_ptr &,
auto &self) {
51 return dtt_impl.get_default_config_list();
56 return dtt_impl.get_current_config();
64 shamlog_info_ln(
"tree",
"setting dtt implementation to impl :",
impl);
73 "defaulting dtt implementation to impl :",
79 template<
class Tmorton,
class Tvec, u32 dim>
81 sham::DeviceScheduler_ptr dev_sched,
83 shambase::VecComponent<Tvec> theta_crit,
85 bool allow_leaf_lowering) {
89 "BVH is empty, cannot perform DTT");
100 bool ord = ordered_result;
101 bool llow = allow_leaf_lowering;
106 return ImplRef::dtt(dev_sched, bvh, theta_crit, ord, llow);
109 return ImplPar::dtt(dev_sched, bvh, theta_crit, ord, llow);
112 return ImplSca::dtt(dev_sched, bvh, theta_crit, ord, llow);
118 template DTTResult clbvh_dual_tree_traversal<u64, f64_3, 3>(
119 sham::DeviceScheduler_ptr dev_sched,
120 const CompressedLeafBVH<u64, f64_3, 3> &bvh,
121 shambase::VecComponent<f64_3> theta_crit,
123 bool allow_leaf_lowering);
125 template DTTResult clbvh_dual_tree_traversal<u32, f64_3, 3>(
126 sham::DeviceScheduler_ptr dev_sched,
127 const CompressedLeafBVH<u32, f64_3, 3> &bvh,
128 shambase::VecComponent<f64_3> theta_crit,
130 bool allow_leaf_lowering);
DTTResult clbvh_dual_tree_traversal(sham::DeviceScheduler_ptr dev_sched, const CompressedLeafBVH< Tmorton, Tvec, dim > &bvh, shambase::VecComponent< Tvec > theta_crit, bool ordered_result=false, bool allow_leaf_lowering=false)
Perform dual tree traversal on a compressed leaf bounding volume hierarchy.
Generic std::variant-based implementation selector.
Drop-in replacement for the hand-rolled "global variable + enum + name mapping.
A Compressed Leaf Bounding Volume Hierarchy (CLBVH) for neighborhood queries.
bool is_empty() const
is the BVH empty ?
This header file contains utility functions related to exception handling in the code.
ExcptTypes make_except_with_loc(std::string message, SourceLocation loc=SourceLocation{})
Create an exception with a message and a location.
namespace to control implementation behavior
bool is_impl_set_clbvh_dual_tree_traversal()
Check if an implementation has been selected for dual tree traversal.
shamalgs::ImplVariantGlobal< Reference, ParallelSelect, ScanMultipass > dtt_impl
Currently selected dual tree traversal implementation.
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.
Build an overload set out of several callables, for use with std::visit.
Result structure for dual tree traversal operations.
Parallel-select implementation of the dual tree traversal.
Naive reference CPU implementation of the dual tree traversal.
Scan-multipass implementation of the dual tree traversal.