diff options
author | A. Unique TensorFlower <gardener@tensorflow.org> | 2017-12-13 08:43:09 -0800 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2017-12-13 08:46:42 -0800 |
commit | 246d5b95723a275b80f4b803024182b4221b4e43 (patch) | |
tree | 9edc1808fdfddf37ada6ea1d4245b48771ff5637 | |
parent | 2eae1ac21ce28f3b2cafe9e12a25b3bddc475847 (diff) |
Stream::BlockHostUntilDone now returns Status rather than bool.
The now-deprecated Stream::BlockHostUntilDoneWithStatus remains, to facilitate a
multi-CL renaming transition. Once all callers have been renamed to
BlockHostUntilDone, *WithStatus will be removed.
The StreamExecutor (private) method has also been renamed to BlockHostUntilDone.
It's only used by Stream.
The StreamExecutorInterface method will be renamed in a separate atomic CL.
It's harder to perform that transition gradually, and we've already performed an
atomic change previously, so we might as well fix it up in one shot.
PiperOrigin-RevId: 178907807
-rw-r--r-- | tensorflow/stream_executor/stream.cc | 10 | ||||
-rw-r--r-- | tensorflow/stream_executor/stream.h | 11 | ||||
-rw-r--r-- | tensorflow/stream_executor/stream_executor_pimpl.cc | 2 | ||||
-rw-r--r-- | tensorflow/stream_executor/stream_executor_pimpl.h | 2 |
4 files changed, 11 insertions, 14 deletions
diff --git a/tensorflow/stream_executor/stream.cc b/tensorflow/stream_executor/stream.cc index de65038d17..0512f4c79a 100644 --- a/tensorflow/stream_executor/stream.cc +++ b/tensorflow/stream_executor/stream.cc @@ -5055,7 +5055,7 @@ Stream &Stream::ThenEnqueueOnBackgroundThread( }); } -port::Status Stream::BlockHostUntilDoneWithStatus() { +port::Status Stream::BlockHostUntilDone() { VLOG_CALL(); if (!ok()) { @@ -5072,7 +5072,7 @@ port::Status Stream::BlockHostUntilDoneWithStatus() { mutex_lock lock{mu_}; for (auto &stream : sub_streams_) { if (!stream.second) { - first_error.Update(stream.first->BlockHostUntilDoneWithStatus()); + first_error.Update(stream.first->BlockHostUntilDone()); // Set this sub-stream as available. stream.second = true; } @@ -5081,13 +5081,13 @@ port::Status Stream::BlockHostUntilDoneWithStatus() { temporary_memory_manager_.DeallocateFinalizedTemporaries(); - first_error.Update(parent_->BlockHostUntilDoneWithStatus(this)); + first_error.Update(parent_->BlockHostUntilDone(this)); CheckError(first_error.ok()); return first_error; } -bool Stream::BlockHostUntilDone() { - return BlockHostUntilDoneWithStatus().ok(); +port::Status Stream::BlockHostUntilDoneWithStatus() { + return BlockHostUntilDone(); } } // namespace gputools diff --git a/tensorflow/stream_executor/stream.h b/tensorflow/stream_executor/stream.h index 15a5a2b6cb..4c34452048 100644 --- a/tensorflow/stream_executor/stream.h +++ b/tensorflow/stream_executor/stream.h @@ -1905,15 +1905,12 @@ class Stream { // // Returns an OK status if the blocking was successful and the stream is ok(). // Otherwise returns an error describing why the blocking failed. - // - // TODO(b/70298427): Rename to BlockHostUntilDone, once all callers have been - // converted from the bool form. - port::Status BlockHostUntilDoneWithStatus() LOCKS_EXCLUDED(mu_); + port::Status BlockHostUntilDone() LOCKS_EXCLUDED(mu_); - // DEPRECATED(b/70298427) - new code should use BlockHostUntilDoneWithStatus() + // DEPRECATED(b/70298427) - new code should use BlockHostUntilDone() // - // Equivalent to BlockHostUntilDoneWithStatus().ok(). - bool BlockHostUntilDone() LOCKS_EXCLUDED(mu_); + // Equivalent to BlockHostUntilDone() + port::Status BlockHostUntilDoneWithStatus() LOCKS_EXCLUDED(mu_); // Warning! This method interacts with internal threads in // sometimes-unpredictable ways and is intended for GPU-Executor-internal diff --git a/tensorflow/stream_executor/stream_executor_pimpl.cc b/tensorflow/stream_executor/stream_executor_pimpl.cc index 719f292937..c4b248657e 100644 --- a/tensorflow/stream_executor/stream_executor_pimpl.cc +++ b/tensorflow/stream_executor/stream_executor_pimpl.cc @@ -432,7 +432,7 @@ bool StreamExecutor::Launch(Stream *stream, const ThreadDim &thread_dims, return implementation_->Launch(stream, thread_dims, block_dims, kernel, args); } -port::Status StreamExecutor::BlockHostUntilDoneWithStatus(Stream *stream) { +port::Status StreamExecutor::BlockHostUntilDone(Stream *stream) { port::Status result; SCOPED_TRACE(TraceListener::BlockHostUntilDone, &result, stream); diff --git a/tensorflow/stream_executor/stream_executor_pimpl.h b/tensorflow/stream_executor/stream_executor_pimpl.h index d2965dbfd7..a2a77218cb 100644 --- a/tensorflow/stream_executor/stream_executor_pimpl.h +++ b/tensorflow/stream_executor/stream_executor_pimpl.h @@ -481,7 +481,7 @@ class StreamExecutor { // Causes the host code to synchronously wait for operations entrained onto // stream to complete. Effectively a join on the asynchronous device // operations enqueued on the stream before this program point. - port::Status BlockHostUntilDoneWithStatus(Stream *stream); + port::Status BlockHostUntilDone(Stream *stream); // Synchronously allocates size bytes on the underlying platform and returns // an opaque void* representing that allocation. In the case of failure, |