| 562 | } |
| 563 | |
| 564 | DeviceMemoryBase 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 | |
| 582 | port::StatusOr<DeviceMemoryBase> StreamExecutor::GetUntypedSymbol( |
| 583 | const string &symbol_name, ModuleHandle module_handle) { |
nothing calls this directly
no test coverage detected