[Openmp-commits] [openmp] [OpenMP][NFC] Move Environment.h and SourceInfo.h into "Shared" inclu… (PR #73703)

via Openmp-commits openmp-commits at lists.llvm.org
Tue Nov 28 13:48:06 PST 2023


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-openmp

Author: Johannes Doerfert (jdoerfert)

<details>
<summary>Changes</summary>

…de folder

---
Full diff: https://github.com/llvm/llvm-project/pull/73703.diff


16 Files Affected:

- (modified) openmp/libomptarget/DeviceRTL/include/Configuration.h (+2-1) 
- (modified) openmp/libomptarget/DeviceRTL/include/Interface.h (+2-1) 
- (modified) openmp/libomptarget/DeviceRTL/include/State.h (+2-1) 
- (modified) openmp/libomptarget/DeviceRTL/src/Allocator.cpp (+2-1) 
- (modified) openmp/libomptarget/DeviceRTL/src/Debug.cpp (+2-1) 
- (modified) openmp/libomptarget/DeviceRTL/src/Kernel.cpp (+2-1) 
- (modified) openmp/libomptarget/DeviceRTL/src/State.cpp (+3-2) 
- (renamed) openmp/libomptarget/include/Shared/Environment.h (+4-4) 
- (renamed) openmp/libomptarget/include/Shared/SourceInfo.h (+4-4) 
- (modified) openmp/libomptarget/include/omptarget.h (+2-3) 
- (modified) openmp/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp (+1-1) 
- (modified) openmp/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.cpp (+1-1) 
- (modified) openmp/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.h (+1-1) 
- (modified) openmp/libomptarget/plugins-nextgen/cuda/src/rtl.cpp (+1-1) 
- (modified) openmp/libomptarget/plugins-nextgen/generic-elf-64bit/src/rtl.cpp (+1-1) 
- (modified) openmp/libomptarget/src/private.h (+1-1) 


``````````diff
diff --git a/openmp/libomptarget/DeviceRTL/include/Configuration.h b/openmp/libomptarget/DeviceRTL/include/Configuration.h
index 45e5cead231f724..c9f8f2500e031d8 100644
--- a/openmp/libomptarget/DeviceRTL/include/Configuration.h
+++ b/openmp/libomptarget/DeviceRTL/include/Configuration.h
@@ -13,7 +13,8 @@
 #ifndef OMPTARGET_CONFIGURATION_H
 #define OMPTARGET_CONFIGURATION_H
 
-#include "Environment.h"
+#include "Shared/Environment.h"
+
 #include "Types.h"
 
 namespace ompx {
diff --git a/openmp/libomptarget/DeviceRTL/include/Interface.h b/openmp/libomptarget/DeviceRTL/include/Interface.h
index 54c3b3aea93cb03..f4854ed3d16787f 100644
--- a/openmp/libomptarget/DeviceRTL/include/Interface.h
+++ b/openmp/libomptarget/DeviceRTL/include/Interface.h
@@ -12,7 +12,8 @@
 #ifndef OMPTARGET_DEVICERTL_INTERFACE_H
 #define OMPTARGET_DEVICERTL_INTERFACE_H
 
-#include "Environment.h"
+#include "Shared/Environment.h"
+
 #include "Types.h"
 
 /// External API
diff --git a/openmp/libomptarget/DeviceRTL/include/State.h b/openmp/libomptarget/DeviceRTL/include/State.h
index 1d73bdc4f5409cb..c93de4191f83fad 100644
--- a/openmp/libomptarget/DeviceRTL/include/State.h
+++ b/openmp/libomptarget/DeviceRTL/include/State.h
@@ -12,8 +12,9 @@
 #ifndef OMPTARGET_STATE_H
 #define OMPTARGET_STATE_H
 
+#include "Shared/Environment.h"
+
 #include "Debug.h"
-#include "Environment.h"
 #include "Mapping.h"
 #include "Types.h"
 #include "Utils.h"
diff --git a/openmp/libomptarget/DeviceRTL/src/Allocator.cpp b/openmp/libomptarget/DeviceRTL/src/Allocator.cpp
index 7a4cbfe60dd026c..c9c940de62c1a6c 100644
--- a/openmp/libomptarget/DeviceRTL/src/Allocator.cpp
+++ b/openmp/libomptarget/DeviceRTL/src/Allocator.cpp
@@ -8,9 +8,10 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "Shared/Environment.h"
+
 #include "Allocator.h"
 #include "Configuration.h"
-#include "Environment.h"
 #include "Mapping.h"
 #include "Synchronization.h"
 #include "Types.h"
diff --git a/openmp/libomptarget/DeviceRTL/src/Debug.cpp b/openmp/libomptarget/DeviceRTL/src/Debug.cpp
index dd627fc65d8f64d..83f37ac587bb1c1 100644
--- a/openmp/libomptarget/DeviceRTL/src/Debug.cpp
+++ b/openmp/libomptarget/DeviceRTL/src/Debug.cpp
@@ -10,9 +10,10 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "Shared/Environment.h"
+
 #include "Debug.h"
 #include "Configuration.h"
-#include "Environment.h"
 #include "Interface.h"
 #include "Mapping.h"
 #include "State.h"
diff --git a/openmp/libomptarget/DeviceRTL/src/Kernel.cpp b/openmp/libomptarget/DeviceRTL/src/Kernel.cpp
index f7d8ff8e565c185..06b12fec21677c6 100644
--- a/openmp/libomptarget/DeviceRTL/src/Kernel.cpp
+++ b/openmp/libomptarget/DeviceRTL/src/Kernel.cpp
@@ -10,9 +10,10 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "Shared/Environment.h"
+
 #include "Allocator.h"
 #include "Debug.h"
-#include "Environment.h"
 #include "Interface.h"
 #include "Mapping.h"
 #include "State.h"
diff --git a/openmp/libomptarget/DeviceRTL/src/State.cpp b/openmp/libomptarget/DeviceRTL/src/State.cpp
index f8a6d333df0d9ed..40f99e07b44c1c3 100644
--- a/openmp/libomptarget/DeviceRTL/src/State.cpp
+++ b/openmp/libomptarget/DeviceRTL/src/State.cpp
@@ -8,14 +8,15 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "State.h"
+#include "Shared/Environment.h"
+
 #include "Allocator.h"
 #include "Configuration.h"
 #include "Debug.h"
-#include "Environment.h"
 #include "Interface.h"
 #include "LibC.h"
 #include "Mapping.h"
+#include "State.h"
 #include "Synchronization.h"
 #include "Types.h"
 #include "Utils.h"
diff --git a/openmp/libomptarget/include/Environment.h b/openmp/libomptarget/include/Shared/Environment.h
similarity index 94%
rename from openmp/libomptarget/include/Environment.h
rename to openmp/libomptarget/include/Shared/Environment.h
index 3f3dce692f788db..d141146b6bd5a15 100644
--- a/openmp/libomptarget/include/Environment.h
+++ b/openmp/libomptarget/include/Shared/Environment.h
@@ -1,4 +1,4 @@
-//===------------ Environment.h - OpenMP GPU environments --------- C++ -*-===//
+//===-- Shared/Environment.h - OpenMP GPU environments ------------ C++ -*-===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -10,8 +10,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _OMPTARGET_ENVIRONMENT_H_
-#define _OMPTARGET_ENVIRONMENT_H_
+#ifndef OMPTARGET_SHARED_ENVIRONMENT_H
+#define OMPTARGET_SHARED_ENVIRONMENT_H
 
 #ifdef OMPTARGET_DEVICE_RUNTIME
 #include "Types.h"
@@ -105,4 +105,4 @@ struct KernelLaunchEnvironmentTy {
   void *ReductionBuffer = nullptr;
 };
 
-#endif // _OMPTARGET_ENVIRONMENT_H_
+#endif // OMPTARGET_SHARED_ENVIRONMENT_H
diff --git a/openmp/libomptarget/include/SourceInfo.h b/openmp/libomptarget/include/Shared/SourceInfo.h
similarity index 94%
rename from openmp/libomptarget/include/SourceInfo.h
rename to openmp/libomptarget/include/Shared/SourceInfo.h
index d508f6d6bc993a5..7ce5fd43efc07fe 100644
--- a/openmp/libomptarget/include/SourceInfo.h
+++ b/openmp/libomptarget/include/Shared/SourceInfo.h
@@ -1,4 +1,4 @@
-//===------- SourceInfo.h - Target independent OpenMP target RTL -- C++ -*-===//
+//===-- SharedSourceInfo.h - Target independent OpenMP target RTL - C++ -*-===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -10,8 +10,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _SOURCE_INFO_H_
-#define _SOURCE_INFO_H_
+#ifndef OMPTARGET_SHARED_SOURCE_INFO_H
+#define OMPTARGET_SHARED_SOURCE_INFO_H
 
 #include <string>
 
@@ -110,4 +110,4 @@ static inline std::string getNameFromMapping(const map_var_info_t Name) {
   return NameStr.substr(Begin + 1, End - Begin - 1);
 }
 
-#endif
+#endif // OMPTARGET_SHARED_SOURCE_INFO_H
diff --git a/openmp/libomptarget/include/omptarget.h b/openmp/libomptarget/include/omptarget.h
index 19e072abc402e38..d1c908e37f93ba2 100644
--- a/openmp/libomptarget/include/omptarget.h
+++ b/openmp/libomptarget/include/omptarget.h
@@ -14,7 +14,8 @@
 #ifndef _OMPTARGET_H_
 #define _OMPTARGET_H_
 
-#include "Environment.h"
+#include "Shared/Environment.h"
+#include "Shared/SourceInfo.h"
 
 #include <cstdint>
 #include <deque>
@@ -23,8 +24,6 @@
 #include <stdint.h>
 #include <type_traits>
 
-#include <SourceInfo.h>
-
 #include "llvm/ADT/SmallVector.h"
 
 #define OFFLOAD_SUCCESS (0)
diff --git a/openmp/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp b/openmp/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp
index da3d28129fca6a2..8b2294177016cda 100644
--- a/openmp/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp
+++ b/openmp/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp
@@ -21,9 +21,9 @@
 #include <unordered_map>
 
 #include "Shared/Debug.h"
+#include "Shared/Environment.h"
 #include "Shared/Utils.h"
 
-#include "Environment.h"
 #include "GlobalHandler.h"
 #include "OmptCallback.h"
 #include "PluginInterface.h"
diff --git a/openmp/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.cpp b/openmp/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.cpp
index 277aab1c2f35fe2..3b0b7de86a926ec 100644
--- a/openmp/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.cpp
+++ b/openmp/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.cpp
@@ -11,8 +11,8 @@
 #include "PluginInterface.h"
 
 #include "Shared/Debug.h"
+#include "Shared/Environment.h"
 
-#include "Environment.h"
 #include "GlobalHandler.h"
 #include "JIT.h"
 #include "Utils/ELF.h"
diff --git a/openmp/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.h b/openmp/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.h
index 23e2e1efbad805e..6abd1b6829ab554 100644
--- a/openmp/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.h
+++ b/openmp/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.h
@@ -20,9 +20,9 @@
 #include <vector>
 
 #include "Shared/Debug.h"
+#include "Shared/Environment.h"
 #include "Shared/Utils.h"
 
-#include "Environment.h"
 #include "GlobalHandler.h"
 #include "JIT.h"
 #include "MemoryManager.h"
diff --git a/openmp/libomptarget/plugins-nextgen/cuda/src/rtl.cpp b/openmp/libomptarget/plugins-nextgen/cuda/src/rtl.cpp
index fc2ef54919ee6e0..97e49addc5608cb 100644
--- a/openmp/libomptarget/plugins-nextgen/cuda/src/rtl.cpp
+++ b/openmp/libomptarget/plugins-nextgen/cuda/src/rtl.cpp
@@ -17,8 +17,8 @@
 #include <unordered_map>
 
 #include "Shared/Debug.h"
+#include "Shared/Environment.h"
 
-#include "Environment.h"
 #include "GlobalHandler.h"
 #include "OmptCallback.h"
 #include "PluginInterface.h"
diff --git a/openmp/libomptarget/plugins-nextgen/generic-elf-64bit/src/rtl.cpp b/openmp/libomptarget/plugins-nextgen/generic-elf-64bit/src/rtl.cpp
index ce5f2f07361f002..c0107c1f14f76fb 100644
--- a/openmp/libomptarget/plugins-nextgen/generic-elf-64bit/src/rtl.cpp
+++ b/openmp/libomptarget/plugins-nextgen/generic-elf-64bit/src/rtl.cpp
@@ -17,8 +17,8 @@
 #include <unordered_map>
 
 #include "Shared/Debug.h"
+#include "Shared/Environment.h"
 
-#include "Environment.h"
 #include "GlobalHandler.h"
 #include "OmptCallback.h"
 #include "PluginInterface.h"
diff --git a/openmp/libomptarget/src/private.h b/openmp/libomptarget/src/private.h
index 87ffe2d43dd75c1..37dae0a9f6bea2f 100644
--- a/openmp/libomptarget/src/private.h
+++ b/openmp/libomptarget/src/private.h
@@ -14,8 +14,8 @@
 #define _OMPTARGET_PRIVATE_H
 
 #include "Shared/Debug.h"
+#include "Shared/SourceInfo.h"
 
-#include "SourceInfo.h"
 #include "device.h"
 #include "omptarget.h"
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/73703


More information about the Openmp-commits mailing list