[Openmp-commits] [PATCH] D137749: [openmp] [test] Unbreak tests that rely on hidden_helper_task on Windows

Martin Storsjö via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Wed Nov 9 14:29:13 PST 2022


mstorsjo created this revision.
mstorsjo added reviewers: AndreyChurbanov, JonChesterfield, natgla.
Herald added subscribers: guansong, krytarowski, yaxunl.
Herald added a project: All.
mstorsjo requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added a subscriber: sstefan1.
Herald added a project: OpenMP.

The hidden helper task is only enabled on Linux (kmp_runtime.cpp
initializes __kmp_enable_hidden_helper to TRUE for linux but to
FALSE for any other OS), and the __kmp_stg_parse_use_hidden_helper
function always makes it disabled on non-Linux OSes too.

Mark tests that rely on the hidden helper tasks as requiring Linux.

Set the initial value of __kmp_hidden_helper_threads_num accordingly
in a testcase that needs to know it.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D137749

Files:
  openmp/runtime/test/tasking/hidden_helper_task/affinity.cpp
  openmp/runtime/test/tasking/hidden_helper_task/gtid.cpp
  openmp/runtime/test/worksharing/for/kmp_sch_simd_guided.c


Index: openmp/runtime/test/worksharing/for/kmp_sch_simd_guided.c
===================================================================
--- openmp/runtime/test/worksharing/for/kmp_sch_simd_guided.c
+++ openmp/runtime/test/worksharing/for/kmp_sch_simd_guided.c
@@ -50,7 +50,11 @@
 static id loc = {0, 2, 0, 0, ";file;func;0;0;;"};
 // This variable is defined in OpenMP RTL but we can't have it exposed so we
 // need to redefine it here.
+#ifdef __linux__
 static int __kmp_hidden_helper_threads_num = 8;
+#else
+static int __kmp_hidden_helper_threads_num = 0;
+#endif
 
 // ---------------------------------------------------------------------------
 int run_loop_64(i64 loop_lb, i64 loop_ub, i64 loop_st, int loop_chunk) {
Index: openmp/runtime/test/tasking/hidden_helper_task/gtid.cpp
===================================================================
--- openmp/runtime/test/tasking/hidden_helper_task/gtid.cpp
+++ openmp/runtime/test/tasking/hidden_helper_task/gtid.cpp
@@ -1,5 +1,6 @@
 // RUN: %libomp-cxx-compile-and-run
 // RUN: %libomp-cxx-compile && env OMP_NUM_THREADS=1 %libomp-run
+// REQUIRES: linux
 
 /*
  * This test aims to check whether hidden helper thread has right gtid. We also
Index: openmp/runtime/test/tasking/hidden_helper_task/affinity.cpp
===================================================================
--- openmp/runtime/test/tasking/hidden_helper_task/affinity.cpp
+++ openmp/runtime/test/tasking/hidden_helper_task/affinity.cpp
@@ -1,3 +1,4 @@
+// REQUIRES: linux
 // RUN: %libomp-cxx-compile
 // RUN: env LIBOMP_USE_HIDDEN_HELPER_TASK=1 LIBOMP_NUM_HIDDEN_HELPER_THREADS=8 \
 // RUN:     KMP_HIDDEN_HELPER_AFFINITY=verbose,granularity=socket,compact %libomp-run 2>&1 | FileCheck --check-prefix=SOCKET %s


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D137749.474369.patch
Type: text/x-patch
Size: 1738 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20221109/14c217a4/attachment-0001.bin>


More information about the Openmp-commits mailing list