[Openmp-commits] [openmp] r369933 - [OPENMP][NVPTX]Add __kmpc_syncwarp(int32_t) function.
Alexey Bataev via Openmp-commits
openmp-commits at lists.llvm.org
Mon Aug 26 10:32:45 PDT 2019
Author: abataev
Date: Mon Aug 26 10:32:45 2019
New Revision: 369933
URL: http://llvm.org/viewvc/llvm-project?rev=369933&view=rev
Log:
[OPENMP][NVPTX]Add __kmpc_syncwarp(int32_t) function.
Summary:
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.
Reviewers: grokos, jdoerfert
Subscribers: guansong, openmp-commits, kkwli0, caomhin
Tags: #openmp
Differential Revision: https://reviews.llvm.org/D66672
Modified:
openmp/trunk/libomptarget/deviceRTLs/nvptx/src/interface.h
openmp/trunk/libomptarget/deviceRTLs/nvptx/src/sync.cu
openmp/trunk/libomptarget/deviceRTLs/nvptx/src/target_impl.h
Modified: openmp/trunk/libomptarget/deviceRTLs/nvptx/src/interface.h
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/libomptarget/deviceRTLs/nvptx/src/interface.h?rev=369933&r1=369932&r2=369933&view=diff
==============================================================================
--- openmp/trunk/libomptarget/deviceRTLs/nvptx/src/interface.h (original)
+++ openmp/trunk/libomptarget/deviceRTLs/nvptx/src/interface.h Mon Aug 26 10:32:45 2019
@@ -423,6 +423,8 @@ EXTERN void __kmpc_flush(kmp_Ident *loc)
// 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,
Modified: openmp/trunk/libomptarget/deviceRTLs/nvptx/src/sync.cu
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/libomptarget/deviceRTLs/nvptx/src/sync.cu?rev=369933&r1=369932&r2=369933&view=diff
==============================================================================
--- openmp/trunk/libomptarget/deviceRTLs/nvptx/src/sync.cu (original)
+++ openmp/trunk/libomptarget/deviceRTLs/nvptx/src/sync.cu Mon Aug 26 10:32:45 2019
@@ -11,6 +11,7 @@
//===----------------------------------------------------------------------===//
#include "omptarget-nvptx.h"
+#include "target_impl.h"
////////////////////////////////////////////////////////////////////////////////
// KMP Ordered calls
@@ -144,3 +145,12 @@ EXTERN int32_t __kmpc_warp_active_thread
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");
+ __kmpc_impl_syncwarp(Mask);
+}
Modified: openmp/trunk/libomptarget/deviceRTLs/nvptx/src/target_impl.h
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/libomptarget/deviceRTLs/nvptx/src/target_impl.h?rev=369933&r1=369932&r2=369933&view=diff
==============================================================================
--- openmp/trunk/libomptarget/deviceRTLs/nvptx/src/target_impl.h (original)
+++ openmp/trunk/libomptarget/deviceRTLs/nvptx/src/target_impl.h Mon Aug 26 10:32:45 2019
@@ -38,4 +38,6 @@ INLINE int __kmpc_impl_ffs(uint32_t x) {
INLINE int __kmpc_impl_popc(uint32_t x) { return __popc(x); }
+INLINE void __kmpc_impl_syncwarp(int32_t Mask) { __SYNCWARP(Mask); }
+
#endif
More information about the Openmp-commits
mailing list