From 2b5a99b3d9bf3eb46cdf46bdde2678004dd6aa60 Mon Sep 17 00:00:00 2001 From: Johannes Doerfert Date: Mon, 19 Dec 2022 10:54:15 -0800 Subject: [PATCH] [OpenMP] Rename the `_OMP` namespace in the device runtime to `ompx` Differential Revision: https://reviews.llvm.org/D140334 --- openmp/libomptarget/DeviceRTL/include/Configuration.h | 4 ++-- openmp/libomptarget/DeviceRTL/include/Mapping.h | 4 ++-- openmp/libomptarget/DeviceRTL/include/State.h | 4 ++-- openmp/libomptarget/DeviceRTL/include/Synchronization.h | 4 ++-- openmp/libomptarget/DeviceRTL/include/Utils.h | 4 ++-- openmp/libomptarget/DeviceRTL/src/Configuration.cpp | 2 +- openmp/libomptarget/DeviceRTL/src/Debug.cpp | 2 +- openmp/libomptarget/DeviceRTL/src/Kernel.cpp | 2 +- openmp/libomptarget/DeviceRTL/src/Mapping.cpp | 6 +++--- openmp/libomptarget/DeviceRTL/src/Misc.cpp | 8 ++++---- openmp/libomptarget/DeviceRTL/src/Parallelism.cpp | 2 +- openmp/libomptarget/DeviceRTL/src/Reduction.cpp | 2 +- openmp/libomptarget/DeviceRTL/src/State.cpp | 6 +++--- openmp/libomptarget/DeviceRTL/src/Synchronization.cpp | 2 +- openmp/libomptarget/DeviceRTL/src/Tasking.cpp | 2 +- openmp/libomptarget/DeviceRTL/src/Utils.cpp | 2 +- openmp/libomptarget/DeviceRTL/src/Workshare.cpp | 2 +- 17 files changed, 29 insertions(+), 29 deletions(-) diff --git a/openmp/libomptarget/DeviceRTL/include/Configuration.h b/openmp/libomptarget/DeviceRTL/include/Configuration.h index 72514b8..09bce10 100644 --- a/openmp/libomptarget/DeviceRTL/include/Configuration.h +++ b/openmp/libomptarget/DeviceRTL/include/Configuration.h @@ -15,7 +15,7 @@ #include "Types.h" -namespace _OMP { +namespace ompx { namespace config { enum DebugKind : uint32_t { @@ -49,6 +49,6 @@ bool mayUseThreadStates(); bool mayUseNestedParallelism(); } // namespace config -} // namespace _OMP +} // namespace ompx #endif diff --git a/openmp/libomptarget/DeviceRTL/include/Mapping.h b/openmp/libomptarget/DeviceRTL/include/Mapping.h index c9e07ba..96314e4 100644 --- a/openmp/libomptarget/DeviceRTL/include/Mapping.h +++ b/openmp/libomptarget/DeviceRTL/include/Mapping.h @@ -14,7 +14,7 @@ #include "Types.h" -namespace _OMP { +namespace ompx { namespace mapping { @@ -97,6 +97,6 @@ uint32_t getNumberOfProcessorElements(); } // namespace mapping -} // namespace _OMP +} // namespace ompx #endif diff --git a/openmp/libomptarget/DeviceRTL/include/State.h b/openmp/libomptarget/DeviceRTL/include/State.h index b50ad4e..aac5a22 100644 --- a/openmp/libomptarget/DeviceRTL/include/State.h +++ b/openmp/libomptarget/DeviceRTL/include/State.h @@ -19,7 +19,7 @@ #pragma omp begin declare target device_type(nohost) -namespace _OMP { +namespace ompx { namespace memory { @@ -364,7 +364,7 @@ inline state::Value RunSched; } // namespace icv -} // namespace _OMP +} // namespace ompx #pragma omp end declare target diff --git a/openmp/libomptarget/DeviceRTL/include/Synchronization.h b/openmp/libomptarget/DeviceRTL/include/Synchronization.h index 0740a65..4b8068f 100644 --- a/openmp/libomptarget/DeviceRTL/include/Synchronization.h +++ b/openmp/libomptarget/DeviceRTL/include/Synchronization.h @@ -14,7 +14,7 @@ #include "Types.h" -namespace _OMP { +namespace ompx { namespace synchronize { @@ -124,6 +124,6 @@ void system(atomic::OrderingTy Ordering); } // namespace fence -} // namespace _OMP +} // namespace ompx #endif diff --git a/openmp/libomptarget/DeviceRTL/include/Utils.h b/openmp/libomptarget/DeviceRTL/include/Utils.h index 84ffea6..94da763 100644 --- a/openmp/libomptarget/DeviceRTL/include/Utils.h +++ b/openmp/libomptarget/DeviceRTL/include/Utils.h @@ -16,7 +16,7 @@ #pragma omp begin declare target device_type(nohost) -namespace _OMP { +namespace ompx { namespace utils { /// Return the value \p Var from thread Id \p SrcLane in the warp if the thread @@ -89,7 +89,7 @@ __attribute__((loader_uninitialized)) static void *const UndefPtr; #define OMP_UNLIKELY(EXPR) __builtin_expect((bool)(EXPR), false) } // namespace utils -} // namespace _OMP +} // namespace ompx #pragma omp end declare target diff --git a/openmp/libomptarget/DeviceRTL/src/Configuration.cpp b/openmp/libomptarget/DeviceRTL/src/Configuration.cpp index a41574c..17613b0 100644 --- a/openmp/libomptarget/DeviceRTL/src/Configuration.cpp +++ b/openmp/libomptarget/DeviceRTL/src/Configuration.cpp @@ -16,7 +16,7 @@ #include "State.h" #include "Types.h" -using namespace _OMP; +using namespace ompx; #pragma omp begin declare target device_type(nohost) diff --git a/openmp/libomptarget/DeviceRTL/src/Debug.cpp b/openmp/libomptarget/DeviceRTL/src/Debug.cpp index c3ed85a..a1b289e 100644 --- a/openmp/libomptarget/DeviceRTL/src/Debug.cpp +++ b/openmp/libomptarget/DeviceRTL/src/Debug.cpp @@ -16,7 +16,7 @@ #include "Mapping.h" #include "Types.h" -using namespace _OMP; +using namespace ompx; #pragma omp begin declare target device_type(nohost) diff --git a/openmp/libomptarget/DeviceRTL/src/Kernel.cpp b/openmp/libomptarget/DeviceRTL/src/Kernel.cpp index 05bccdc..03c6aa4 100644 --- a/openmp/libomptarget/DeviceRTL/src/Kernel.cpp +++ b/openmp/libomptarget/DeviceRTL/src/Kernel.cpp @@ -17,7 +17,7 @@ #include "Synchronization.h" #include "Types.h" -using namespace _OMP; +using namespace ompx; #pragma omp begin declare target device_type(nohost) diff --git a/openmp/libomptarget/DeviceRTL/src/Mapping.cpp b/openmp/libomptarget/DeviceRTL/src/Mapping.cpp index 512577c..4a44c0b 100644 --- a/openmp/libomptarget/DeviceRTL/src/Mapping.cpp +++ b/openmp/libomptarget/DeviceRTL/src/Mapping.cpp @@ -19,9 +19,9 @@ #include "llvm/Frontend/OpenMP/OMPGridValues.h" -using namespace _OMP; +using namespace ompx; -namespace _OMP { +namespace ompx { namespace impl { // Forward declarations defined to be defined for AMDGCN and NVPTX. @@ -154,7 +154,7 @@ uint32_t getNumberOfWarpsInBlock() { uint32_t getWarpSize() { return getGridValue().GV_Warp_Size; } } // namespace impl -} // namespace _OMP +} // namespace ompx /// We have to be deliberate about the distinction of `mapping::` and `impl::` /// below to avoid repeating assumptions or including irrelevant ones. diff --git a/openmp/libomptarget/DeviceRTL/src/Misc.cpp b/openmp/libomptarget/DeviceRTL/src/Misc.cpp index 7166925..f9b89e7 100644 --- a/openmp/libomptarget/DeviceRTL/src/Misc.cpp +++ b/openmp/libomptarget/DeviceRTL/src/Misc.cpp @@ -15,7 +15,7 @@ #pragma omp begin declare target device_type(nohost) -namespace _OMP { +namespace ompx { namespace impl { double getWTick(); @@ -59,7 +59,7 @@ double getWTime() { #pragma omp end declare variant } // namespace impl -} // namespace _OMP +} // namespace ompx /// Interfaces /// @@ -76,9 +76,9 @@ int32_t __kmpc_cancel(IdentTy *, int32_t, int32_t) { return 0; } -double omp_get_wtick(void) { return _OMP::impl::getWTick(); } +double omp_get_wtick(void) { return ompx::impl::getWTick(); } -double omp_get_wtime(void) { return _OMP::impl::getWTime(); } +double omp_get_wtime(void) { return ompx::impl::getWTime(); } } ///} diff --git a/openmp/libomptarget/DeviceRTL/src/Parallelism.cpp b/openmp/libomptarget/DeviceRTL/src/Parallelism.cpp index 5ebf368..1fec2e3 100644 --- a/openmp/libomptarget/DeviceRTL/src/Parallelism.cpp +++ b/openmp/libomptarget/DeviceRTL/src/Parallelism.cpp @@ -40,7 +40,7 @@ #include "Types.h" #include "Utils.h" -using namespace _OMP; +using namespace ompx; #pragma omp begin declare target device_type(nohost) diff --git a/openmp/libomptarget/DeviceRTL/src/Reduction.cpp b/openmp/libomptarget/DeviceRTL/src/Reduction.cpp index 523a4e4..db40185 100644 --- a/openmp/libomptarget/DeviceRTL/src/Reduction.cpp +++ b/openmp/libomptarget/DeviceRTL/src/Reduction.cpp @@ -18,7 +18,7 @@ #include "Types.h" #include "Utils.h" -using namespace _OMP; +using namespace ompx; namespace { diff --git a/openmp/libomptarget/DeviceRTL/src/State.cpp b/openmp/libomptarget/DeviceRTL/src/State.cpp index fafe22b..aaf81b9 100644 --- a/openmp/libomptarget/DeviceRTL/src/State.cpp +++ b/openmp/libomptarget/DeviceRTL/src/State.cpp @@ -17,7 +17,7 @@ #include "Types.h" #include "Utils.h" -using namespace _OMP; +using namespace ompx; #pragma omp begin declare target device_type(nohost) @@ -221,8 +221,8 @@ void state::TeamStateTy::assertEqual(TeamStateTy &Other) const { ASSERT(HasThreadState == Other.HasThreadState); } -state::TeamStateTy SHARED(_OMP::state::TeamState); -state::ThreadStateTy **SHARED(_OMP::state::ThreadStates); +state::TeamStateTy SHARED(ompx::state::TeamState); +state::ThreadStateTy **SHARED(ompx::state::ThreadStates); namespace { diff --git a/openmp/libomptarget/DeviceRTL/src/Synchronization.cpp b/openmp/libomptarget/DeviceRTL/src/Synchronization.cpp index 4b16e2e..2cfd0cce 100644 --- a/openmp/libomptarget/DeviceRTL/src/Synchronization.cpp +++ b/openmp/libomptarget/DeviceRTL/src/Synchronization.cpp @@ -21,7 +21,7 @@ #pragma omp begin declare target device_type(nohost) -using namespace _OMP; +using namespace ompx; namespace impl { diff --git a/openmp/libomptarget/DeviceRTL/src/Tasking.cpp b/openmp/libomptarget/DeviceRTL/src/Tasking.cpp index 06804e0..ad26b02 100644 --- a/openmp/libomptarget/DeviceRTL/src/Tasking.cpp +++ b/openmp/libomptarget/DeviceRTL/src/Tasking.cpp @@ -18,7 +18,7 @@ #include "Types.h" #include "Utils.h" -using namespace _OMP; +using namespace ompx; #pragma omp begin declare target device_type(nohost) diff --git a/openmp/libomptarget/DeviceRTL/src/Utils.cpp b/openmp/libomptarget/DeviceRTL/src/Utils.cpp index e4920ab..4565ebf 100644 --- a/openmp/libomptarget/DeviceRTL/src/Utils.cpp +++ b/openmp/libomptarget/DeviceRTL/src/Utils.cpp @@ -17,7 +17,7 @@ #pragma omp begin declare target device_type(nohost) -using namespace _OMP; +using namespace ompx; extern "C" __attribute__((weak)) int IsSPMDMode; diff --git a/openmp/libomptarget/DeviceRTL/src/Workshare.cpp b/openmp/libomptarget/DeviceRTL/src/Workshare.cpp index ddcb41c..e37e595 100644 --- a/openmp/libomptarget/DeviceRTL/src/Workshare.cpp +++ b/openmp/libomptarget/DeviceRTL/src/Workshare.cpp @@ -20,7 +20,7 @@ #include "Types.h" #include "Utils.h" -using namespace _OMP; +using namespace ompx; // TODO: struct DynamicScheduleTracker { -- 2.7.4