Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
Classes | Functions
KarrasRadixTree.hpp File Reference
#include "shambase/aliases_int.hpp"
#include "shambackends/DeviceBuffer.hpp"
#include "shambackends/DeviceScheduler.hpp"
#include "shamtree/KarrasTreeTraverser.hpp"
+ Include dependency graph for KarrasRadixTree.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  shamtree::KarrasRadixTree
 A data structure representing a Karras Radix Tree. More...
 

Functions

template<class Tmorton >
KarrasRadixTree shamtree::karras_tree_from_morton_set (sham::DeviceScheduler_ptr dev_sched, u32 morton_count, sham::DeviceBuffer< Tmorton > &morton_codes, KarrasRadixTree &&recycled_tree)
 Constructs a KarrasRadixTree from a set of reduced Morton codes.
 
template<class Tmorton >
KarrasRadixTree shamtree::karras_tree_from_morton_set (sham::DeviceScheduler_ptr dev_sched, u32 morton_count, sham::DeviceBuffer< Tmorton > &morton_codes)
 Constructs a KarrasRadixTree from a set of reduced Morton codes without reuse.
 
std::string shamtree::karras_tree_to_dot_graph (KarrasRadixTree &recycled_tree)
 Get tree as dot graph.
 

Detailed Description

Author
Timothée David–Cléris (tim.s.nosp@m.hamr.nosp@m.ock@p.nosp@m.roto.nosp@m.n.me)

Definition in file KarrasRadixTree.hpp.

Function Documentation

◆ karras_tree_from_morton_set() [1/2]

template<class Tmorton >
KarrasRadixTree shamtree::karras_tree_from_morton_set ( sham::DeviceScheduler_ptr  dev_sched,
u32  morton_count,
sham::DeviceBuffer< Tmorton > &  morton_codes 
)

Constructs a KarrasRadixTree from a set of reduced Morton codes without reuse.

Equivalent to karras_tree_from_morton_set but performs the allocations.

Template Parameters
TmortonThe type of the Morton codes.
Parameters
[in]dev_schedA pointer to the device scheduler used for managing execution on the device.
[in]morton_countThe number of Morton codes provided.
[in]morton_codesA device buffer containing the Morton codes.
Returns
A KarrasRadixTree object populated with the tree structure based on the provided Morton codes.

Definition at line 187 of file KarrasRadixTree.cpp.

+ Here is the call graph for this function:

◆ karras_tree_from_morton_set() [2/2]

template<class Tmorton >
KarrasRadixTree shamtree::karras_tree_from_morton_set ( sham::DeviceScheduler_ptr  dev_sched,
u32  morton_count,
sham::DeviceBuffer< Tmorton > &  morton_codes,
KarrasRadixTree &&  recycled_tree 
)

Constructs a KarrasRadixTree from a set of reduced Morton codes.

This function builds a KarrasRadixTree using the provided set of Morton codes. The tree is constructed by resizing the buffers for left and right child IDs, child flags, and end ranges to accommodate the internal cells, then executing the Karras algorithm on the device scheduler's queue.

Template Parameters
TmortonThe type of the Morton codes.
Parameters
[in]dev_schedA pointer to the device scheduler used for managing execution on the device.
[in]morton_countThe number of Morton codes provided.
[in]morton_codesA device buffer containing the Morton codes.
[in,out]recycled_treeA KarrasRadixTree object from which we will reuse the allocs.
Returns
A KarrasRadixTree object populated with the tree structure based on the provided Morton codes.

Definition at line 153 of file KarrasRadixTree.cpp.

+ Here is the call graph for this function:

◆ karras_tree_to_dot_graph()

std::string shamtree::karras_tree_to_dot_graph ( KarrasRadixTree recycled_tree)

Get tree as dot graph.

Definition at line 239 of file KarrasRadixTree.cpp.

+ Here is the call graph for this function: