[llvm-branch-commits] [OpenMP] New runtime tests for graph_id/graph_reset clauses (taskgraph) (PR #195075)
via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Thu Apr 30 06:00:40 PDT 2026
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 cpp -- openmp/runtime/test/taskgraph/taskgraph_deps_irreducible_graph_reset.cpp openmp/runtime/test/taskgraph/taskgraph_graph_id.cpp openmp/runtime/test/taskgraph/taskgraph_graph_id_and_reset.cpp openmp/runtime/test/taskgraph/taskgraph_graph_reset.cpp --diff_from_common_commit
``````````
: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/openmp/runtime/test/taskgraph/taskgraph_deps_irreducible_graph_reset.cpp b/openmp/runtime/test/taskgraph/taskgraph_deps_irreducible_graph_reset.cpp
index ac138d670..6badfbdc3 100644
--- a/openmp/runtime/test/taskgraph/taskgraph_deps_irreducible_graph_reset.cpp
+++ b/openmp/runtime/test/taskgraph/taskgraph_deps_irreducible_graph_reset.cpp
@@ -1,4 +1,5 @@
-// RUN: %clangXX %flags %openmp_flags -fopenmp-version=60 %s -o %t && %libomp-run 2>&1 | FileCheck %s
+// RUN: %clangXX %flags %openmp_flags -fopenmp-version=60 %s -o %t &&
+// %libomp-run 2>&1 | FileCheck %s
// REQUIRES: omp_taskgraph_experimental
@@ -21,15 +22,25 @@ int main() {
#pragma omp taskgraph graph_id(123) graph_reset(1)
{
#pragma omp task depend(out : deps[0], deps[1])
- { sum.fetch_add(1, std::memory_order_relaxed); } // A
+ {
+ sum.fetch_add(1, std::memory_order_relaxed);
+ } // A
#pragma omp task depend(inout : deps[0])
- { sum.fetch_add(4, std::memory_order_relaxed); } // B
+ {
+ sum.fetch_add(4, std::memory_order_relaxed);
+ } // B
#pragma omp task depend(inout : deps[1])
- { sum.fetch_add(8, std::memory_order_relaxed); } // C
+ {
+ sum.fetch_add(8, std::memory_order_relaxed);
+ } // C
#pragma omp task depend(in : deps[0], deps[1], deps[2], deps[3])
- { sum.fetch_add(64, std::memory_order_relaxed); } // D
+ {
+ sum.fetch_add(64, std::memory_order_relaxed);
+ } // D
#pragma omp task depend(in : deps[1], deps[2])
- { sum.fetch_add(128, std::memory_order_relaxed); } // E
+ {
+ sum.fetch_add(128, std::memory_order_relaxed);
+ } // E
}
}
}
diff --git a/openmp/runtime/test/taskgraph/taskgraph_graph_id.cpp b/openmp/runtime/test/taskgraph/taskgraph_graph_id.cpp
index a82d210f0..fbada9fe1 100644
--- a/openmp/runtime/test/taskgraph/taskgraph_graph_id.cpp
+++ b/openmp/runtime/test/taskgraph/taskgraph_graph_id.cpp
@@ -1,5 +1,6 @@
-// RUN: %clangXX %flags %openmp_flags -fopenmp-version=60 %s -o %t && env OMP_NUM_THREADS=4 %libomp-run 2>&1 | FileCheck %s
-// REQUIRES: omp_taskgraph_experimental
+// RUN: %clangXX %flags %openmp_flags -fopenmp-version=60 %s -o %t && env
+// OMP_NUM_THREADS=4 %libomp-run 2>&1 | FileCheck %s REQUIRES:
+// omp_taskgraph_experimental
#include <atomic>
#include <cstdio>
diff --git a/openmp/runtime/test/taskgraph/taskgraph_graph_id_and_reset.cpp b/openmp/runtime/test/taskgraph/taskgraph_graph_id_and_reset.cpp
index eaf5ae465..61d6c02e9 100644
--- a/openmp/runtime/test/taskgraph/taskgraph_graph_id_and_reset.cpp
+++ b/openmp/runtime/test/taskgraph/taskgraph_graph_id_and_reset.cpp
@@ -1,5 +1,6 @@
-// RUN: %clangXX %flags %openmp_flags -fopenmp-version=60 %s -o %t && env OMP_NUM_THREADS=4 %libomp-run 2>&1 | FileCheck %s
-// REQUIRES: omp_taskgraph_experimental
+// RUN: %clangXX %flags %openmp_flags -fopenmp-version=60 %s -o %t && env
+// OMP_NUM_THREADS=4 %libomp-run 2>&1 | FileCheck %s REQUIRES:
+// omp_taskgraph_experimental
#include <atomic>
#include <cstdio>
@@ -25,7 +26,7 @@ int main() {
#pragma omp single
{
for (int iter = 0; iter < NumIters; ++iter) {
- const int gid = iter & 1; // alternate two records
+ const int gid = iter & 1; // alternate two records
const bool reset = (iter % 4) == 3; // periodically force re-record
#pragma omp taskgraph graph_id(gid) graph_reset(reset)
diff --git a/openmp/runtime/test/taskgraph/taskgraph_graph_reset.cpp b/openmp/runtime/test/taskgraph/taskgraph_graph_reset.cpp
index d05c73484..e98c5375d 100644
--- a/openmp/runtime/test/taskgraph/taskgraph_graph_reset.cpp
+++ b/openmp/runtime/test/taskgraph/taskgraph_graph_reset.cpp
@@ -1,5 +1,6 @@
-// RUN: %clangXX %flags %openmp_flags -fopenmp-version=60 %s -o %t && env OMP_NUM_THREADS=4 %libomp-run 2>&1 | FileCheck %s
-// REQUIRES: omp_taskgraph_experimental
+// RUN: %clangXX %flags %openmp_flags -fopenmp-version=60 %s -o %t && env
+// OMP_NUM_THREADS=4 %libomp-run 2>&1 | FileCheck %s REQUIRES:
+// omp_taskgraph_experimental
#include <atomic>
#include <cstdio>
``````````
</details>
https://github.com/llvm/llvm-project/pull/195075
More information about the llvm-branch-commits
mailing list