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

Method get_lut_table

src/core/helpers/LUTManager.cpp:138–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

136
137template <typename T>
138std::shared_ptr<T> LUTManager::get_lut_table(LUTInfo info)
139{
140 auto &map = get_map<T>();
141 const auto itr = map.find(info);
142 auto s_ptr = (itr != map.end()) ? itr->second.lock() : nullptr; // nullptr if invalid or not found.
143 if (s_ptr != nullptr)
144 {
145 // Found and valid
146 return s_ptr; // Return weak ptr as shared ptr
147 }
148 else
149 {
150 // Not found, or pointer not valid
151 // We do not use make_shared to prevent the weak_ptr keeping the control block alive
152 std::shared_ptr<T> ptr(new T);
153 init_lut(*ptr, info);
154 map[info] = ptr;
155 return ptr;
156 }
157}
158
159template std::shared_ptr<LookupTable256> LUTManager::get_lut_table<LookupTable256>(LUTInfo info);
160template std::shared_ptr<LookupTable65536> LUTManager::get_lut_table<LookupTable65536>(LUTInfo info);

Callers

nothing calls this directly

Calls 4

findMethod · 0.80
init_lutFunction · 0.70
endMethod · 0.45
lockMethod · 0.45

Tested by

no test coverage detected