| 308 | } |
| 309 | |
| 310 | Status 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 | |
| 325 | xla::StatusOr<std::pair<XlaDeviceContext*, XlaDeviceContext*>> |
| 326 | XlaDevice::GetDeviceContextLocked() { |
nothing calls this directly
no test coverage detected