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

Method add_heuristic_tree

src/runtime/CL/mlgo/MLGOHeuristics.cpp:189–217  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

187}
188
189bool MLGOHeuristics::add_heuristic_tree(HeuristicTree &&t)
190{
191 if (_indices.size() >= _max_num_trees)
192 {
193 ARM_COMPUTE_LOG_INFO_MSG_WITH_FORMAT_CORE("Exceeding the max number of trees allowed: %zu", _max_num_trees);
194 return false;
195 }
196 // PRE: correctness of t is guaranteed by the tree construction process
197 // Ensure unique id
198 const auto id = t.id();
199 if (_indices.find(id) != _indices.end())
200 {
201 ARM_COMPUTE_LOG_INFO_MSG_WITH_FORMAT_CORE("Cannot add redundant trees; tree id %zu already exists", id);
202 return false;
203 }
204
205 // Ensure unique index
206 const auto index = t.index();
207 if (_trees.find(index) != _trees.end())
208 {
209 ARM_COMPUTE_LOG_INFO_MSG_CORE("Cannot add redundant trees; tree index already exists");
210 return false;
211 }
212
213 _indices[id] = index;
214 _trees[index] = std::move(t);
215 _tree_valid[id] = false;
216 return true;
217}
218
219bool MLGOHeuristics::reload_from_file(const std::string &filename)
220{

Callers 1

heuristics_table_entryFunction · 0.80

Calls 5

findMethod · 0.80
sizeMethod · 0.45
idMethod · 0.45
endMethod · 0.45
indexMethod · 0.45

Tested by

no test coverage detected