31 static constexpr std::string_view variant_type_name =
"reference";
36 static constexpr std::string_view variant_type_name =
"parallel_select";
41 static constexpr std::string_view variant_type_name =
"scan_multipass";
49 [](
const sham::DeviceScheduler_ptr &,
auto &self) {
58 template<
class Tmorton,
class Tvec, u32 dim>
60 sham::DeviceScheduler_ptr dev_sched,
62 shambase::VecComponent<Tvec> theta_crit,
64 bool allow_leaf_lowering) {
68 "BVH is empty, cannot perform DTT");
79 bool ord = ordered_result;
80 bool llow = allow_leaf_lowering;
85 return ImplRef::dtt(dev_sched, bvh, theta_crit, ord, llow);
88 return ImplPar::dtt(dev_sched, bvh, theta_crit, ord, llow);
91 return ImplSca::dtt(dev_sched, bvh, theta_crit, ord, llow);
97 template DTTResult clbvh_dual_tree_traversal<u64, f64_3, 3>(
98 sham::DeviceScheduler_ptr dev_sched,
99 const CompressedLeafBVH<u64, f64_3, 3> &bvh,
100 shambase::VecComponent<f64_3> theta_crit,
102 bool allow_leaf_lowering);
104 template DTTResult clbvh_dual_tree_traversal<u32, f64_3, 3>(
105 sham::DeviceScheduler_ptr dev_sched,
106 const CompressedLeafBVH<u32, f64_3, 3> &bvh,
107 shambase::VecComponent<f64_3> theta_crit,
109 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.
Name-keyed registry of the implementation selectors (IImplVariant) of every algorithm.
#define SHAMALGS_REGISTER_IMPL(name, impl)
Register the implementation selector impl under name at static initialization.
void autoselect_impl(std::string_view alg, const sham::DeviceScheduler_ptr &sched)
Select the default implementation of alg for the device behind sched.
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
shamalgs::ImplVariantGlobal< Reference, ParallelSelect, ScanMultipass > dtt_impl
Currently selected dual tree traversal implementation.
constexpr std::string_view dtt_impl_name
Registry name, shared by its registration and the dispatch site(s).
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.