diff options
author | Jason Henline <jhen@google.com> | 2016-08-31 00:11:14 +0000 |
---|---|---|
committer | Jason Henline <jhen@google.com> | 2016-08-31 00:11:14 +0000 |
commit | ba65d4412e9a4d33cdbf464273f5ea35e312acdb (patch) | |
tree | 849933159b2f4e4e6e20674c61db057a147085da /parallel-libs | |
parent | 8938f92a5e126554776c13fe4fcaa9d41170ff62 (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
llvm-svn: 280182
Diffstat (limited to 'parallel-libs')
-rw-r--r-- | parallel-libs/streamexecutor/include/streamexecutor/Stream.h | 11 |
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 2937c5842e8e..d1c82f9e5ea0 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. |