[llvm] [Offload][NFC] Rename `src/` -> `libomptarget/` (PR #126573)
Joseph Huber via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 10 11:01:50 PST 2025
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/126573
>From fba4b9df58ab65c53cc980e280fbd3ee98fbf23f Mon Sep 17 00:00:00 2001
From: Joseph Huber <huberjn at outlook.com>
Date: Mon, 10 Feb 2025 12:52:00 -0600
Subject: [PATCH] [Offload][NFC] Rename `src/` -> `libomptarget/`
Summary:
The name `src` is confusing when combined with the plugins and the newly
added `liboffload`.
---
offload/CMakeLists.txt | 2 +-
offload/{src => libomptarget}/CMakeLists.txt | 0
offload/{src => libomptarget}/DeviceImage.cpp | 0
offload/{src => libomptarget}/KernelLanguage/API.cpp | 0
offload/{src => libomptarget}/LegacyAPI.cpp | 0
offload/{src => libomptarget}/OffloadRTL.cpp | 0
offload/{src => libomptarget}/OpenMP/API.cpp | 4 ++--
offload/{src => libomptarget}/OpenMP/InteropAPI.cpp | 0
offload/{src => libomptarget}/OpenMP/Mapping.cpp | 0
offload/{src => libomptarget}/OpenMP/OMPT/Callback.cpp | 0
offload/{src => libomptarget}/PluginManager.cpp | 0
offload/{src => libomptarget}/device.cpp | 0
offload/{src => libomptarget}/exports | 0
offload/{src => libomptarget}/interface.cpp | 2 +-
offload/{src => libomptarget}/omptarget.cpp | 0
offload/{src => libomptarget}/private.h | 0
16 files changed, 4 insertions(+), 4 deletions(-)
rename offload/{src => libomptarget}/CMakeLists.txt (100%)
rename offload/{src => libomptarget}/DeviceImage.cpp (100%)
rename offload/{src => libomptarget}/KernelLanguage/API.cpp (100%)
rename offload/{src => libomptarget}/LegacyAPI.cpp (100%)
rename offload/{src => libomptarget}/OffloadRTL.cpp (100%)
rename offload/{src => libomptarget}/OpenMP/API.cpp (99%)
rename offload/{src => libomptarget}/OpenMP/InteropAPI.cpp (100%)
rename offload/{src => libomptarget}/OpenMP/Mapping.cpp (100%)
rename offload/{src => libomptarget}/OpenMP/OMPT/Callback.cpp (100%)
rename offload/{src => libomptarget}/PluginManager.cpp (100%)
rename offload/{src => libomptarget}/device.cpp (100%)
rename offload/{src => libomptarget}/exports (100%)
rename offload/{src => libomptarget}/interface.cpp (99%)
rename offload/{src => libomptarget}/omptarget.cpp (100%)
rename offload/{src => libomptarget}/private.h (100%)
diff --git a/offload/CMakeLists.txt b/offload/CMakeLists.txt
index f6e894d39968590..25c879710645c7a 100644
--- a/offload/CMakeLists.txt
+++ b/offload/CMakeLists.txt
@@ -377,7 +377,7 @@ add_subdirectory(DeviceRTL)
add_subdirectory(tools)
# Build target agnostic offloading library.
-add_subdirectory(src)
+add_subdirectory(libomptarget)
add_subdirectory(tools/offload-tblgen)
add_subdirectory(liboffload)
diff --git a/offload/src/CMakeLists.txt b/offload/libomptarget/CMakeLists.txt
similarity index 100%
rename from offload/src/CMakeLists.txt
rename to offload/libomptarget/CMakeLists.txt
diff --git a/offload/src/DeviceImage.cpp b/offload/libomptarget/DeviceImage.cpp
similarity index 100%
rename from offload/src/DeviceImage.cpp
rename to offload/libomptarget/DeviceImage.cpp
diff --git a/offload/src/KernelLanguage/API.cpp b/offload/libomptarget/KernelLanguage/API.cpp
similarity index 100%
rename from offload/src/KernelLanguage/API.cpp
rename to offload/libomptarget/KernelLanguage/API.cpp
diff --git a/offload/src/LegacyAPI.cpp b/offload/libomptarget/LegacyAPI.cpp
similarity index 100%
rename from offload/src/LegacyAPI.cpp
rename to offload/libomptarget/LegacyAPI.cpp
diff --git a/offload/src/OffloadRTL.cpp b/offload/libomptarget/OffloadRTL.cpp
similarity index 100%
rename from offload/src/OffloadRTL.cpp
rename to offload/libomptarget/OffloadRTL.cpp
diff --git a/offload/src/OpenMP/API.cpp b/offload/libomptarget/OpenMP/API.cpp
similarity index 99%
rename from offload/src/OpenMP/API.cpp
rename to offload/libomptarget/OpenMP/API.cpp
index 62e27060b710d6f..4576f9bd061218d 100644
--- a/offload/src/OpenMP/API.cpp
+++ b/offload/libomptarget/OpenMP/API.cpp
@@ -655,8 +655,8 @@ EXTERN void *omp_get_mapped_ptr(const void *Ptr, int DeviceNum) {
int NumDevices = omp_get_initial_device();
if (DeviceNum == NumDevices) {
- DP("Device %d is initial device, returning Ptr " DPxMOD ".\n",
- DeviceNum, DPxPTR(Ptr));
+ DP("Device %d is initial device, returning Ptr " DPxMOD ".\n", DeviceNum,
+ DPxPTR(Ptr));
return const_cast<void *>(Ptr);
}
diff --git a/offload/src/OpenMP/InteropAPI.cpp b/offload/libomptarget/OpenMP/InteropAPI.cpp
similarity index 100%
rename from offload/src/OpenMP/InteropAPI.cpp
rename to offload/libomptarget/OpenMP/InteropAPI.cpp
diff --git a/offload/src/OpenMP/Mapping.cpp b/offload/libomptarget/OpenMP/Mapping.cpp
similarity index 100%
rename from offload/src/OpenMP/Mapping.cpp
rename to offload/libomptarget/OpenMP/Mapping.cpp
diff --git a/offload/src/OpenMP/OMPT/Callback.cpp b/offload/libomptarget/OpenMP/OMPT/Callback.cpp
similarity index 100%
rename from offload/src/OpenMP/OMPT/Callback.cpp
rename to offload/libomptarget/OpenMP/OMPT/Callback.cpp
diff --git a/offload/src/PluginManager.cpp b/offload/libomptarget/PluginManager.cpp
similarity index 100%
rename from offload/src/PluginManager.cpp
rename to offload/libomptarget/PluginManager.cpp
diff --git a/offload/src/device.cpp b/offload/libomptarget/device.cpp
similarity index 100%
rename from offload/src/device.cpp
rename to offload/libomptarget/device.cpp
diff --git a/offload/src/exports b/offload/libomptarget/exports
similarity index 100%
rename from offload/src/exports
rename to offload/libomptarget/exports
diff --git a/offload/src/interface.cpp b/offload/libomptarget/interface.cpp
similarity index 99%
rename from offload/src/interface.cpp
rename to offload/libomptarget/interface.cpp
index 624320428403f63..ea354400f2e99dc 100644
--- a/offload/src/interface.cpp
+++ b/offload/libomptarget/interface.cpp
@@ -294,7 +294,7 @@ static KernelArgsTy *upgradeKernelArgs(KernelArgsTy *KernelArgs,
// FIXME: This is a WA to "calibrate" the bad work done in the front end.
// Delete this ugly code after the front end emits proper values.
- auto CorrectMultiDim = [](uint32_t(&Val)[3]) {
+ auto CorrectMultiDim = [](uint32_t (&Val)[3]) {
if (Val[1] == 0)
Val[1] = 1;
if (Val[2] == 0)
diff --git a/offload/src/omptarget.cpp b/offload/libomptarget/omptarget.cpp
similarity index 100%
rename from offload/src/omptarget.cpp
rename to offload/libomptarget/omptarget.cpp
diff --git a/offload/src/private.h b/offload/libomptarget/private.h
similarity index 100%
rename from offload/src/private.h
rename to offload/libomptarget/private.h
More information about the llvm-commits
mailing list