cuda::experimental::stf::node_hierarchy#

class node_hierarchy#

Tree of integer offsets describing the hierarchy of stackable context nodes.

Every node is identified by an integer offset. The class maintains parent/child relationships and a free-list so that offsets can be reused after a sub-context is destroyed. The pool grows automatically using the provided growth factor when all slots are exhausted.

Public Functions

inline node_hierarchy(
int initial_size = default_initial_size,
size_t growth_num = default_growth_numerator,
size_t growth_den = default_growth_denominator
)#
inline void grow()#
inline int get_avail_entry()#
inline void discard_node(int offset)#

Return a node offset to the free-list so it can be reused.

inline void set_parent(int parent_offset, int child_offset)#
inline int get_parent(int offset) const#
inline const auto &get_children(int offset) const#
inline size_t depth(int offset) const#

Public Static Attributes

static constexpr int default_initial_size = 16#
static constexpr size_t default_growth_numerator = 3#
static constexpr size_t default_growth_denominator = 2#