MCPcopy Create free account
hub / github.com/MegEngine/MegCC / malloc

Method malloc

compiler/test/kernel/common/src/memory_manager.cpp:18–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16 : MemoryManager(), m_handle(handle) {}
17
18void* megdnn::HandleMemoryManager::malloc(size_t size) {
19 auto comp_handle = m_handle->megcore_computing_handle();
20 megcoreDeviceHandle_t dev_handle;
21 megcore_check(megcoreGetDeviceHandle(comp_handle, &dev_handle));
22 void* ptr;
23 megcore_check(megcoreMalloc(dev_handle, &ptr, size));
24 return ptr;
25}
26
27void megdnn::HandleMemoryManager::free(void* ptr) {
28 auto comp_handle = m_handle->megcore_computing_handle();

Callers 7

megdnn_mallocMethod · 0.80
init_ins_weightsFunction · 0.80
init_model_weightsFunction · 0.80
init_model_memoryFunction · 0.80
alloc_device_tensorFunction · 0.80
alloc_tensor_optFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected