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

Method Alloc

tensorflow/core/common_runtime/pool_allocator.cc:259–271  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

257}
258
259void* BasicCPUAllocator::Alloc(size_t alignment, size_t num_bytes) {
260 void* ptr = nullptr;
261 if (num_bytes > 0) {
262 if (numa_node_ == port::kNUMANoAffinity) {
263 ptr = port::AlignedMalloc(num_bytes, static_cast<int>(alignment));
264 } else {
265 ptr =
266 port::NUMAMalloc(numa_node_, num_bytes, static_cast<int>(alignment));
267 }
268 VisitAlloc(ptr, numa_node_, num_bytes);
269 }
270 return ptr;
271}
272
273void BasicCPUAllocator::Free(void* ptr, size_t num_bytes) {
274 if (num_bytes > 0) {

Callers 8

ExtendMethod · 0.45
InitMethod · 0.45
AllocateRawMethod · 0.45
SmallAllocateMethod · 0.45
BigAllocateMethod · 0.45
BigAllocateStatisticMethod · 0.45
CopyToBackingStoreMethod · 0.45
AllocateRawMethod · 0.45

Calls 2

AlignedMallocFunction · 0.50
NUMAMallocFunction · 0.50

Tested by

no test coverage detected