aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/compiler/xla/service/stream_pool.cc
diff options
context:
space:
mode:
Diffstat (limited to 'tensorflow/compiler/xla/service/stream_pool.cc')
-rw-r--r--tensorflow/compiler/xla/service/stream_pool.cc15
1 files changed, 12 insertions, 3 deletions
diff --git a/tensorflow/compiler/xla/service/stream_pool.cc b/tensorflow/compiler/xla/service/stream_pool.cc
index 92bb21b816..c0582c6a2d 100644
--- a/tensorflow/compiler/xla/service/stream_pool.cc
+++ b/tensorflow/compiler/xla/service/stream_pool.cc
@@ -16,6 +16,7 @@ limitations under the License.
#include "tensorflow/compiler/xla/service/stream_pool.h"
#include "tensorflow/compiler/xla/ptr_util.h"
+#include "tensorflow/core/platform/logging.h"
namespace xla {
@@ -27,6 +28,8 @@ StreamPool::Ptr StreamPool::BorrowStream(se::StreamExecutor* executor) {
// Re-use an existing stream from the pool.
stream = std::move(streams_.back());
streams_.pop_back();
+ VLOG(1) << stream->DebugStreamPointers()
+ << " StreamPool reusing existing stream";
}
}
@@ -34,6 +37,8 @@ StreamPool::Ptr StreamPool::BorrowStream(se::StreamExecutor* executor) {
// Create a new stream.
stream = MakeUnique<se::Stream>(executor);
stream->Init();
+ VLOG(1) << stream->DebugStreamPointers()
+ << " StreamPool created new stream";
}
// Return the stream wrapped in Ptr, which has our special deleter semantics.
@@ -43,12 +48,16 @@ StreamPool::Ptr StreamPool::BorrowStream(se::StreamExecutor* executor) {
void StreamPool::ReturnStream(se::Stream* stream) {
if (stream->ok()) {
+ VLOG(1) << stream->DebugStreamPointers()
+ << " StreamPool returning ok stream";
tensorflow::mutex_lock lock(mu_);
streams_.emplace_back(stream);
} else {
- // If the stream has encountered any errors, all subsequent
- // operations on it will fail. So just delete the stream, and rely
- // on new streams to be created in the future.
+ // If the stream has encountered any errors, all subsequent operations on it
+ // will fail. So just delete the stream, and rely on new streams to be
+ // created in the future.
+ VLOG(1) << stream->DebugStreamPointers()
+ << " StreamPool deleting !ok stream";
delete stream;
}
}