summaryrefslogtreecommitdiff
path: root/parallel-libs
diff options
context:
space:
mode:
authorJason Henline <jhen@google.com>2016-08-31 00:11:14 +0000
committerJason Henline <jhen@google.com>2016-08-31 00:11:14 +0000
commit5536cb27d1d3d1087f322410b097b93d796db641 (patch)
treed32cf18423c970f08e24e27fca5ab4139fd2cca4 /parallel-libs
parenta32333535e8caa36614ece6f009e13204a3ee02d (diff)
[StreamExecutor] Add Stream::blockHostUntilDone
Summary: Add the type-safe wrapper to the platform-specific implementation. Reviewers: jlebar Subscribers: jprice, parallel_libs-commits Differential Revision: https://reviews.llvm.org/D24063
Diffstat (limited to 'parallel-libs')
-rw-r--r--parallel-libs/streamexecutor/include/streamexecutor/Stream.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/parallel-libs/streamexecutor/include/streamexecutor/Stream.h b/parallel-libs/streamexecutor/include/streamexecutor/Stream.h
index 2937c5842e8..d1c82f9e5ea 100644
--- a/parallel-libs/streamexecutor/include/streamexecutor/Stream.h
+++ b/parallel-libs/streamexecutor/include/streamexecutor/Stream.h
@@ -78,7 +78,16 @@ public:
return make_error(*ErrorMessage);
else
return Error::success();
- };
+ }
+
+ // Blocks the calling host thread until all work enqueued on this Stream
+ // completes.
+ //
+ // Returns the result of getStatus() after the Stream work completes.
+ Error blockHostUntilDone() {
+ setError(PDevice->blockHostUntilDone(ThePlatformStream.get()));
+ return getStatus();
+ }
/// Entrains onto the stream of operations a kernel launch with the given
/// arguments.