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

Function cpu_allocator_base

tensorflow/core/framework/allocator.cc:67–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65}
66
67Allocator* cpu_allocator_base() {
68 static Allocator* cpu_alloc =
69 AllocatorFactoryRegistry::singleton()->GetAllocator();
70 // TODO(tucker): This really seems wrong. It's only going to be effective on
71 // the first call in a process (but the desired effect is associated with a
72 // session), and we probably ought to be tracking the highest level Allocator,
73 // not the lowest. Revisit the advertised semantics of the triggering option.
74 if (cpu_allocator_collect_full_stats && !cpu_alloc->TracksAllocationSizes()) {
75 cpu_alloc = new TrackingAllocator(cpu_alloc, true);
76 }
77 return cpu_alloc;
78}
79
80Allocator* cpu_allocator(int numa_node) {
81 // Correctness relies on devices being created prior to the first call

Callers 3

cpu_allocatorFunction · 0.85
GetCPUAllocatorMethod · 0.85
TestOnlyResetMethod · 0.85

Calls 2

GetAllocatorMethod · 0.45
TracksAllocationSizesMethod · 0.45

Tested by 1

TestOnlyResetMethod · 0.68