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

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 3 10:52:49 PST 2017


tra added inline comments.


================
Comment at: lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp:511-516
+    // Activate workers.
+    syncCTAThreads(CGF);
+
+    // Barrier at end of parallel region.
+    syncCTAThreads(CGF);
+
----------------
arpith-jacob wrote:
> 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.
OK. It may be good to add few comments documenting these assumptions (or point to existing docs) here.



https://reviews.llvm.org/D28145





More information about the cfe-commits mailing list