| 6 | using namespace cg; |
| 7 | |
| 8 | void VarDevMemDefragmenter::alloc_direct( |
| 9 | VarNode* var, DeviceTensorStorage& storage, size_t size) { |
| 10 | if (!storage.comp_node_valid()) |
| 11 | storage.comp_node(var->comp_node()); |
| 12 | if (size > storage.size()) { |
| 13 | m_mem_mgr->static_device_memory_manager()->allocator().alloc_dynamic( |
| 14 | var, storage, size); |
| 15 | storage.ptr(); // apply lazy alloc |
| 16 | } |
| 17 | mgb_assert(storage.size() >= size); |
| 18 | } |
| 19 | |
| 20 | #if MGB_ENABLE_VAR_DEV_MEM_DEFRAGMENTER |
| 21 |
nothing calls this directly
no test coverage detected