| 53 | } |
| 54 | |
| 55 | void StreamPool::ReturnStream(se::Stream* stream) { |
| 56 | if (stream->ok()) { |
| 57 | VLOG(1) << stream->DebugStreamPointers() |
| 58 | << " StreamPool returning ok stream"; |
| 59 | tensorflow::mutex_lock lock(mu_); |
| 60 | streams_.emplace_back(stream); |
| 61 | } else { |
| 62 | // If the stream has encountered any errors, all subsequent operations on it |
| 63 | // will fail. So just delete the stream, and rely on new streams to be |
| 64 | // created in the future. |
| 65 | VLOG(1) << stream->DebugStreamPointers() |
| 66 | << " StreamPool deleting !ok stream"; |
| 67 | delete stream; |
| 68 | } |
| 69 | } |
| 70 | |
| 71 | } // namespace xla |
no test coverage detected