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

Method AllocateRaw

tensorflow/core/common_runtime/gpu_tensorpool_allocator.cc:203–219  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

201}
202
203void* GPUTensorPoolAllocator::AllocateRaw(size_t alignment,
204 size_t num_bytes) {
205 if (!inited_.load()) {
206 auto ptr = sub_allocator_->Alloc(alignment, num_bytes);
207 mem_planner_->TrackAllocate(alignment, num_bytes, ptr);
208 return ptr;
209 }
210
211 if (SmallAlloc(num_bytes)) {
212 return SmallAllocate(alignment, num_bytes);
213 }
214 if (unlikely(stats_)) {
215 return BigAllocateStatistic(alignment, num_bytes);
216 } else {
217 return BigAllocate(alignment, num_bytes);
218 }
219}
220
221void GPUTensorPoolAllocator::DeallocateRaw(void* ptr) {
222 if (!inited_.load()) {

Callers 2

AllocateMethod · 0.45
SmallAllocateMethod · 0.45

Calls 7

SmallAllocFunction · 0.85
loadMethod · 0.45
AllocMethod · 0.45
TrackAllocateMethod · 0.45
emptyMethod · 0.45
popMethod · 0.45
AllocateMethod · 0.45

Tested by

no test coverage detected