[Openmp-commits] [openmp] 4887752 - [OpenMP] Remove obsolete external interface for device RT

Johannes Doerfert via Openmp-commits openmp-commits at lists.llvm.org
Wed Oct 27 16:22:49 PDT 2021


Author: Johannes Doerfert
Date: 2021-10-27T18:22:35-05:00
New Revision: 48877525cfe85104b5f7d53a045bc22abd66bd20

URL: https://github.com/llvm/llvm-project/commit/48877525cfe85104b5f7d53a045bc22abd66bd20
DIFF: https://github.com/llvm/llvm-project/commit/48877525cfe85104b5f7d53a045bc22abd66bd20.diff

LOG: [OpenMP] Remove obsolete external interface for device RT

We do not generate _serialized_parallel calls in device mode, no
need for an external API.

Reviewed By: JonChesterfield

Differential Revision: https://reviews.llvm.org/D112145

Added: 
    

Modified: 
    openmp/libomptarget/DeviceRTL/include/Interface.h
    openmp/libomptarget/DeviceRTL/src/Parallelism.cpp
    openmp/libomptarget/deviceRTLs/common/src/parallel.cu
    openmp/libomptarget/deviceRTLs/interface.h

Removed: 
    


################################################################################
diff  --git a/openmp/libomptarget/DeviceRTL/include/Interface.h b/openmp/libomptarget/DeviceRTL/include/Interface.h
index c7bfede8bbd4..da04e143124b 100644
--- a/openmp/libomptarget/DeviceRTL/include/Interface.h
+++ b/openmp/libomptarget/DeviceRTL/include/Interface.h
@@ -280,12 +280,6 @@ bool __kmpc_kernel_parallel(ParallelRegionFnTy *WorkFn);
 /// TODO
 void __kmpc_kernel_end_parallel();
 
-/// TODO
-void __kmpc_serialized_parallel(IdentTy *Loc, uint32_t);
-
-/// TODO
-void __kmpc_end_serialized_parallel(IdentTy *Loc, uint32_t);
-
 /// TODO
 void __kmpc_push_proc_bind(IdentTy *Loc, uint32_t TId, int ProcBind);
 

diff  --git a/openmp/libomptarget/DeviceRTL/src/Parallelism.cpp b/openmp/libomptarget/DeviceRTL/src/Parallelism.cpp
index bfdee1ca6c23..e80f046aa49b 100644
--- a/openmp/libomptarget/DeviceRTL/src/Parallelism.cpp
+++ b/openmp/libomptarget/DeviceRTL/src/Parallelism.cpp
@@ -85,9 +85,10 @@ void __kmpc_parallel_51(IdentTy *ident, int32_t, int32_t if_expr,
   uint32_t TId = mapping::getThreadIdInBlock();
   // Handle the serialized case first, same for SPMD/non-SPMD.
   if (OMP_UNLIKELY(!if_expr || icv::Level)) {
-    __kmpc_serialized_parallel(ident, TId);
+    state::enterDataEnvironment();
+    ++icv::Level;
     invokeMicrotask(TId, 0, fn, args, nargs);
-    __kmpc_end_serialized_parallel(ident, TId);
+    state::exitDataEnvironment();
     return;
   }
 
@@ -192,15 +193,6 @@ __attribute__((noinline)) void __kmpc_kernel_end_parallel() {
   ASSERT(!mapping::isSPMDMode());
 }
 
-void __kmpc_serialized_parallel(IdentTy *, uint32_t TId) {
-  state::enterDataEnvironment();
-  ++icv::Level;
-}
-
-void __kmpc_end_serialized_parallel(IdentTy *, uint32_t TId) {
-  state::exitDataEnvironment();
-}
-
 uint16_t __kmpc_parallel_level(IdentTy *, uint32_t) { return omp_get_level(); }
 
 int32_t __kmpc_global_thread_num(IdentTy *) { return omp_get_thread_num(); }

diff  --git a/openmp/libomptarget/deviceRTLs/common/src/parallel.cu b/openmp/libomptarget/deviceRTLs/common/src/parallel.cu
index b12d5ccb5a17..c064bd588938 100644
--- a/openmp/libomptarget/deviceRTLs/common/src/parallel.cu
+++ b/openmp/libomptarget/deviceRTLs/common/src/parallel.cu
@@ -177,8 +177,8 @@ EXTERN void __kmpc_kernel_end_parallel() {
 // support for parallel that goes sequential
 ////////////////////////////////////////////////////////////////////////////////
 
-EXTERN void __kmpc_serialized_parallel(kmp_Ident *loc, uint32_t global_tid) {
-  PRINT0(LD_IO, "call to __kmpc_serialized_parallel\n");
+static void serializedParallel(kmp_Ident *loc, uint32_t global_tid) {
+  PRINT0(LD_IO, "call to serializedParallel\n");
 
   IncParallelLevel(/*ActiveParallel=*/false, __kmpc_impl_activemask());
 
@@ -215,9 +215,9 @@ EXTERN void __kmpc_serialized_parallel(kmp_Ident *loc, uint32_t global_tid) {
                                                              newTaskDescr);
 }
 
-EXTERN void __kmpc_end_serialized_parallel(kmp_Ident *loc,
+static void endSerializedParallel(kmp_Ident *loc,
                                            uint32_t global_tid) {
-  PRINT0(LD_IO, "call to __kmpc_end_serialized_parallel\n");
+  PRINT0(LD_IO, "call to endSerializedParallel\n");
 
   DecParallelLevel(/*ActiveParallel=*/false, __kmpc_impl_activemask());
 
@@ -293,9 +293,9 @@ NOINLINE EXTERN void __kmpc_parallel_51(kmp_Ident *ident, kmp_int32 global_tid,
   bool InParallelRegion =
       (__kmpc_parallel_level() > __kmpc_is_spmd_exec_mode());
   if (!if_expr || InParallelRegion) {
-    __kmpc_serialized_parallel(ident, global_tid);
+    serializedParallel(ident, global_tid);
     __kmp_invoke_microtask(global_tid, 0, fn, args, nargs);
-    __kmpc_end_serialized_parallel(ident, global_tid);
+    endSerializedParallel(ident, global_tid);
     return;
   }
 

diff  --git a/openmp/libomptarget/deviceRTLs/interface.h b/openmp/libomptarget/deviceRTLs/interface.h
index f414e274a7a7..cb193c9ca9cc 100644
--- a/openmp/libomptarget/deviceRTLs/interface.h
+++ b/openmp/libomptarget/deviceRTLs/interface.h
@@ -222,8 +222,6 @@ typedef int32_t kmp_CriticalName[8];
 EXTERN int32_t __kmpc_global_thread_num(kmp_Ident *loc);
 EXTERN void __kmpc_push_num_threads(kmp_Ident *loc, int32_t global_tid,
                                     int32_t num_threads);
-EXTERN void __kmpc_serialized_parallel(kmp_Ident *loc, uint32_t global_tid);
-EXTERN void __kmpc_end_serialized_parallel(kmp_Ident *loc, uint32_t global_tid);
 NOINLINE EXTERN uint8_t __kmpc_parallel_level();
 
 // proc bind


        


More information about the Openmp-commits mailing list