[Openmp-commits] [PATCH] D66672: [OPENMP][NVPTX]Add __kmpc_syncwarp(int32_t) function.

Alexey Bataev via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Fri Aug 23 12:01:41 PDT 2019


ABataev created this revision.
ABataev added a reviewer: grokos.
Herald added a subscriber: guansong.
Herald added a reviewer: jdoerfert.
Herald added a project: OpenMP.

Added function void __kmpc_syncwarp(int32_t) to expose it to the
compiler. It is required to fix the problem with the critical regions in
Cuda9.0+. We cannot use barrier in the critical region, but still need
to reconverge the threads in the warp after. This function allows to do
this.


Repository:
  rOMP OpenMP

https://reviews.llvm.org/D66672

Files:
  libomptarget/deviceRTLs/nvptx/src/interface.h
  libomptarget/deviceRTLs/nvptx/src/sync.cu


Index: libomptarget/deviceRTLs/nvptx/src/sync.cu
===================================================================
--- libomptarget/deviceRTLs/nvptx/src/sync.cu
+++ libomptarget/deviceRTLs/nvptx/src/sync.cu
@@ -144,3 +144,12 @@
   PRINT0(LD_IO, "call __kmpc_warp_active_thread_mask\n");
   return __ACTIVEMASK();
 }
+
+////////////////////////////////////////////////////////////////////////////////
+// Syncwarp
+////////////////////////////////////////////////////////////////////////////////
+
+EXTERN void __kmpc_syncwarp(int32_t Mask) {
+  PRINT0(LD_IO, "call __kmpc_syncwarp\n");
+  __SYNCWARP(Mask);
+}
Index: libomptarget/deviceRTLs/nvptx/src/interface.h
===================================================================
--- libomptarget/deviceRTLs/nvptx/src/interface.h
+++ libomptarget/deviceRTLs/nvptx/src/interface.h
@@ -423,6 +423,8 @@
 
 // vote
 EXTERN int32_t __kmpc_warp_active_thread_mask();
+// syncwarp
+EXTERN void __kmpc_syncwarp(int32_t);
 
 // tasks
 EXTERN kmp_TaskDescr *__kmpc_omp_task_alloc(kmp_Ident *loc,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D66672.216917.patch
Type: text/x-patch
Size: 1039 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20190823/e6eda3ac/attachment.bin>


More information about the Openmp-commits mailing list