[Parallel_libs-commits] [PATCH] D24063: [StreamExecutor] Add Stream::blockHostUntilDone

Jason Henline via Parallel_libs-commits parallel_libs-commits at lists.llvm.org
Tue Aug 30 16:55:04 PDT 2016


jhen created this revision.
jhen added a reviewer: jlebar.
jhen added subscribers: parallel_libs-commits, jprice.

Add the type-safe wrapper to the platform-specific implementation.

https://reviews.llvm.org/D24063

Files:
  streamexecutor/include/streamexecutor/Stream.h

Index: streamexecutor/include/streamexecutor/Stream.h
===================================================================
--- streamexecutor/include/streamexecutor/Stream.h
+++ streamexecutor/include/streamexecutor/Stream.h
@@ -78,7 +78,16 @@
       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.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D24063.69783.patch
Type: text/x-patch
Size: 739 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/parallel_libs-commits/attachments/20160830/58512b4b/attachment.bin>


More information about the Parallel_libs-commits mailing list