Rename Stream::BlockHostUntilDoneWithStatus to BlockHostUntilDone.
authorA. Unique TensorFlower <gardener@tensorflow.org>
Wed, 13 Dec 2017 21:45:05 +0000 (13:45 -0800)
committerTensorFlower Gardener <gardener@tensorflow.org>
Wed, 13 Dec 2017 21:48:42 +0000 (13:48 -0800)
PiperOrigin-RevId: 178951330

13 files changed:
tensorflow/compiler/jit/xla_device_context.cc
tensorflow/compiler/xla/service/executable.cc
tensorflow/compiler/xla/service/executable.h
tensorflow/compiler/xla/service/execution_tracker.cc
tensorflow/compiler/xla/service/gpu/gpu_executable.cc
tensorflow/compiler/xla/service/gpu/gpu_transfer_manager.cc
tensorflow/compiler/xla/service/gpu/infeed_thunk.cc
tensorflow/compiler/xla/service/gpu/while_thunk.cc
tensorflow/compiler/xla/service/hlo_runner.cc
tensorflow/compiler/xla/service/service.cc
tensorflow/contrib/nccl/kernels/nccl_manager_test.cc
tensorflow/core/common_runtime/gpu/gpu_util.cc
tensorflow/stream_executor/cuda/cuda_dnn.cc

index be5a288b3740284105f387159d3b5d1db0f11ee0..c936222f32056e92efced82d5adb3a96c8041a17 100644 (file)
@@ -74,7 +74,7 @@ void XlaTransferManager::CopyCPUTensorToDevice(const Tensor* cpu_tensor,
     Status status;
     stream_->ThenMemcpy(&dev_dst_ptr, src_ptr, total_bytes);
     // TODO(hpucha): Make this asynchronous.
-    Status block_status = stream_->BlockHostUntilDoneWithStatus();
+    Status block_status = stream_->BlockHostUntilDone();
     if (!block_status.ok()) {
       status = xla::InternalError(
           "Failed to complete data transfer on stream %p: %s", stream_,
@@ -110,7 +110,7 @@ void XlaTransferManager::CopyDeviceTensorToCPU(const Tensor* device_tensor,
     Status status;
     stream_->ThenMemcpy(dst_ptr, dev_src_ptr, total_bytes);
     // TODO(hpucha): Make this asynchronous.
-    Status block_status = stream_->BlockHostUntilDoneWithStatus();
+    Status block_status = stream_->BlockHostUntilDone();
     if (!block_status.ok()) {
       status = xla::InternalError(
           "Failed to complete data transfer on stream %p: %s", stream_,
index 8b8991b540021c1a8dbc5b5f4eaf6a78cc0cddbb..ad5d5ead00eaae558912537a17ea53394a1a20a0 100644 (file)
@@ -52,7 +52,7 @@ Executable::ExecuteOnStreams(
   }
   for (const auto& options : run_options) {
     TF_RET_CHECK(options.stream() != nullptr);
-    TF_RETURN_IF_ERROR(options.stream()->BlockHostUntilDoneWithStatus());
+    TF_RETURN_IF_ERROR(options.stream()->BlockHostUntilDone());
   }
   return return_values;
 }
index 12faf28d02195e1dec41c51d1c0d49050d156673..cb9ee47dc6885789bbf9a718fce9aebd6fa81fc8 100644 (file)
@@ -224,7 +224,7 @@ StatusOr<ReturnT> Executable::ExecuteOnStreamWrapper(
   if (profile != nullptr) {
     VLOG(1) << "enqueueing 'stop timer' and blocking host until done...";
     stream->ThenStopTimer(timer.get());
-    SE_CHECK_OK(stream->BlockHostUntilDoneWithStatus());
+    SE_CHECK_OK(stream->BlockHostUntilDone());
     VLOG(1) << "done with block-host-until-done";
 
     // Merge in run-time profile information from execution_profile.
index 6a34c2638bee575416220d7944447e13cd058575..2f0b9ed2bd98fbea4e67c0a30d5aa41ff6a06979 100644 (file)
@@ -39,7 +39,7 @@ AsyncExecution::AsyncExecution(Backend* backend,
 
 tensorflow::Status AsyncExecution::BlockUntilDone() const {
   for (auto& stream : streams_) {
-    TF_RETURN_IF_ERROR(stream->BlockHostUntilDoneWithStatus());
+    TF_RETURN_IF_ERROR(stream->BlockHostUntilDone());
   }
   return tensorflow::Status::OK();
 }
index 061707f32b05b8ff1e617641c67fa9d049aafa75..b802ae9c7aba4e94bb37b0e4c6a2ba157f9be7d5 100644 (file)
@@ -69,7 +69,7 @@ class HloExecutionProfiler {
   ~HloExecutionProfiler() {
     if (do_profile_) {
       stream_->ThenStopTimer(execution_timer_.get());
-      stream_->BlockHostUntilDoneWithStatus().IgnoreError();
+      stream_->BlockHostUntilDone().IgnoreError();
       profile_->set_total_cycles_executed(
           *computation_, execution_timer_->Nanoseconds() * clock_rate_ghz_);
     }
@@ -87,7 +87,7 @@ class HloExecutionProfiler {
   void FinishOperation(const HloInstruction* hlo_instruction) {
     if (do_profile_) {
       stream_->ThenStopTimer(per_op_timer_.get());
-      stream_->BlockHostUntilDoneWithStatus().IgnoreError();
+      stream_->BlockHostUntilDone().IgnoreError();
       profile_->SetCyclesTakenBy(
           hlo_instruction, per_op_timer_->Nanoseconds() * clock_rate_ghz_);
     }
@@ -170,7 +170,7 @@ Status GpuExecutable::ExecuteThunks(
     // If this thunk requests it, wait for all currently-executing thunks to
     // finish.  This is useful e.g. if the thunk is about to perform autotuning.
     if (thunk->ShouldHaltAllActivityBeforeRunning(stream)) {
-      TF_RETURN_IF_ERROR(main_stream->BlockHostUntilDoneWithStatus());
+      TF_RETURN_IF_ERROR(main_stream->BlockHostUntilDone());
     }
 
     profiler.StartOperation();
@@ -192,7 +192,7 @@ Status GpuExecutable::ExecuteThunks(
   // TODO(b/30100571): we could potentially postpone deallocating the temp
   // buffers until a different computation is executed.
   if (block_host_until_done) {
-    Status block_status = main_stream->BlockHostUntilDoneWithStatus();
+    Status block_status = main_stream->BlockHostUntilDone();
     if (!block_status.ok()) {
       return InternalError(
           "Failed to complete all kernels launched on stream %p: %s",
index 550df335761ce05559dc549db130325a6cfb9b7f..ae92daef8882de2e7d64b69f68452061cb5507f2 100644 (file)
@@ -105,7 +105,7 @@ Status GpuTransferManager::EnqueueBuffersToInfeed(
   // infeed requests, blocking on the stream might be
   // heavy-handed. Figure out if finer-grained acknowledgement is
   // possible.
-  Status block_status = stream->BlockHostUntilDoneWithStatus();
+  Status block_status = stream->BlockHostUntilDone();
   if (!block_status.ok()) {
     for (gpu::InfeedBuffer* b : buffers) {
       b->Done();
index db8659a8b917a385c9f2e49aa95d4ec7d7bbf5a8..2ac95ceb692447c7ac6dbbcd8b9a38876f7a77b6 100644 (file)
@@ -65,7 +65,7 @@ Status InfeedThunk::ExecuteOnStream(const BufferAllocations& buffer_allocations,
                        buffer->length());
   }
 
-  Status block_status = stream->BlockHostUntilDoneWithStatus();
+  Status block_status = stream->BlockHostUntilDone();
   if (!block_status.ok()) {
     return InternalError("Failed to complete data transfer on stream %p: %s",
                          stream, block_status.error_message().c_str());
index e3ecb784dd902c2ee32ae795ab3c1a6f10236713..c21559af6d2e5dfb5aaf62afcdcaed514e0914c9 100644 (file)
@@ -53,7 +53,7 @@ Status WhileThunk::ExecuteOnStream(const BufferAllocations& buffer_allocations,
     // Copy the result of condition computation and break the loop if 'false'.
     bool condition_result;
     stream->ThenMemcpy(&condition_result, condition_result_data, sizeof(bool));
-    Status block_status = stream->BlockHostUntilDoneWithStatus();
+    Status block_status = stream->BlockHostUntilDone();
     if (!block_status.ok()) {
       return InternalError(
           "Failed to complete all kernels launched on stream %p: %s", stream,
index b4ca8d12a14e97ac95061d767a1bd1d08401e1fb..a6101bbe6075d62d7a9872c3d9005dce2865453e 100644 (file)
@@ -150,7 +150,7 @@ StatusOr<se::DeviceMemoryBase> HloRunner::Execute(
       se::DeviceMemoryBase result,
       executable->ExecuteOnStream(&service_run_options, arguments,
                                   /*hlo_execution_profile=*/nullptr));
-  TF_RETURN_IF_ERROR(stream.BlockHostUntilDoneWithStatus());
+  TF_RETURN_IF_ERROR(stream.BlockHostUntilDone());
 
   allocations_.push_back(result);
 
index 462b76e9b4a33c61adc6f0d07b6ae86caa7bc560..ecc3c0ff12718592bd8e8847eb5ef806d2b60821 100644 (file)
@@ -566,7 +566,7 @@ Service::ExecuteParallelAndRegisterResult(
 
   // Wait for all executions to complete.
   for (int64 i = 0; i < streams.size(); ++i) {
-    Status block_status = streams[i]->BlockHostUntilDoneWithStatus();
+    Status block_status = streams[i]->BlockHostUntilDone();
     if (!block_status.ok()) {
       return InternalError("failed to complete execution for stream %lld: %s",
                            i, block_status.error_message().c_str());
index ef76df6b0d7a78d1743176b02073de54c4025167..658baf18d3c706d3b7fbba1ec9d02a1f0cda638e 100644 (file)
@@ -175,7 +175,7 @@ class NcclManagerTest : public ::testing::Test {
       auto out_gpu_mem = AsDeviceMemory(out_gpu.flat<float>().data());
       stream->ThenMemcpy(out_cpu.flat<float>().data(), out_gpu_mem,
                          out_cpu.TotalBytes());
-      SE_ASSERT_OK(stream->BlockHostUntilDoneWithStatus());
+      SE_ASSERT_OK(stream->BlockHostUntilDone());
       test::ExpectTensorEqual<float>(test_case->expected, out_cpu);
     }
   }
@@ -236,7 +236,7 @@ TEST_F(NcclManagerTest, MultipleCallers) {
     for (int i = 0; i < num_ranks; ++i) {
       auto* device = devices->at(i % devices->size());
       auto* stream = device->tensorflow_gpu_device_info()->stream;
-      SE_ASSERT_OK(stream->BlockHostUntilDoneWithStatus());
+      SE_ASSERT_OK(stream->BlockHostUntilDone());
     }
 
     std::random_shuffle(case_and_device_num.begin(), case_and_device_num.end());
index 9d8210a8779b371f57eb4a8dc93aa07e3e41eb5c..a0f5877d62f0c889c2a598b8e03771e4bb49e0a9 100644 (file)
@@ -352,7 +352,7 @@ Status GPUUtil::Sync(Device* gpu_device) {
   if (!dev_info) {
     return errors::Internal("Failed to find dest device GPUDeviceInfo");
   }
-  return dev_info->stream->BlockHostUntilDoneWithStatus();
+  return dev_info->stream->BlockHostUntilDone();
 }
 
 Status GPUUtil::SyncAll(Device* gpu_device) {
index 60c889c05361407f48ed3d870213afb636670ed9..daeb9a4b77ac49f41ee8f3bc20241cafc40f9b4d 100644 (file)
@@ -4252,7 +4252,7 @@ bool CudnnSupport::DoDepthConcatenate(
     const auto& dimensions = input_dimensions[i];
     tmp.resize(dimensions.ElementCount());
     stream->ThenMemcpyD2H<float>(*input_data[i], &tmp);
-    port::Status block_status = stream->BlockHostUntilDoneWithStatus();
+    port::Status block_status = stream->BlockHostUntilDone();
     if (!block_status.ok()) {
       LOG(ERROR) << "BlockHostUntilDone failed: " << block_status;
       return false;