25#include <pybind11/complex.h>
27template<
class Tmorton,
class Tvec, u32 dim>
28inline void register_CLBVH(py::module &m,
const char *class_name) {
33 py::class_<CLBVH>(m, class_name)
35 return std::make_unique<CLBVH>(
36 CLBVH::make_empty(shamsys::instance::get_compute_scheduler_ptr()));
39 "rebuild_from_positions",
43 u32 compression_level) {
44 self.rebuild_from_positions(positions, bounding_box, compression_level);
47 "get_leaf_cell_count",
49 return self.get_leaf_cell_count();
52 "get_internal_cell_count",
54 return self.get_internal_cell_count();
56 .def(
"get_total_cell_count", [](CLBVH &self) {
57 return self.get_total_cell_count();
61template<
class Tmorton,
class Tvec, u32 dim>
62inline void register_dtt_alg(py::module &m) {
63 py::class_<shamtree::DTTResult>(m,
"DTTResult").def(py::init([]() {
70 "clbvh_dual_tree_traversal",
72 shambase::VecComponent<Tvec> theta_crit,
73 bool ordered_result) {
75 shamsys::instance::get_compute_scheduler_ptr(), bvh, theta_crit, ordered_result);
79 "benchmark_clbvh_dual_tree_traversal",
81 shambase::VecComponent<Tvec> theta_crit,
82 bool ordered_result) {
86 shamsys::instance::get_compute_scheduler_ptr(), bvh, theta_crit, ordered_result);
91 m.def(
"get_default_impl_list_clbvh_dual_tree_traversal", []() {
96 "set_impl_clbvh_dual_tree_traversal",
97 [](
const std::string &impl,
const std::string ¶m =
"") {
101 m.def(
"get_current_impl_clbvh_dual_tree_traversal_impl", []() {
108 py::module shamtree_module = m.def_submodule(
"tree",
"backend library");
110 register_CLBVH<u64, f64_3, 3>(shamtree_module,
"CLBVH_u64_f64_3");
111 register_dtt_alg<u64, f64_3, 3>(shamtree_module);
Dual tree traversal algorithm for Compressed Leaf Bounding Volume Hierarchies.
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.
Header file describing a Node Instance.
std::uint32_t u32
32 bit unsigned integer
A buffer allocated in USM (Unified Shared Memory)
Class Timer measures the time elapsed since the timer was started.
void end()
Stops the timer and stores the elapsed time in nanoseconds.
f64 elasped_sec() const
Converts the stored nanosecond time to a floating point representation in seconds.
void start()
Starts the timer.
A Compressed Leaf Bounding Volume Hierarchy (CLBVH) for neighborhood queries.
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.
Pybind11 include and definitions.
#define Register_pymod(placeholdername)
Register a python module init function using static initialisation.
void debug_ln(std::string module_name, Types... var2)
Prints a log message with multiple arguments followed by a newline.
Axis-Aligned bounding box.
Result structure for dual tree traversal operations.