[llvm] [Offload] Fix handling of 'bare' mode when environment missing (PR #136794)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 22 17:48:38 PDT 2025
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 HEAD~1 HEAD --extensions c,h,cpp -- llvm/include/llvm/Frontend/OpenMP/OMPDeviceConstants.h offload/DeviceRTL/src/Kernel.cpp offload/plugins-nextgen/common/include/PluginInterface.h offload/plugins-nextgen/common/src/PluginInterface.cpp offload/test/offloading/ompx_bare.c offload/test/offloading/ompx_bare_multi_dim.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/offload/plugins-nextgen/common/src/PluginInterface.cpp b/offload/plugins-nextgen/common/src/PluginInterface.cpp
index 9938a0e91..059f14f59 100644
--- a/offload/plugins-nextgen/common/src/PluginInterface.cpp
+++ b/offload/plugins-nextgen/common/src/PluginInterface.cpp
@@ -449,10 +449,10 @@ Error GenericKernelTy::init(GenericDeviceTy &GenericDevice,
GHandler.readGlobalFromImage(GenericDevice, *ImagePtr, KernelEnv))
return Err;
} else {
- KernelEnvironment = KernelEnvironmentTy{};
- DP("Failed to read kernel environment for '%s' Using default Bare (0) "
- "execution mode\n",
- Name);
+ KernelEnvironment = KernelEnvironmentTy{};
+ DP("Failed to read kernel environment for '%s' Using default Bare (0) "
+ "execution mode\n",
+ Name);
}
// Max = Config.Max > 0 ? min(Config.Max, Device.Max) : Device.Max;
diff --git a/offload/test/offloading/ompx_bare.c b/offload/test/offloading/ompx_bare.c
index 9c8addf03..bd5efbc05 100644
--- a/offload/test/offloading/ompx_bare.c
+++ b/offload/test/offloading/ompx_bare.c
@@ -15,7 +15,9 @@ int main(int argc, char *argv[]) {
const int N = num_blocks * block_size;
int *data = (int *)malloc(N * sizeof(int));
- // CHECK: "PluginInterface" device 0 info: Launching kernel __omp_offloading_{{.*}} with [64,1,1] blocks and [64,1,1] threads in BARE mode
+ // CHECK: "PluginInterface" device 0 info: Launching kernel
+ // __omp_offloading_{{.*}} with [64,1,1] blocks and [64,1,1] threads in BARE
+ // mode
#pragma omp target teams ompx_bare num_teams(num_blocks) thread_limit(block_size) map(from: data[0:N])
{
diff --git a/offload/test/offloading/ompx_bare_multi_dim.cpp b/offload/test/offloading/ompx_bare_multi_dim.cpp
index 3a726f89f..c3358428a 100644
--- a/offload/test/offloading/ompx_bare_multi_dim.cpp
+++ b/offload/test/offloading/ompx_bare_multi_dim.cpp
@@ -7,7 +7,8 @@
#include <cassert>
#include <vector>
-// CHECK: "PluginInterface" device 0 info: Launching kernel __omp_offloading_{{.*}} with [2,4,6] blocks and [32,4,2] threads in BARE mode
+// CHECK: "PluginInterface" device 0 info: Launching kernel
+// __omp_offloading_{{.*}} with [2,4,6] blocks and [32,4,2] threads in BARE mode
int main(int argc, char *argv[]) {
int bs[3] = {32u, 4u, 2u};
``````````
</details>
https://github.com/llvm/llvm-project/pull/136794
More information about the llvm-commits
mailing list