MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / get

Method get

dnn/test/common/memory_manager.cpp:38–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36}
37
38megdnn::test::MemoryManager* megdnn::test::MemoryManagerHolder::get(Handle* handle) {
39 std::lock_guard<std::mutex> lock(m_map_mutex);
40 auto i = m_map.find(handle);
41 if (i != m_map.end()) {
42 // found
43 return i->second.get();
44 } else {
45 // not found. create it
46 auto mm = create_memory_manager_from_handle(handle);
47 auto res = mm.get();
48 m_map.emplace(std::make_pair(handle, std::move(mm)));
49 return res;
50 }
51}
52
53void MemoryManagerHolder::update(
54 Handle* handle, std::unique_ptr<MemoryManager> memory_manager) {

Callers 15

handle_atlasMethod · 0.45
handle_naiveMethod · 0.45
TEST_FFunction · 0.45
TEST_FFunction · 0.45
TEST_FFunction · 0.45
benchmark_implFunction · 0.45
TEST_FFunction · 0.45
benchmark_implFunction · 0.45
TEST_FFunction · 0.45
TEST_FFunction · 0.45
TEST_FFunction · 0.45
run_elemwise_benchmarkFunction · 0.45

Calls 4

findMethod · 0.45
endMethod · 0.45
emplaceMethod · 0.45

Tested by

no test coverage detected