MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / add_leaf

Method add_leaf

src/runtime/CL/mlgo/HeuristicTree.cpp:133–147  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

131
132template <typename T>
133bool HeuristicTree::add_leaf(NodeID id, T val)
134{
135 if (_tree.size() >= _max_num_nodes)
136 {
137 ARM_COMPUTE_LOG_INFO_MSG_WITH_FORMAT_CORE("Exceeding the maximum number of nodes allowed %zu", _max_num_nodes);
138 return false;
139 }
140 if (_tree.find(id) != _tree.end())
141 {
142 ARM_COMPUTE_LOG_INFO_MSG_WITH_FORMAT_CORE("Cannot add node; node id %zu already exists", id);
143 return false;
144 }
145 _tree[id] = std::make_unique<LeafNode<T>>(id, val);
146 return true;
147}
148
149bool HeuristicTree::add_branch(NodeID id, Condition cond, NodeID t_node, NodeID f_node)
150{

Callers 1

heuristic_treeFunction · 0.80

Calls 3

findMethod · 0.80
sizeMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected