MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / Sync

Method Sync

tensorflow/compiler/jit/xla_device.cc:437–454  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

435}
436
437Status XlaDevice::Sync() {
438 VLOG(1) << "XlaDevice::Sync";
439 profiler::TraceMe activity("XlaDevice::Sync", profiler::TraceMeLevel::kInfo);
440 std::shared_ptr<se::Stream> stream;
441 {
442 mutex_lock lock(mu_);
443 stream = stream_;
444 }
445 if (!stream) return Status::OK();
446
447 Status status = stream->BlockHostUntilDone();
448 TF_RETURN_IF_ERROR(status);
449 if (!stream->ok()) {
450 return errors::Internal("XlaDevice::Sync() failed.");
451 }
452 VLOG(1) << "XlaDevice::Sync completed";
453 return Status::OK();
454}
455
456// TODO(b/112409994): This is no longer necessary. Consolidate it with the
457// synchronous version.

Callers 2

FlushMethod · 0.45
TF_SyncWritableFileFunction · 0.45

Calls 3

InternalFunction · 0.85
BlockHostUntilDoneMethod · 0.45
okMethod · 0.45

Tested by

no test coverage detected