aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/stream_executor/stream.h
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2017-03-02 16:41:09 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-03-02 17:06:14 -0800
commit112a534b50c0a23dec95382941ac0556f2866b29 (patch)
tree576a4f7b5ef3cb14966d63208c0a9be54c022da0 /tensorflow/stream_executor/stream.h
parentd2d5f1985de99777f97902b9fb6466a7c3eb3d1c (diff)
[XLA:GPU] Cache GPU substreams across executions
Change: 149063035
Diffstat (limited to 'tensorflow/stream_executor/stream.h')
-rw-r--r--tensorflow/stream_executor/stream.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/tensorflow/stream_executor/stream.h b/tensorflow/stream_executor/stream.h
index c7ca7ad050..2045e8a1c2 100644
--- a/tensorflow/stream_executor/stream.h
+++ b/tensorflow/stream_executor/stream.h
@@ -194,8 +194,15 @@ class Stream {
// Waits for all streams values in others.
// Checks that there is no shallow circular wait (i.e. that "this" is not in
- // others).
- Stream &ThenWaitFor(std::vector<std::unique_ptr<Stream>> *others);
+ // others)
+ template <typename P>
+ Stream &ThenWaitFor(P others) {
+ for (auto &stream : *others) {
+ CHECK_NE(stream.get(), this);
+ ThenWaitFor(stream.get());
+ }
+ return *this;
+ }
// Waits for an event object to be set.
// Note that ThenRecordEvent must have been called on the event before