[PATCH] D28145: [OpenMP] Basic support for a parallel directive in a target region on an NVPTX device.

Arpith Jacob via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 3 10:37:56 PST 2017


arpith-jacob added inline comments.


================
Comment at: lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp:511-516
+    // Activate workers.
+    syncCTAThreads(CGF);
+
+    // Barrier at end of parallel region.
+    syncCTAThreads(CGF);
+
----------------
tra wrote:
> Are two back-to-back syncCTAThreads() intentional or did you mean to call something else to activate workers?
Intentional.  The first wakes up worker warps to execute the parallel region.  The second is for the master warp to wait until the region has completed execution.  This is to implement the semantics of an implicit barrier at the end of an OpenMP parallel region.


https://reviews.llvm.org/D28145





More information about the cfe-commits mailing list