MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / Clear

Method Clear

tensorflow/core/common_runtime/pool_allocator.cc:155–171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

153}
154
155void PoolAllocator::Clear() {
156 if (has_size_limit_) {
157 mutex_lock lock(mutex_);
158 for (auto iter : pool_) {
159 PtrRecord* pr = iter.second;
160 allocator_->Free(pr->ptr, pr->num_bytes);
161 delete pr;
162 }
163 pool_.clear();
164 get_from_pool_count_ = 0;
165 put_count_ = 0;
166 allocated_count_ = 0;
167 evicted_count_ = 0;
168 lru_head_ = nullptr;
169 lru_tail_ = nullptr;
170 }
171}
172
173void PoolAllocator::RemoveFromList(PtrRecord* pr) {
174 if (pr->prev == nullptr) {

Callers 6

ClearResourceMgrMethod · 0.45
ToGraphDefFunction · 0.45
TEST_FFunction · 0.45
ClearRunMetadataMethod · 0.45
SetShouldStoreGraphsMethod · 0.45
TESTFunction · 0.45

Calls 2

FreeMethod · 0.45
clearMethod · 0.45

Tested by 2

TEST_FFunction · 0.36
TESTFunction · 0.36