MCPcopy Create free account
hub / github.com/OAID/Tengine / FreeMem

Method FreeMem

driver/cpu/cpu_runner.cpp:690–723  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

688}
689
690bool CPURunner::FreeMem(Subgraph* sub_graph)
691{
692 std::vector<Node*>& seq_nodes = sub_graph->seq_nodes;
693
694 for(unsigned int i = 0; i < seq_nodes.size(); i++)
695 {
696 Node* node = seq_nodes[i];
697
698 for(unsigned int i = 0; i < node->GetOutputNum(); i++)
699 {
700 Tensor* tensor = node->GetOutputTensor(i);
701 free_tensor_mem(tensor);
702 }
703 }
704
705 if(sub_graph->ExistAttr("shared_temp_memory"))
706 {
707 void* mem_addr = any_cast<void*>(sub_graph->GetAttr("shared_temp_memory"));
708
709 mem_free(mem_addr);
710
711 sub_graph->RemoveAttr("shared_temp_memory");
712 }
713
714 if(sub_graph->ExistAttr("MemPool"))
715 {
716 MemPool* mem_pool = any_cast<MemPool*>(sub_graph->GetAttr("MemPool"));
717 delete mem_pool;
718
719 sub_graph->RemoveAttr("MemPool");
720 }
721
722 return true;
723}
724
725bool CPURunner::UnbindNodeOps(Subgraph* sub_graph)
726{

Callers

nothing calls this directly

Calls 7

free_tensor_memFunction · 0.85
RemoveAttrMethod · 0.80
sizeMethod · 0.45
GetOutputNumMethod · 0.45
GetOutputTensorMethod · 0.45
ExistAttrMethod · 0.45
GetAttrMethod · 0.45

Tested by

no test coverage detected