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

Method AllocateRaw

tensorflow/core/common_runtime/gpu/gpu_vmem_allocator.cc:28–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26namespace tensorflow {
27
28void* GPUVMemAllocator::AllocateRaw(size_t alignment, size_t num_bytes) {
29 mutex_lock l(lock_);
30 AllocationAttributes new_attr;
31 // Tell the device_allocator_ not to retry
32 // since we can alloc host memory as backup
33 new_attr.no_retry_on_failure = true;
34 void* ret = device_allocator_->AllocateRaw(alignment, num_bytes, new_attr);
35 if (ret != nullptr) {
36 device_ptrs_.insert(ret);
37 return ret;
38 }
39 ret = host_allocator_->AllocateRaw(alignment, num_bytes);
40 VLOG(3) << "host_allocator_ allocates " << (num_bytes/1024.0/1024) << " MiB";
41 return ret;
42}
43
44void* GPUVMemAllocator::AllocateRaw(size_t alignment, size_t num_bytes,
45 const AllocationAttributes& allocation_attr) {

Callers 13

SetProtoFromGPUMethod · 0.45
allocateFunction · 0.45
gpu_device.ccFile · 0.45
TESTFunction · 0.45
BM_AllocationFunction · 0.45
BM_AllocationThreadedFunction · 0.45
BM_AllocationDelayedFunction · 0.45
TestBinDebugInfoMethod · 0.45
TEST_FFunction · 0.45
TESTFunction · 0.45
TESTFunction · 0.45

Calls 2

GetStatsMethod · 0.95
insertMethod · 0.45

Tested by 10

TESTFunction · 0.36
BM_AllocationFunction · 0.36
BM_AllocationThreadedFunction · 0.36
BM_AllocationDelayedFunction · 0.36
TestBinDebugInfoMethod · 0.36
TEST_FFunction · 0.36
TESTFunction · 0.36
TESTFunction · 0.36
TESTFunction · 0.36