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

Method GetAllocator

tensorflow/core/framework/allocator_registry.cc:71–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69}
70
71Allocator* AllocatorFactoryRegistry::GetAllocator() {
72 mutex_lock l(mu_);
73 first_alloc_made_ = true;
74 FactoryEntry* best_entry = nullptr;
75 for (auto& entry : factories_) {
76 if (best_entry == nullptr) {
77 best_entry = &entry;
78 } else if (entry.priority > best_entry->priority) {
79 best_entry = &entry;
80 }
81 }
82 if (best_entry) {
83 if (!best_entry->allocator) {
84 best_entry->allocator.reset(best_entry->factory->CreateAllocator());
85 }
86 return best_entry->allocator.get();
87 } else {
88 LOG(FATAL) << "No registered CPU AllocatorFactory";
89 return nullptr;
90 }
91}
92
93#ifdef TENSORFLOW_USE_PMEM
94Allocator* AllocatorFactoryRegistry::GetExperimentalPMEMAllocator(

Callers 15

ParamsMethod · 0.45
get_allocatorMethod · 0.45
cpu_allocator_baseFunction · 0.45
AddRandomInputMethod · 0.45
operator()Method · 0.45
ComputeMethod · 0.45
SetDeviceMethod · 0.45
ComputeAsyncMethod · 0.45
SetRandomImageInputMethod · 0.45
RunRandomTestMethod · 0.45

Calls 3

resetMethod · 0.45
CreateAllocatorMethod · 0.45
getMethod · 0.45

Tested by 14

AddRandomInputMethod · 0.36
SetDeviceMethod · 0.36
SetRandomImageInputMethod · 0.36
RunRandomTestMethod · 0.36
OpsTestBaseMethod · 0.36
SetRandomImageInputMethod · 0.36
RunRandomTestMethod · 0.36
GetKernelFunction · 0.36
InitTensorMethod · 0.36
RunGatherMethod · 0.36
DatasetOpsTestBaseMethod · 0.36
RunMethod · 0.36