[Parallel_libs-commits] [parallel-libs] r280182 - [StreamExecutor] Add Stream::blockHostUntilDone

Jason Henline via Parallel_libs-commits parallel_libs-commits at lists.llvm.org
Tue Aug 30 17:11:14 PDT 2016


Author: jhen
Date: Tue Aug 30 19:11:14 2016
New Revision: 280182

URL: http://llvm.org/viewvc/llvm-project?rev=280182&view=rev
Log:
[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

Modified:
    parallel-libs/trunk/streamexecutor/include/streamexecutor/Stream.h

Modified: parallel-libs/trunk/streamexecutor/include/streamexecutor/Stream.h
URL: http://llvm.org/viewvc/llvm-project/parallel-libs/trunk/streamexecutor/include/streamexecutor/Stream.h?rev=280182&r1=280181&r2=280182&view=diff
==============================================================================
--- parallel-libs/trunk/streamexecutor/include/streamexecutor/Stream.h (original)
+++ parallel-libs/trunk/streamexecutor/include/streamexecutor/Stream.h Tue Aug 30 19:11:14 2016
@@ -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.




More information about the Parallel_libs-commits mailing list