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

Method AddRef

driver/cpu/cpu_runner.cpp:192–204  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

190 }
191
192 void AddRef(Tensor* tensor)
193 {
194 void* addr = get_tensor_mem(tensor);
195
196 if(addr_map.count(addr) == 0)
197 return;
198
199 auto ir = addr_map.find(addr);
200
201 MemBlock* p_block = &block_list[ir->second];
202
203 p_block->ref_count += tensor->consumer.size() ? tensor->consumer.size() : 1;
204 }
205
206 void Free(Tensor* tensor)
207 {

Callers 1

AllocateMemMethod · 0.80

Calls 2

get_tensor_memFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected