diff options
author | Smit Hinsu <hinsu@google.com> | 2018-05-21 17:42:15 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-05-21 17:44:41 -0700 |
commit | b1139814f91c5216eb5ff229ee7e1982e5f4e888 (patch) | |
tree | 7f85c8229bfd47eeba49890aa75b59c8680e619c /tensorflow/stream_executor/stream_executor_pimpl.cc | |
parent | d913a243196fa07d4728c8f7c1ce6444ecd086eb (diff) |
Introduce an option to allocate CUDA unified memory
PiperOrigin-RevId: 197490523
Diffstat (limited to 'tensorflow/stream_executor/stream_executor_pimpl.cc')
-rw-r--r-- | tensorflow/stream_executor/stream_executor_pimpl.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tensorflow/stream_executor/stream_executor_pimpl.cc b/tensorflow/stream_executor/stream_executor_pimpl.cc index eecd5bfe1f..b222a4d82a 100644 --- a/tensorflow/stream_executor/stream_executor_pimpl.cc +++ b/tensorflow/stream_executor/stream_executor_pimpl.cc @@ -464,6 +464,20 @@ bool StreamExecutor::GetSymbol(const string &symbol_name, void **mem, return implementation_->GetSymbol(symbol_name, mem, bytes); } +void *StreamExecutor::UnifiedMemoryAllocate(uint64 bytes) { + void *buffer = implementation_->UnifiedMemoryAllocate(bytes); + VLOG(1) << "Called StreamExecutor::UnifiedMemoryAllocate(size=" << bytes + << ") returns " << buffer << StackTraceIfVLOG10(); + return buffer; +} + +void StreamExecutor::UnifiedMemoryDeallocate(void *location) { + VLOG(1) << "Called StreamExecutor::UnifiedMemoryDeallocate(location=" + << location << ")" << StackTraceIfVLOG10(); + + return implementation_->UnifiedMemoryDeallocate(location); +} + void *StreamExecutor::HostMemoryAllocate(uint64 size) { void *buffer = implementation_->HostMemoryAllocate(size); VLOG(1) << "Called StreamExecutor::HostMemoryAllocate(size=" << size |