[Openmp-commits] [llvm] [openmp] [OMPT][Offload][OpenMP] Fixes for OMPT data used by libomptarget (PR #156020)

via Openmp-commits openmp-commits at lists.llvm.org
Fri Aug 29 06:08:37 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 origin/main HEAD --extensions h,c,cpp -- offload/test/ompt/register_with_host.h offload/test/ompt/target_tool_data.c offload/test/ompt/target_tool_data_nowait.c offload/test/ompt/target_tool_data_nowait_nodepend.c offload/include/OpenMP/OMPT/Interface.h offload/libomptarget/OpenMP/OMPT/Callback.cpp offload/test/ompt/callbacks.h offload/test/ompt/omp_api.c offload/test/ompt/target_memcpy.c offload/test/ompt/target_memcpy_emi.c offload/test/ompt/veccopy.c offload/test/ompt/veccopy_data.c offload/test/ompt/veccopy_disallow_both.c offload/test/ompt/veccopy_emi.c offload/test/ompt/veccopy_emi_map.c offload/test/ompt/veccopy_map.c offload/test/ompt/veccopy_no_device_init.c offload/test/ompt/veccopy_wrong_return.c openmp/runtime/src/ompt-general.cpp openmp/runtime/src/ompt-internal.h openmp/runtime/src/ompt-specific.cpp openmp/runtime/src/ompt-specific.h openmp/runtime/test/ompt/callback.h
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/offload/test/ompt/target_tool_data.c b/offload/test/ompt/target_tool_data.c
index ceec476ce..7407e1067 100644
--- a/offload/test/ompt/target_tool_data.c
+++ b/offload/test/ompt/target_tool_data.c
@@ -23,7 +23,7 @@ int main() {
     y[i] = 1;
   }
 
-#pragma omp target enter data map(to : x [0:N]) map(alloc : y [0:N])
+#pragma omp target enter data map(to : x[0 : N]) map(alloc : y[0 : N])
 #pragma omp target teams distribute parallel for
   for (int i = 0; i < N; i++) {
     for (int j = 0; j < M; j++) {
@@ -38,7 +38,7 @@ int main() {
     }
   }
 
-#pragma omp target exit data map(release : x [0:N]) map(from : y [0:N])
+#pragma omp target exit data map(release : x[0 : N]) map(from : y[0 : N])
 
   printf("%f, %f\n", x[0], y[0]);
 
diff --git a/offload/test/ompt/target_tool_data_nowait.c b/offload/test/ompt/target_tool_data_nowait.c
index 3ef6a495a..c5e20bec1 100644
--- a/offload/test/ompt/target_tool_data_nowait.c
+++ b/offload/test/ompt/target_tool_data_nowait.c
@@ -23,11 +23,8 @@ int main() {
     y[i] = 1;
   }
 
-#pragma omp target enter data map(to                                           \
-                                  : x [0:N]) map(alloc                         \
-                                                 : y [0:N])                    \
-    nowait depend(inout                                                        \
-                  : x)
+#pragma omp target enter data map(to : x[0 : N]) map(alloc : y[0 : N])         \
+    nowait depend(inout : x)
 #pragma omp target teams distribute parallel for nowait depend(inout : x)
   for (int i = 0; i < N; i++) {
     for (int j = 0; j < M; j++) {
@@ -42,10 +39,8 @@ int main() {
     }
   }
 
-#pragma omp target exit data map(release                                       \
-                                 : x [0:N]) map(from                           \
-                                                : y [0:N]) nowait depend(inout \
-                                                                         : x)
+#pragma omp target exit data map(release : x[0 : N]) map(from : y[0 : N])      \
+    nowait depend(inout : x)
 #pragma omp taskwait
 
   printf("%f, %f\n", x[0], y[0]);
diff --git a/offload/test/ompt/target_tool_data_nowait_nodepend.c b/offload/test/ompt/target_tool_data_nowait_nodepend.c
index 15b397138..b28184bc3 100644
--- a/offload/test/ompt/target_tool_data_nowait_nodepend.c
+++ b/offload/test/ompt/target_tool_data_nowait_nodepend.c
@@ -27,20 +27,16 @@ int main() {
     b[i] = 1;
   }
 
-#pragma omp target teams distribute parallel for nowait map(to                 \
-                                                            : x [0:N])         \
-    map(from                                                                   \
-        : y [0:N])
+#pragma omp target teams distribute parallel for nowait map(to : x[0 : N])     \
+    map(from : y[0 : N])
   for (int i = 0; i < N; i++) {
     for (int j = 0; j < M; j++) {
       y[i] += 3 * x[i];
     }
   }
 
-#pragma omp target teams distribute parallel for nowait map(to                 \
-                                                            : a [0:N])         \
-    map(from                                                                   \
-        : b [0:N])
+#pragma omp target teams distribute parallel for nowait map(to : a[0 : N])     \
+    map(from : b[0 : N])
   for (int i = 0; i < N; i++) {
     for (int j = 0; j < M; j++) {
       b[i] += 3 * a[i];

``````````

</details>


https://github.com/llvm/llvm-project/pull/156020


More information about the Openmp-commits mailing list