23 enum class DTTImpl :
u32 { REFERENCE, PARALLEL_SELECT, SCAN_MULTIPASS };
24 DTTImpl dtt_impl = DTTImpl::SCAN_MULTIPASS;
26 inline DTTImpl dtt_impl_from_params(
const std::string &
impl) {
27 if (
impl ==
"reference") {
28 return DTTImpl::REFERENCE;
29 }
else if (
impl ==
"parallel_select") {
30 return DTTImpl::PARALLEL_SELECT;
31 }
else if (
impl ==
"scan_multipass") {
32 return DTTImpl::SCAN_MULTIPASS;
35 "invalid implementation : {}, possible implementations : {}",
40 inline shamalgs::impl_param dtt_impl_to_params(
const DTTImpl &
impl) {
41 if (
impl == DTTImpl::REFERENCE) {
42 return {.impl_name =
"reference", .params =
""};
43 }
else if (
impl == DTTImpl::PARALLEL_SELECT) {
44 return {.impl_name =
"parallel_select", .params =
""};
45 }
else if (
impl == DTTImpl::SCAN_MULTIPASS) {
46 return {.impl_name =
"scan_multipass", .params =
""};
49 shambase::format(
"unknown dtt implementation : {}",
u32(
impl)));
53 std::vector<shamalgs::impl_param> impl_list{
54 {.impl_name =
"reference", .params =
""},
55 {.impl_name =
"parallel_select", .params =
""},
56 {.impl_name =
"scan_multipass", .params =
""}};
61 const std::string &
impl,
const std::string ¶m) {
62 shamlog_info_ln(
"tree",
"setting dtt implementation to impl :",
impl);
63 dtt_impl = dtt_impl_from_params(
impl);
67 return dtt_impl_to_params(dtt_impl);
70 template<
class Tmorton,
class Tvec, u32 dim>
72 sham::DeviceScheduler_ptr dev_sched,
74 shambase::VecComponent<Tvec> theta_crit,
76 bool allow_leaf_lowering) {
80 "BVH is empty, cannot perform DTT");
87 bool ord = ordered_result;
88 bool llow = allow_leaf_lowering;
91 case DTTImpl::REFERENCE :
return ImplRef::dtt(dev_sched, bvh, theta_crit, ord, llow);
92 case DTTImpl::PARALLEL_SELECT:
return ImplPar::dtt(dev_sched, bvh, theta_crit, ord, llow);
93 case DTTImpl::SCAN_MULTIPASS :
return ImplSca::dtt(dev_sched, bvh, theta_crit, ord, llow);
98 template DTTResult clbvh_dual_tree_traversal<u64, f64_3, 3>(
99 sham::DeviceScheduler_ptr dev_sched,
100 const CompressedLeafBVH<u64, f64_3, 3> &bvh,
101 shambase::VecComponent<f64_3> theta_crit,
103 bool allow_leaf_lowering);
105 template DTTResult clbvh_dual_tree_traversal<u32, f64_3, 3>(
106 sham::DeviceScheduler_ptr dev_sched,
107 const CompressedLeafBVH<u32, f64_3, 3> &bvh,
108 shambase::VecComponent<f64_3> theta_crit,
110 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.
std::uint32_t u32
32 bit unsigned integer
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.
void throw_unimplemented(SourceLocation loc=SourceLocation{})
Throw a std::runtime_error saying that the function is unimplemented.
namespace to control implementation behavior
void set_impl_clbvh_dual_tree_traversal(const std::string &impl, const std::string ¶m="")
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.