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([]() {
65 .node_interactions_m2l
67 .node_interactions_p2p
72 "clbvh_dual_tree_traversal",
74 shambase::VecComponent<Tvec> theta_crit,
75 bool ordered_result) {
77 shamsys::instance::get_compute_scheduler_ptr(), bvh, theta_crit, ordered_result);
81 "benchmark_clbvh_dual_tree_traversal",
83 shambase::VecComponent<Tvec> theta_crit,
84 bool ordered_result) {
88 shamsys::instance::get_compute_scheduler_ptr(), bvh, theta_crit, ordered_result);
93 m.def(
"get_default_impl_list_clbvh_dual_tree_traversal", []() {
98 "set_impl_clbvh_dual_tree_traversal",
99 [](
const std::string &impl,
const std::string ¶m =
"") {
103 m.def(
"get_current_impl_clbvh_dual_tree_traversal_impl", []() {
110 py::module shamtree_module = root_module.def_submodule(
"tree",
"backend library");
112 register_CLBVH<u64, f64_3, 3>(shamtree_module,
"CLBVH_u64_f64_3");
113 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.
f64 elapsed_sec() const
Converts the stored nanosecond time to a floating point representation in seconds.
void start()
Starts the timer.
void stop()
Stops the timer and stores the elapsed time in nanoseconds.
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 ON_PYTHON_INIT
Register a Python module init function using static initialization.
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.