Skip to content

Commit 8327f4a

Browse files
authored
[OpenMP][NFC] Move Utils.h and Debug.h into a "Shared" include folder (#73701)
Headers used throughout the different runtimes are different from the internal headers. This is a first step to bring structure in into the include folder.
1 parent ce73177 commit 8327f4a

File tree

24 files changed

+58
-39
lines changed

24 files changed

+58
-39
lines changed

openmp/libomptarget/include/OmptConnector.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@
2323
#include <string>
2424

2525
#include "omp-tools.h"
26-
27-
#include "Debug.h"
2826
#include "omptarget.h"
2927

28+
#include "Shared/Debug.h"
29+
3030
#pragma push_macro("DEBUG_PREFIX")
3131
#undef DEBUG_PREFIX
3232
#define DEBUG_PREFIX "OMPT"

openmp/libomptarget/include/Debug.h renamed to openmp/libomptarget/include/Shared/Debug.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===------- Debug.h - Target independent OpenMP target RTL -- C++ --------===//
1+
//===-- Shared/Debug.h - Target independent OpenMP target RTL -- C++ ------===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
@@ -34,8 +34,9 @@
3434
// (uintptr_t) ptr);
3535
//
3636
//===----------------------------------------------------------------------===//
37-
#ifndef _OMPTARGET_DEBUG_H
38-
#define _OMPTARGET_DEBUG_H
37+
38+
#ifndef OMPTARGET_SHARED_DEBUG_H
39+
#define OMPTARGET_SHARED_DEBUG_H
3940

4041
#include <atomic>
4142
#include <mutex>
@@ -185,4 +186,4 @@ inline uint32_t getDebugLevel() {
185186
} \
186187
} while (false)
187188

188-
#endif // _OMPTARGET_DEBUG_H
189+
#endif // OMPTARGET_SHARED_DEBUG_H

openmp/libomptarget/include/Utilities.h renamed to openmp/libomptarget/include/Shared/Utils.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===------- Utilities.h - Target independent OpenMP target RTL -- C++ ----===//
1+
//===-- Shared/Utils.h - Target independent OpenMP target RTL -- C++ ------===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
@@ -11,8 +11,8 @@
1111
//
1212
//===----------------------------------------------------------------------===//
1313

14-
#ifndef OPENMP_LIBOMPTARGET_INCLUDE_UTILITIES_H
15-
#define OPENMP_LIBOMPTARGET_INCLUDE_UTILITIES_H
14+
#ifndef OMPTARGET_SHARED_UTILS_H
15+
#define OMPTARGET_SHARED_UTILS_H
1616

1717
#include "llvm/ADT/StringRef.h"
1818
#include "llvm/Support/Error.h"
@@ -262,4 +262,4 @@ template <typename Ty> inline Ty roundUp(Ty V, Ty Boundary) {
262262
} // namespace omp
263263
} // namespace llvm
264264

265-
#endif // OPENMP_LIBOMPTARGET_INCLUDE_UTILITIES_H
265+
#endif // OMPTARGET_SHARED_UTILS_H

openmp/libomptarget/plugins-nextgen/amdgpu/dynamic_hsa/hsa.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313

1414
#include "llvm/Support/DynamicLibrary.h"
1515

16-
#include "Debug.h"
16+
#include "Shared/Debug.h"
17+
1718
#include "dlwrap.h"
1819
#include "hsa.h"
1920
#include "hsa_ext_amd.h"

openmp/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,13 @@
2020
#include <unistd.h>
2121
#include <unordered_map>
2222

23-
#include "Debug.h"
23+
#include "Shared/Debug.h"
24+
#include "Shared/Utils.h"
25+
2426
#include "Environment.h"
2527
#include "GlobalHandler.h"
2628
#include "OmptCallback.h"
2729
#include "PluginInterface.h"
28-
#include "Utilities.h"
2930
#include "UtilitiesRTL.h"
3031
#include "omptarget.h"
3132

openmp/libomptarget/plugins-nextgen/amdgpu/utils/UtilitiesRTL.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212

1313
#include <cstdint>
1414

15-
#include "Debug.h"
15+
#include "Shared/Debug.h"
16+
1617
#include "omptarget.h"
1718

1819
#include "llvm/ADT/StringMap.h"
@@ -23,8 +24,8 @@
2324
#include "llvm/BinaryFormat/ELF.h"
2425
#include "llvm/BinaryFormat/MsgPackDocument.h"
2526
#include "llvm/Support/MemoryBufferRef.h"
26-
2727
#include "llvm/Support/YAMLTraits.h"
28+
2829
using namespace llvm::ELF;
2930

3031
namespace llvm {

openmp/libomptarget/plugins-nextgen/common/OMPT/OmptCallback.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
#include <cstring>
1919
#include <memory>
2020

21-
#include "Debug.h"
21+
#include "Shared/Debug.h"
22+
2223
#include "OmptCallback.h"
2324
#include "OmptConnector.h"
2425

openmp/libomptarget/plugins-nextgen/common/PluginInterface/GlobalHandler.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@
1212

1313
#include "GlobalHandler.h"
1414
#include "PluginInterface.h"
15-
#include "Utilities.h"
1615
#include "Utils/ELF.h"
1716

17+
#include "Shared/Utils.h"
18+
1819
#include <cstring>
1920

2021
using namespace llvm;

openmp/libomptarget/plugins-nextgen/common/PluginInterface/GlobalHandler.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@
1818
#include "llvm/ADT/DenseMap.h"
1919
#include "llvm/Object/ELFObjectFile.h"
2020

21-
#include "Debug.h"
22-
#include "Utilities.h"
21+
#include "Shared/Debug.h"
22+
#include "Shared/Utils.h"
23+
2324
#include "omptarget.h"
2425

2526
namespace llvm {

openmp/libomptarget/plugins-nextgen/common/PluginInterface/JIT.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@
99
//===----------------------------------------------------------------------===//
1010

1111
#include "JIT.h"
12-
#include "Debug.h"
12+
13+
#include "Shared/Debug.h"
14+
#include "Shared/Utils.h"
1315

1416
#include "PluginInterface.h"
15-
#include "Utilities.h"
1617
#include "omptarget.h"
1718

1819
#include "llvm/ADT/SmallVector.h"

openmp/libomptarget/plugins-nextgen/common/PluginInterface/JIT.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#ifndef OPENMP_LIBOMPTARGET_PLUGINS_NEXTGEN_COMMON_JIT_H
1212
#define OPENMP_LIBOMPTARGET_PLUGINS_NEXTGEN_COMMON_JIT_H
1313

14-
#include "Utilities.h"
14+
#include "Shared/Utils.h"
1515

1616
#include "llvm/ADT/StringMap.h"
1717
#include "llvm/ADT/StringRef.h"

openmp/libomptarget/plugins-nextgen/common/PluginInterface/MemoryManager.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
#include <unordered_map>
2222
#include <vector>
2323

24-
#include "Debug.h"
25-
#include "Utilities.h"
24+
#include "Shared/Debug.h"
25+
#include "Shared/Utils.h"
2626
#include "omptarget.h"
2727

2828
/// Base class of per-device allocator.

openmp/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
//===----------------------------------------------------------------------===//
1010

1111
#include "PluginInterface.h"
12-
#include "Debug.h"
12+
13+
#include "Shared/Debug.h"
14+
1315
#include "Environment.h"
1416
#include "GlobalHandler.h"
1517
#include "JIT.h"

openmp/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,14 @@
1919
#include <shared_mutex>
2020
#include <vector>
2121

22-
#include "Debug.h"
22+
#include "Shared/Debug.h"
23+
#include "Shared/Utils.h"
24+
2325
#include "Environment.h"
2426
#include "GlobalHandler.h"
2527
#include "JIT.h"
2628
#include "MemoryManager.h"
2729
#include "RPC.h"
28-
#include "Utilities.h"
2930
#include "omptarget.h"
3031

3132
#ifdef OMPT_SUPPORT

openmp/libomptarget/plugins-nextgen/common/PluginInterface/RPC.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
//===----------------------------------------------------------------------===//
88

99
#include "RPC.h"
10-
#include "Debug.h"
10+
11+
#include "Shared/Debug.h"
12+
1113
#include "PluginInterface.h"
1214

1315
// This header file may be present in-tree or from an LLVM installation. The

openmp/libomptarget/plugins-nextgen/common/PluginInterface/Utils/ELF.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
#include "ELF.h"
14-
#include "Debug.h"
14+
15+
#include "Shared/Debug.h"
1516

1617
#include "llvm/BinaryFormat/Magic.h"
1718
#include "llvm/Object/Binary.h"

openmp/libomptarget/plugins-nextgen/cuda/dynamic_cuda/cuda.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313

1414
#include "llvm/Support/DynamicLibrary.h"
1515

16-
#include "Debug.h"
16+
#include "Shared/Debug.h"
17+
1718
#include "cuda.h"
1819
#include "dlwrap.h"
1920

openmp/libomptarget/plugins-nextgen/cuda/src/rtl.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
#include <string>
1717
#include <unordered_map>
1818

19-
#include "Debug.h"
19+
#include "Shared/Debug.h"
20+
2021
#include "Environment.h"
2122
#include "GlobalHandler.h"
2223
#include "OmptCallback.h"

openmp/libomptarget/plugins-nextgen/generic-elf-64bit/src/rtl.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
#include <string>
1717
#include <unordered_map>
1818

19-
#include "Debug.h"
19+
#include "Shared/Debug.h"
20+
2021
#include "Environment.h"
2122
#include "GlobalHandler.h"
2223
#include "OmptCallback.h"

openmp/libomptarget/src/OmptCallback.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
#include <cstring>
1919
#include <memory>
2020

21-
#include "Debug.h"
21+
#include "Shared/Debug.h"
22+
2223
#include "OmptCallback.h"
2324
#include "OmptConnector.h"
2425
#include "OmptInterface.h"

openmp/libomptarget/src/device.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#include "private.h"
1818
#include "rtl.h"
1919

20-
#include "Utilities.h"
20+
#include "Shared/Utils.h"
2121

2222
#include <cassert>
2323
#include <climits>

openmp/libomptarget/src/interface.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include "private.h"
1919
#include "rtl.h"
2020

21-
#include "Utilities.h"
21+
#include "Shared/Utils.h"
2222

2323
#include <cassert>
2424
#include <cstdint>

openmp/libomptarget/src/private.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@
1313
#ifndef _OMPTARGET_PRIVATE_H
1414
#define _OMPTARGET_PRIVATE_H
1515

16+
#include "Shared/Debug.h"
17+
18+
#include "SourceInfo.h"
1619
#include "device.h"
17-
#include <Debug.h>
18-
#include <SourceInfo.h>
19-
#include <omptarget.h>
20+
#include "omptarget.h"
2021

2122
#include <cstdint>
2223

openmp/libomptarget/src/rtl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#include "private.h"
1818
#include "rtl.h"
1919

20-
#include "Utilities.h"
20+
#include "Shared/Utils.h"
2121

2222
#include <cassert>
2323
#include <cstdlib>

0 commit comments

Comments
 (0)