diff options
author | A. Unique TensorFlower <gardener@tensorflow.org> | 2017-01-17 12:28:27 -0800 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2017-01-17 12:51:25 -0800 |
commit | 21c0fa9e2dd966c242a4e89f1cac9e3e0f146ea8 (patch) | |
tree | dafb27008ba040280825c18d10e0bef02d68187c /tensorflow/stream_executor/host | |
parent | c276876a4ab1ebedf2b847d9ac12d019d6a16cff (diff) |
Plumb port::Status through the internal synchronous memcopy routines.
Now, at least for the public APIs that return port::Status, they can grab the
port::Status that the implementation would like to return and use its
additional information in reporting to the user.
Change: 144741667
Diffstat (limited to 'tensorflow/stream_executor/host')
-rw-r--r-- | tensorflow/stream_executor/host/host_gpu_executor.cc | 19 | ||||
-rw-r--r-- | tensorflow/stream_executor/host/host_gpu_executor.h | 15 |
2 files changed, 18 insertions, 16 deletions
diff --git a/tensorflow/stream_executor/host/host_gpu_executor.cc b/tensorflow/stream_executor/host/host_gpu_executor.cc index ff07432bb7..830bc9a681 100644 --- a/tensorflow/stream_executor/host/host_gpu_executor.cc +++ b/tensorflow/stream_executor/host/host_gpu_executor.cc @@ -129,23 +129,24 @@ bool HostExecutor::Memset32(Stream *stream, DeviceMemoryBase *location, return true; } -bool HostExecutor::SynchronousMemcpy(DeviceMemoryBase *gpu_dst, - const void *host_src, uint64 size) { +port::Status HostExecutor::SynchronousMemcpy(DeviceMemoryBase *gpu_dst, + const void *host_src, + uint64 size) { memcpy(gpu_dst->opaque(), host_src, size); - return true; + return port::Status::OK(); } -bool HostExecutor::SynchronousMemcpy(void *host_dst, - const DeviceMemoryBase &gpu_src, - uint64 size) { +port::Status HostExecutor::SynchronousMemcpy(void *host_dst, + const DeviceMemoryBase &gpu_src, + uint64 size) { memcpy(host_dst, gpu_src.opaque(), size); - return true; + return port::Status::OK(); } -bool HostExecutor::SynchronousMemcpyDeviceToDevice( +port::Status HostExecutor::SynchronousMemcpyDeviceToDevice( DeviceMemoryBase *gpu_dst, const DeviceMemoryBase &gpu_src, uint64 size) { memcpy(gpu_dst->opaque(), gpu_src.opaque(), size); - return true; + return port::Status::OK(); } bool HostExecutor::HostCallback(Stream *stream, diff --git a/tensorflow/stream_executor/host/host_gpu_executor.h b/tensorflow/stream_executor/host/host_gpu_executor.h index f217f7947f..77b07e4a57 100644 --- a/tensorflow/stream_executor/host/host_gpu_executor.h +++ b/tensorflow/stream_executor/host/host_gpu_executor.h @@ -95,13 +95,14 @@ class HostExecutor : public internal::StreamExecutorInterface { bool SynchronousMemSet(DeviceMemoryBase *location, int value, uint64 size) override; - bool SynchronousMemcpy(DeviceMemoryBase *gpu_dst, const void *host_src, - uint64 size) override; - bool SynchronousMemcpy(void *host_dst, const DeviceMemoryBase &gpu_src, - uint64 size) override; - bool SynchronousMemcpyDeviceToDevice(DeviceMemoryBase *gpu_dst, - const DeviceMemoryBase &gpu_src, - uint64 size) override; + port::Status SynchronousMemcpy(DeviceMemoryBase *gpu_dst, + const void *host_src, uint64 size) override; + port::Status SynchronousMemcpy(void *host_dst, + const DeviceMemoryBase &gpu_src, + uint64 size) override; + port::Status SynchronousMemcpyDeviceToDevice(DeviceMemoryBase *gpu_dst, + const DeviceMemoryBase &gpu_src, + uint64 size) override; bool HostCallback(Stream *stream, std::function<void()> callback) override; |