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

Method GetEVAllocator

tensorflow/core/framework/allocator_registry.cc:141–163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

139}
140
141Allocator* AllocatorFactoryRegistry::GetEVAllocator() {
142 mutex_lock l(mu_);
143 first_alloc_made_ = true;
144 FactoryEntry* best_entry = nullptr;
145 for (auto& entry : factories_) {
146 if (best_entry == nullptr) {
147 best_entry = &entry;
148 } else if (entry.name == "EVAllocator") {
149 best_entry = &entry;
150 break;
151 }
152 }
153
154 if (best_entry) {
155 if (!best_entry->allocator) {
156 best_entry->allocator.reset(best_entry->factory->CreateEVAllocator());
157 }
158 return best_entry->allocator.get();
159 } else {
160 LOG(FATAL) << "No registered EV AllocatorFactory";
161 return nullptr;
162 }
163}
164
165Allocator* AllocatorFactoryRegistry::GetGPUEVAllocator() {
166 mutex_lock l(mu_);

Callers 1

ev_allocatorFunction · 0.80

Calls 3

resetMethod · 0.45
CreateEVAllocatorMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected