From ee0bd6ef450b388fadea63b31b65b13bd12f17d6 Mon Sep 17 00:00:00 2001 From: "A. Unique TensorFlower" Date: Tue, 24 Jul 2018 13:50:22 -0700 Subject: Automated rollback of commit 0ea6847c892497afdd20c1150fee1e532612ca17 PiperOrigin-RevId: 205885304 --- tensorflow/stream_executor/host/host_gpu_executor.cc | 2 +- tensorflow/stream_executor/stream.cc | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'tensorflow/stream_executor') diff --git a/tensorflow/stream_executor/host/host_gpu_executor.cc b/tensorflow/stream_executor/host/host_gpu_executor.cc index 3cd97b3cf1..8adf739b17 100644 --- a/tensorflow/stream_executor/host/host_gpu_executor.cc +++ b/tensorflow/stream_executor/host/host_gpu_executor.cc @@ -93,7 +93,7 @@ bool HostExecutor::MemcpyDeviceToDevice(Stream *stream, // the nature of the HostExecutor) memcpy on the stream (HostStream) // associated with the HostExecutor. AsHostStream(stream)->EnqueueTask( - [src_mem, dst_mem, size]() { memcpy(src_mem, dst_mem, size); }); + [src_mem, dst_mem, size]() { memcpy(dst_mem, src_mem, size); }); return true; } diff --git a/tensorflow/stream_executor/stream.cc b/tensorflow/stream_executor/stream.cc index ca1b8e28e6..2c495c99e1 100644 --- a/tensorflow/stream_executor/stream.cc +++ b/tensorflow/stream_executor/stream.cc @@ -268,6 +268,12 @@ Stream::~Stream() { VLOG_CALL(); temporary_memory_manager_.ForceDeallocateAll(); + // Ensure the stream is completed. + auto status = BlockHostUntilDone(); + if (!status.ok()) { + LOG(WARNING) << "Error blocking host until done in stream destructor: " + << status; + } if (allocated_) { parent_->DeallocateStream(this); -- cgit v1.2.3