[llvm] [Offload][NFC] Reorganize `utils::` and make Device/Host/Shared clearer (PR #100280)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 23 16:43:04 PDT 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff d0c8e268c1ed9bbbd07be0efd93a91737c7bb1fe 1733bcd1b541808cfad2ffd7f569ec997033a6e8 --extensions cpp,h -- offload/DeviceRTL/include/DeviceUtils.h offload/include/Shared/RefCnt.h offload/include/Shared/Types.h offload/DeviceRTL/include/Allocator.h offload/DeviceRTL/include/Configuration.h offload/DeviceRTL/include/Interface.h offload/DeviceRTL/include/LibC.h offload/DeviceRTL/include/Mapping.h offload/DeviceRTL/include/State.h offload/DeviceRTL/include/Synchronization.h offload/DeviceRTL/src/Allocator.cpp offload/DeviceRTL/src/Configuration.cpp offload/DeviceRTL/src/Debug.cpp offload/DeviceRTL/src/Kernel.cpp offload/DeviceRTL/src/Mapping.cpp offload/DeviceRTL/src/Misc.cpp offload/DeviceRTL/src/Parallelism.cpp offload/DeviceRTL/src/Reduction.cpp offload/DeviceRTL/src/State.cpp offload/DeviceRTL/src/Synchronization.cpp offload/DeviceRTL/src/Tasking.cpp offload/DeviceRTL/src/Workshare.cpp offload/include/Shared/Utils.h offload/plugins-nextgen/amdgpu/src/rtl.cpp offload/plugins-nextgen/amdgpu/utils/UtilitiesRTL.h offload/plugins-nextgen/common/include/PluginInterface.h offload/plugins-nextgen/common/src/GlobalHandler.cpp offload/plugins-nextgen/common/src/JIT.cpp offload/plugins-nextgen/common/src/PluginInterface.cpp offload/plugins-nextgen/cuda/src/rtl.cpp offload/src/DeviceImage.cpp offload/src/omptarget.cpp offload/DeviceRTL/include/DeviceTypes.h offload/DeviceRTL/src/DeviceUtils.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/offload/DeviceRTL/include/DeviceTypes.h b/offload/DeviceRTL/include/DeviceTypes.h
index 2a594de0be..1849081a4d 100644
--- a/offload/DeviceRTL/include/DeviceTypes.h
+++ b/offload/DeviceRTL/include/DeviceTypes.h
@@ -1,4 +1,5 @@
-//===---------- DeviceTypes.h - OpenMP types ---------------------------- C++ -*-===//
+//===---------- DeviceTypes.h - OpenMP types ---------------------------- C++
+//-*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -115,9 +116,9 @@ enum kmp_sched_t {
#define SCHEDULE_WITHOUT_MODIFIERS(s) \
(enum kmp_sched_t)( \
(s) & ~(kmp_sched_modifier_nonmonotonic | kmp_sched_modifier_monotonic))
-#define SCHEDULE_HAS_MONOTONIC(s) (((s)&kmp_sched_modifier_monotonic) != 0)
+#define SCHEDULE_HAS_MONOTONIC(s) (((s) & kmp_sched_modifier_monotonic) != 0)
#define SCHEDULE_HAS_NONMONOTONIC(s) \
- (((s)&kmp_sched_modifier_nonmonotonic) != 0)
+ (((s) & kmp_sched_modifier_nonmonotonic) != 0)
#define SCHEDULE_HAS_NO_MODIFIERS(s) \
(((s) & (kmp_sched_modifier_nonmonotonic | kmp_sched_modifier_monotonic)) == \
0)
diff --git a/offload/DeviceRTL/include/DeviceUtils.h b/offload/DeviceRTL/include/DeviceUtils.h
index 378d1fb2d6..549ca16e1c 100644
--- a/offload/DeviceRTL/include/DeviceUtils.h
+++ b/offload/DeviceRTL/include/DeviceUtils.h
@@ -12,8 +12,8 @@
#ifndef OMPTARGET_DEVICERTL_DEVICE_UTILS_H
#define OMPTARGET_DEVICERTL_DEVICE_UTILS_H
-#include "Shared/Utils.h"
#include "DeviceTypes.h"
+#include "Shared/Utils.h"
#pragma omp begin declare target device_type(nohost)
diff --git a/offload/DeviceRTL/include/State.h b/offload/DeviceRTL/include/State.h
index 37699529e7..565235cd48 100644
--- a/offload/DeviceRTL/include/State.h
+++ b/offload/DeviceRTL/include/State.h
@@ -15,9 +15,9 @@
#include "Shared/Environment.h"
#include "Debug.h"
-#include "Mapping.h"
#include "DeviceTypes.h"
#include "DeviceUtils.h"
+#include "Mapping.h"
// Forward declaration.
struct KernelEnvironmentTy;
diff --git a/offload/DeviceRTL/src/Allocator.cpp b/offload/DeviceRTL/src/Allocator.cpp
index 2a85a34d32..ac662c48d4 100644
--- a/offload/DeviceRTL/src/Allocator.cpp
+++ b/offload/DeviceRTL/src/Allocator.cpp
@@ -12,10 +12,10 @@
#include "Allocator.h"
#include "Configuration.h"
-#include "Mapping.h"
-#include "Synchronization.h"
#include "DeviceTypes.h"
#include "DeviceUtils.h"
+#include "Mapping.h"
+#include "Synchronization.h"
using namespace ompx;
diff --git a/offload/DeviceRTL/src/Configuration.cpp b/offload/DeviceRTL/src/Configuration.cpp
index 4d97ad6731..9e14c203d4 100644
--- a/offload/DeviceRTL/src/Configuration.cpp
+++ b/offload/DeviceRTL/src/Configuration.cpp
@@ -12,8 +12,8 @@
//===----------------------------------------------------------------------===//
#include "Configuration.h"
-#include "State.h"
#include "DeviceTypes.h"
+#include "State.h"
using namespace ompx;
diff --git a/offload/DeviceRTL/src/Debug.cpp b/offload/DeviceRTL/src/Debug.cpp
index af26a26c13..201975ad1e 100644
--- a/offload/DeviceRTL/src/Debug.cpp
+++ b/offload/DeviceRTL/src/Debug.cpp
@@ -14,10 +14,10 @@
#include "Configuration.h"
#include "Debug.h"
+#include "DeviceTypes.h"
#include "Interface.h"
#include "Mapping.h"
#include "State.h"
-#include "DeviceTypes.h"
using namespace ompx;
diff --git a/offload/DeviceRTL/src/Kernel.cpp b/offload/DeviceRTL/src/Kernel.cpp
index c3b4554574..8bb275eae7 100644
--- a/offload/DeviceRTL/src/Kernel.cpp
+++ b/offload/DeviceRTL/src/Kernel.cpp
@@ -14,11 +14,11 @@
#include "Allocator.h"
#include "Debug.h"
+#include "DeviceTypes.h"
#include "Interface.h"
#include "Mapping.h"
#include "State.h"
#include "Synchronization.h"
-#include "DeviceTypes.h"
#include "Workshare.h"
#include "llvm/Frontend/OpenMP/OMPDeviceConstants.h"
diff --git a/offload/DeviceRTL/src/Mapping.cpp b/offload/DeviceRTL/src/Mapping.cpp
index 8287312c74..3aefcff68e 100644
--- a/offload/DeviceRTL/src/Mapping.cpp
+++ b/offload/DeviceRTL/src/Mapping.cpp
@@ -10,10 +10,10 @@
//===----------------------------------------------------------------------===//
#include "Mapping.h"
-#include "Interface.h"
-#include "State.h"
#include "DeviceTypes.h"
#include "DeviceUtils.h"
+#include "Interface.h"
+#include "State.h"
#pragma omp begin declare target device_type(nohost)
diff --git a/offload/DeviceRTL/src/Parallelism.cpp b/offload/DeviceRTL/src/Parallelism.cpp
index e3fcfef9b2..5286d53b62 100644
--- a/offload/DeviceRTL/src/Parallelism.cpp
+++ b/offload/DeviceRTL/src/Parallelism.cpp
@@ -33,12 +33,12 @@
//===----------------------------------------------------------------------===//
#include "Debug.h"
+#include "DeviceTypes.h"
+#include "DeviceUtils.h"
#include "Interface.h"
#include "Mapping.h"
#include "State.h"
#include "Synchronization.h"
-#include "DeviceTypes.h"
-#include "DeviceUtils.h"
using namespace ompx;
diff --git a/offload/DeviceRTL/src/Reduction.cpp b/offload/DeviceRTL/src/Reduction.cpp
index f4e2e0d25b..57df159d3f 100644
--- a/offload/DeviceRTL/src/Reduction.cpp
+++ b/offload/DeviceRTL/src/Reduction.cpp
@@ -11,12 +11,12 @@
//===----------------------------------------------------------------------===//
#include "Debug.h"
+#include "DeviceTypes.h"
+#include "DeviceUtils.h"
#include "Interface.h"
#include "Mapping.h"
#include "State.h"
#include "Synchronization.h"
-#include "DeviceTypes.h"
-#include "DeviceUtils.h"
using namespace ompx;
diff --git a/offload/DeviceRTL/src/Synchronization.cpp b/offload/DeviceRTL/src/Synchronization.cpp
index 97a6b08016..d6452a5d58 100644
--- a/offload/DeviceRTL/src/Synchronization.cpp
+++ b/offload/DeviceRTL/src/Synchronization.cpp
@@ -13,11 +13,11 @@
#include "Synchronization.h"
#include "Debug.h"
+#include "DeviceTypes.h"
+#include "DeviceUtils.h"
#include "Interface.h"
#include "Mapping.h"
#include "State.h"
-#include "DeviceTypes.h"
-#include "DeviceUtils.h"
#pragma omp begin declare target device_type(nohost)
``````````
</details>
https://github.com/llvm/llvm-project/pull/100280
More information about the llvm-commits
mailing list