MCPcopy Create free account
hub / github.com/alibaba/MNN / createDynamicBufferAlloctor

Method createDynamicBufferAlloctor

source/backend/cpu/CPUBackend.cpp:441–449  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

439 return true;
440}
441BufferAllocator* CPURuntime::createDynamicBufferAlloctor(int index) const {
442 if (hint().memoryAllocatorType == Runtime::Allocator_Defer) {
443 return new DeferBufferAllocator(buffer(index));
444 }
445 if (nullptr != mStaticAllocatorRaw.get()) {
446 return new EagerBufferAllocator(BufferAllocator::Allocator::createRecurse(mStaticAllocatorRaw.get()));
447 }
448 return new EagerBufferAllocator(BufferAllocator::Allocator::createRecurse(mStaticAllocator.get()));
449}
450CPUBackend::CPUBackend(const CPURuntime* runtime, BackendConfig::PrecisionMode precision, BackendConfig::MemoryMode memory, MNNForwardType type, size_t flags) : Backend(type) {
451#ifdef LOG_VERBOSE
452 MNN_PRINT("cpu backend create\n");

Callers 2

CPUBackendMethod · 0.80

Calls 2

bufferFunction · 0.50
getMethod · 0.45

Tested by

no test coverage detected