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

Method EnsureStreamOkLocked

tensorflow/compiler/jit/xla_device.cc:310–323  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

308}
309
310Status XlaDevice::EnsureStreamOkLocked(xla::Backend* backend,
311 const string& name,
312 std::shared_ptr<se::Stream>* stream,
313 bool* stream_was_changed) {
314 if (!(*stream) || !(*stream)->ok()) {
315 xla::StreamPool::Ptr ptr;
316 TF_ASSIGN_OR_RETURN(ptr, backend->BorrowStream(device_ordinal_));
317 *stream = std::shared_ptr<se::Stream>(std::move(ptr));
318 VLOG(1) << "XlaDevice " << this << " new " << name << " "
319 << (*stream)->DebugStreamPointers();
320 *stream_was_changed = true;
321 }
322 return Status::OK();
323}
324
325xla::StatusOr<std::pair<XlaDeviceContext*, XlaDeviceContext*>>
326XlaDevice::GetDeviceContextLocked() {

Callers

nothing calls this directly

Calls 4

DebugStreamPointersMethod · 0.80
TF_ASSIGN_OR_RETURNFunction · 0.50
okMethod · 0.45
BorrowStreamMethod · 0.45

Tested by

no test coverage detected