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

Method Allocate

tensorflow/stream_executor/stream_executor_pimpl.cc:564–580  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

562}
563
564DeviceMemoryBase StreamExecutor::Allocate(uint64 size, int64 memory_space) {
565 if (memory_limit_bytes_ > 0 &&
566 mem_alloc_bytes_ + size > memory_limit_bytes_) {
567 LOG(WARNING) << "Not enough memory to allocate " << size << " on device "
568 << device_ordinal_
569 << " within provided limit. [used=" << mem_alloc_bytes_
570 << ", limit=" << memory_limit_bytes_ << "]";
571 return DeviceMemoryBase();
572 }
573 DeviceMemoryBase buf = implementation_->Allocate(size, memory_space);
574 VLOG(1) << "Called StreamExecutor::Allocate(size=" << size
575 << ", memory_space=" << memory_space << ") returns " << buf.opaque()
576 << StackTraceIfVLOG10();
577 CreateAllocRecord(buf.opaque(), size);
578
579 return buf;
580}
581
582port::StatusOr<DeviceMemoryBase> StreamExecutor::GetUntypedSymbol(
583 const string &symbol_name, ModuleHandle module_handle) {

Callers

nothing calls this directly

Calls 6

StackTraceIfVLOG10Function · 0.85
ResourceExhaustedFunction · 0.85
opaqueMethod · 0.80
DeviceMemoryBaseClass · 0.70
TF_ASSIGN_OR_RETURNFunction · 0.50

Tested by

no test coverage detected