[Openmp-commits] [openmp] 89a2bef - [libomptarget][nvptx] Fix build, symbol ordering in target_impl.h

Jon Chesterfield via Openmp-commits openmp-commits at lists.llvm.org
Wed Dec 18 17:51:51 PST 2019


Author: Jon Chesterfield
Date: 2019-12-19T01:50:06Z
New Revision: 89a2bef27aae0e1a7a110a95d3a6869c5561c90f

URL: https://github.com/llvm/llvm-project/commit/89a2bef27aae0e1a7a110a95d3a6869c5561c90f
DIFF: https://github.com/llvm/llvm-project/commit/89a2bef27aae0e1a7a110a95d3a6869c5561c90f.diff

LOG: [libomptarget][nvptx] Fix build, symbol ordering in target_impl.h

Added: 
    

Modified: 
    openmp/libomptarget/deviceRTLs/amdgcn/src/target_impl.h
    openmp/libomptarget/deviceRTLs/nvptx/src/target_impl.h

Removed: 
    


################################################################################
diff  --git a/openmp/libomptarget/deviceRTLs/amdgcn/src/target_impl.h b/openmp/libomptarget/deviceRTLs/amdgcn/src/target_impl.h
index e0d6bb1953c1..4e8232974e70 100644
--- a/openmp/libomptarget/deviceRTLs/amdgcn/src/target_impl.h
+++ b/openmp/libomptarget/deviceRTLs/amdgcn/src/target_impl.h
@@ -101,8 +101,6 @@ INLINE __kmpc_impl_lanemask_t __kmpc_impl_lanemask_gt() {
   return __lanemask_gt();
 }
 
-EXTERN bool __kmpc_impl_is_first_active_thread();
-
 INLINE uint32_t __kmpc_impl_smid() {
   return __smid();
 }
@@ -126,6 +124,8 @@ INLINE __kmpc_impl_lanemask_t __kmpc_impl_activemask() {
   return __ballot64(1);
 }
 
+EXTERN bool __kmpc_impl_is_first_active_thread();
+
 EXTERN int32_t __kmpc_impl_shfl_sync(__kmpc_impl_lanemask_t, int32_t Var,
                                      int32_t SrcLane);
 

diff  --git a/openmp/libomptarget/deviceRTLs/nvptx/src/target_impl.h b/openmp/libomptarget/deviceRTLs/nvptx/src/target_impl.h
index 6f6c38956a94..8461a93913a3 100644
--- a/openmp/libomptarget/deviceRTLs/nvptx/src/target_impl.h
+++ b/openmp/libomptarget/deviceRTLs/nvptx/src/target_impl.h
@@ -94,15 +94,6 @@ INLINE __kmpc_impl_lanemask_t __kmpc_impl_lanemask_gt() {
   return res;
 }
 
-// Return true if this is the first active thread in the warp.
-INLINE bool __kmpc_impl_is_first_active_thread() {
-  unsigned long long Mask = __kmpc_impl_activemask();
-  unsigned long long ShNum = WARPSIZE - (GetThreadIdInBlock() % WARPSIZE);
-  unsigned long long Sh = Mask << ShNum;
-  // Truncate Sh to the 32 lower bits
-  return (unsigned)Sh == 0;
-}
-
 INLINE uint32_t __kmpc_impl_smid() {
   uint32_t id;
   asm("mov.u32 %0, %%smid;" : "=r"(id));
@@ -142,6 +133,15 @@ INLINE __kmpc_impl_lanemask_t __kmpc_impl_activemask() {
 #endif
 }
 
+// Return true if this is the first active thread in the warp.
+INLINE bool __kmpc_impl_is_first_active_thread() {
+  unsigned long long Mask = __kmpc_impl_activemask();
+  unsigned long long ShNum = WARPSIZE - (GetThreadIdInBlock() % WARPSIZE);
+  unsigned long long Sh = Mask << ShNum;
+  // Truncate Sh to the 32 lower bits
+  return (unsigned)Sh == 0;
+}
+
 // In Cuda 9.0, the *_sync() version takes an extra argument 'mask'.
 
 INLINE int32_t __kmpc_impl_shfl_sync(__kmpc_impl_lanemask_t Mask, int32_t Var,


        


More information about the Openmp-commits mailing list