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 : {}",
41 if (impl == DTTImpl::REFERENCE) {
42 return {
"reference",
""};
43 }
else if (impl == DTTImpl::PARALLEL_SELECT) {
44 return {
"parallel_select",
""};
45 }
else if (impl == DTTImpl::SCAN_MULTIPASS) {
46 return {
"scan_multipass",
""};
49 shambase::format(
"unknown dtt implementation : {}",
u32(impl)));
53 std::vector<shamalgs::impl_param> impl_list{
54 {
"reference",
""}, {
"parallel_select",
""}, {
"scan_multipass",
""}};
59 const std::string &impl,
const std::string ¶m) {
60 shamlog_info_ln(
"tree",
"setting dtt implementation to impl :", impl);
61 dtt_impl = dtt_impl_from_params(impl);
65 return dtt_impl_to_params(dtt_impl);
68 template<
class Tmorton,
class Tvec, u32 dim>
70 sham::DeviceScheduler_ptr dev_sched,
72 shambase::VecComponent<Tvec> theta_crit,
74 bool allow_leaf_lowering) {
78 "BVH is empty, cannot perform DTT");
85 bool ord = ordered_result;
86 bool llow = allow_leaf_lowering;
89 case DTTImpl::REFERENCE :
return ImplRef::dtt(dev_sched, bvh, theta_crit, ord, llow);
90 case DTTImpl::PARALLEL_SELECT:
return ImplPar::dtt(dev_sched, bvh, theta_crit, ord, llow);
91 case DTTImpl::SCAN_MULTIPASS :
return ImplSca::dtt(dev_sched, bvh, theta_crit, ord, llow);
96 template DTTResult clbvh_dual_tree_traversal<u64, f64_3, 3>(
97 sham::DeviceScheduler_ptr dev_sched,
98 const CompressedLeafBVH<u64, f64_3, 3> &bvh,
99 shambase::VecComponent<f64_3> theta_crit,
101 bool allow_leaf_lowering);
103 template DTTResult clbvh_dual_tree_traversal<u32, f64_3, 3>(
104 sham::DeviceScheduler_ptr dev_sched,
105 const CompressedLeafBVH<u32, f64_3, 3> &bvh,
106 shambase::VecComponent<f64_3> theta_crit,
108 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.
void throw_with_loc(std::string message, SourceLocation loc=SourceLocation{})
Throw an exception and append the source location to it.
void throw_unimplemented(SourceLocation loc=SourceLocation{})
Throw a std::runtime_error saying that the function is unimplemented.
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.