Skip to content

[OpenMP][NFC] Move Utils.h and Debug.h into a "Shared" include folder #73701

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions openmp/libomptarget/include/OmptConnector.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
#include <string>

#include "omp-tools.h"

#include "Debug.h"
#include "omptarget.h"

#include "Shared/Debug.h"

#pragma push_macro("DEBUG_PREFIX")
#undef DEBUG_PREFIX
#define DEBUG_PREFIX "OMPT"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===------- Debug.h - Target independent OpenMP target RTL -- C++ --------===//
//===-- Shared/Debug.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.
Expand Down Expand Up @@ -34,8 +34,9 @@
// (uintptr_t) ptr);
//
//===----------------------------------------------------------------------===//
#ifndef _OMPTARGET_DEBUG_H
#define _OMPTARGET_DEBUG_H

#ifndef OMPTARGET_SHARED_DEBUG_H
#define OMPTARGET_SHARED_DEBUG_H

#include <atomic>
#include <mutex>
Expand Down Expand Up @@ -185,4 +186,4 @@ inline uint32_t getDebugLevel() {
} \
} while (false)

#endif // _OMPTARGET_DEBUG_H
#endif // OMPTARGET_SHARED_DEBUG_H
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===------- Utilities.h - Target independent OpenMP target RTL -- C++ ----===//
//===-- Shared/Utils.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.
Expand All @@ -11,8 +11,8 @@
//
//===----------------------------------------------------------------------===//

#ifndef OPENMP_LIBOMPTARGET_INCLUDE_UTILITIES_H
#define OPENMP_LIBOMPTARGET_INCLUDE_UTILITIES_H
#ifndef OMPTARGET_SHARED_UTILS_H
#define OMPTARGET_SHARED_UTILS_H

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

#endif // OPENMP_LIBOMPTARGET_INCLUDE_UTILITIES_H
#endif // OMPTARGET_SHARED_UTILS_H
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@

#include "llvm/Support/DynamicLibrary.h"

#include "Debug.h"
#include "Shared/Debug.h"

#include "dlwrap.h"
#include "hsa.h"
#include "hsa_ext_amd.h"
Expand Down
5 changes: 3 additions & 2 deletions openmp/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@
#include <unistd.h>
#include <unordered_map>

#include "Debug.h"
#include "Shared/Debug.h"
#include "Shared/Utils.h"

#include "Environment.h"
#include "GlobalHandler.h"
#include "OmptCallback.h"
#include "PluginInterface.h"
#include "Utilities.h"
#include "UtilitiesRTL.h"
#include "omptarget.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@

#include <cstdint>

#include "Debug.h"
#include "Shared/Debug.h"

#include "omptarget.h"

#include "llvm/ADT/StringMap.h"
Expand All @@ -23,8 +24,8 @@
#include "llvm/BinaryFormat/ELF.h"
#include "llvm/BinaryFormat/MsgPackDocument.h"
#include "llvm/Support/MemoryBufferRef.h"

#include "llvm/Support/YAMLTraits.h"

using namespace llvm::ELF;

namespace llvm {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
#include <cstring>
#include <memory>

#include "Debug.h"
#include "Shared/Debug.h"

#include "OmptCallback.h"
#include "OmptConnector.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@

#include "GlobalHandler.h"
#include "PluginInterface.h"
#include "Utilities.h"
#include "Utils/ELF.h"

#include "Shared/Utils.h"

#include <cstring>

using namespace llvm;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
#include "llvm/ADT/DenseMap.h"
#include "llvm/Object/ELFObjectFile.h"

#include "Debug.h"
#include "Utilities.h"
#include "Shared/Debug.h"
#include "Shared/Utils.h"

#include "omptarget.h"

namespace llvm {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
//===----------------------------------------------------------------------===//

#include "JIT.h"
#include "Debug.h"

#include "Shared/Debug.h"
#include "Shared/Utils.h"

#include "PluginInterface.h"
#include "Utilities.h"
#include "omptarget.h"

#include "llvm/ADT/SmallVector.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#ifndef OPENMP_LIBOMPTARGET_PLUGINS_NEXTGEN_COMMON_JIT_H
#define OPENMP_LIBOMPTARGET_PLUGINS_NEXTGEN_COMMON_JIT_H

#include "Utilities.h"
#include "Shared/Utils.h"

#include "llvm/ADT/StringMap.h"
#include "llvm/ADT/StringRef.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
#include <unordered_map>
#include <vector>

#include "Debug.h"
#include "Utilities.h"
#include "Shared/Debug.h"
#include "Shared/Utils.h"
#include "omptarget.h"

/// Base class of per-device allocator.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
//===----------------------------------------------------------------------===//

#include "PluginInterface.h"
#include "Debug.h"

#include "Shared/Debug.h"

#include "Environment.h"
#include "GlobalHandler.h"
#include "JIT.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@
#include <shared_mutex>
#include <vector>

#include "Debug.h"
#include "Shared/Debug.h"
#include "Shared/Utils.h"

#include "Environment.h"
#include "GlobalHandler.h"
#include "JIT.h"
#include "MemoryManager.h"
#include "RPC.h"
#include "Utilities.h"
#include "omptarget.h"

#ifdef OMPT_SUPPORT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
//===----------------------------------------------------------------------===//

#include "RPC.h"
#include "Debug.h"

#include "Shared/Debug.h"

#include "PluginInterface.h"

// This header file may be present in-tree or from an LLVM installation. The
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
//===----------------------------------------------------------------------===//

#include "ELF.h"
#include "Debug.h"

#include "Shared/Debug.h"

#include "llvm/BinaryFormat/Magic.h"
#include "llvm/Object/Binary.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@

#include "llvm/Support/DynamicLibrary.h"

#include "Debug.h"
#include "Shared/Debug.h"

#include "cuda.h"
#include "dlwrap.h"

Expand Down
3 changes: 2 additions & 1 deletion openmp/libomptarget/plugins-nextgen/cuda/src/rtl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
#include <string>
#include <unordered_map>

#include "Debug.h"
#include "Shared/Debug.h"

#include "Environment.h"
#include "GlobalHandler.h"
#include "OmptCallback.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
#include <string>
#include <unordered_map>

#include "Debug.h"
#include "Shared/Debug.h"

#include "Environment.h"
#include "GlobalHandler.h"
#include "OmptCallback.h"
Expand Down
3 changes: 2 additions & 1 deletion openmp/libomptarget/src/OmptCallback.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
#include <cstring>
#include <memory>

#include "Debug.h"
#include "Shared/Debug.h"

#include "OmptCallback.h"
#include "OmptConnector.h"
#include "OmptInterface.h"
Expand Down
2 changes: 1 addition & 1 deletion openmp/libomptarget/src/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include "private.h"
#include "rtl.h"

#include "Utilities.h"
#include "Shared/Utils.h"

#include <cassert>
#include <climits>
Expand Down
2 changes: 1 addition & 1 deletion openmp/libomptarget/src/interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include "private.h"
#include "rtl.h"

#include "Utilities.h"
#include "Shared/Utils.h"

#include <cassert>
#include <cstdint>
Expand Down
7 changes: 4 additions & 3 deletions openmp/libomptarget/src/private.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@
#ifndef _OMPTARGET_PRIVATE_H
#define _OMPTARGET_PRIVATE_H

#include "Shared/Debug.h"

#include "SourceInfo.h"
#include "device.h"
#include <Debug.h>
#include <SourceInfo.h>
#include <omptarget.h>
#include "omptarget.h"

#include <cstdint>

Expand Down
2 changes: 1 addition & 1 deletion openmp/libomptarget/src/rtl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include "private.h"
#include "rtl.h"

#include "Utilities.h"
#include "Shared/Utils.h"

#include <cassert>
#include <cstdlib>
Expand Down