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

Method do_record

imperative/src/impl/physical_tensor.cpp:108–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106 std::vector<CompNodeData> m_cndata;
107
108 auto do_record(CompNode cn, size_t cnid, std::unique_lock<std::mutex>& lock) {
109 // CAUSION: don't keep reference across locking boundary
110 lock.unlock();
111 auto e = EventPool::without_timer().alloc(cn);
112 e->record();
113 lock.lock();
114 auto& cndata = m_cndata[cnid];
115 //! add the event to the event map of compnodedata[cnid]
116 return cndata.events.emplace_hint(cndata.events.end(), cndata.next++, e);
117 }
118
119 // get a real event t' such that t <= t'
120 std::pair<uint64_t, CompNode::Event*> get_event(

Callers

nothing calls this directly

Calls 5

unlockMethod · 0.45
allocMethod · 0.45
recordMethod · 0.45
lockMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected