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

Method add_stream

src/core/impl/comp_node/mem_alloc/impl.cpp:286–292  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

284/* ===================== DevMemAllocImpl ===================== */
285
286StreamMemAlloc* DevMemAllocImpl::add_stream(StreamKey stream) {
287 MGB_LOCK_GUARD(m_mutex);
288 auto&& ptr = m_stream_alloc[stream];
289 if (!ptr)
290 ptr.reset(new StreamMemAllocImpl(this, m_stream_alloc.size() - 1));
291 return ptr.get();
292}
293
294MemAllocImplHelper::MemAddr DevMemAllocImpl::alloc(size_t size) {
295 auto addr = do_alloc(size, true);

Callers 4

TESTFunction · 0.45
initMethod · 0.45
initMethod · 0.45
initMethod · 0.45

Calls 3

resetMethod · 0.45
sizeMethod · 0.45
getMethod · 0.45

Tested by 1

TESTFunction · 0.36