[Openmp-commits] [openmp] c0e4a0c - [openmp] [test] Unbreak tests that rely on hidden_helper_task on Windows

Martin Storsjö via Openmp-commits openmp-commits at lists.llvm.org
Thu Nov 17 12:25:10 PST 2022


Author: Martin Storsjö
Date: 2022-11-17T22:24:24+02:00
New Revision: c0e4a0c3a46e16ef066ec11d1d48298b06bef21c

URL: https://github.com/llvm/llvm-project/commit/c0e4a0c3a46e16ef066ec11d1d48298b06bef21c
DIFF: https://github.com/llvm/llvm-project/commit/c0e4a0c3a46e16ef066ec11d1d48298b06bef21c.diff

LOG: [openmp] [test] Unbreak tests that rely on hidden_helper_task on Windows

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.

Add a lit test feature for hidden helper tasks (only made available
on Linux) and mark two tests as requiring this feature.

Disable hidden helper tasks in the test that doesn't really involve
them, for consistent behaviour across platforms.

Differential Revision: https://reviews.llvm.org/D137749

Added: 
    

Modified: 
    openmp/runtime/test/lit.cfg
    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

Removed: 
    


################################################################################
diff  --git a/openmp/runtime/test/lit.cfg b/openmp/runtime/test/lit.cfg
index a8dfdff29b2e2..666015034b0f3 100644
--- a/openmp/runtime/test/lit.cfg
+++ b/openmp/runtime/test/lit.cfg
@@ -108,6 +108,9 @@ if config.operating_system == 'NetBSD':
 if config.operating_system in ['Linux', 'Windows']:
     config.available_features.add('affinity')
 
+if config.operating_system in ['Linux']:
+    config.available_features.add('hidden-helper')
+
 import multiprocessing
 try:
     if multiprocessing.cpu_count() > 1:

diff  --git a/openmp/runtime/test/tasking/hidden_helper_task/affinity.cpp b/openmp/runtime/test/tasking/hidden_helper_task/affinity.cpp
index 4816a01922208..cc9f43819edba 100644
--- a/openmp/runtime/test/tasking/hidden_helper_task/affinity.cpp
+++ b/openmp/runtime/test/tasking/hidden_helper_task/affinity.cpp
@@ -1,3 +1,4 @@
+// REQUIRES: hidden-helper
 // 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

diff  --git a/openmp/runtime/test/tasking/hidden_helper_task/gtid.cpp b/openmp/runtime/test/tasking/hidden_helper_task/gtid.cpp
index 881e27df723c7..bc02caccb69ed 100644
--- a/openmp/runtime/test/tasking/hidden_helper_task/gtid.cpp
+++ b/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: hidden-helper
 
 /*
  * This test aims to check whether hidden helper thread has right gtid. We also

diff  --git a/openmp/runtime/test/worksharing/for/kmp_sch_simd_guided.c b/openmp/runtime/test/worksharing/for/kmp_sch_simd_guided.c
index 5ec46520fe251..046b77dcc39e0 100644
--- a/openmp/runtime/test/worksharing/for/kmp_sch_simd_guided.c
+++ b/openmp/runtime/test/worksharing/for/kmp_sch_simd_guided.c
@@ -1,4 +1,4 @@
-// RUN: %libomp-compile-and-run
+// RUN: %libomp-compile && env LIBOMP_USE_HIDDEN_HELPER_TASK=0 LIBOMP_NUM_HIDDEN_HELPER_THREADS=0 %libomp-run
 /*
   Test for the 'schedule(simd:guided)' clause.
   Compiler needs to generate a dynamic dispatching and pass the schedule
@@ -50,7 +50,7 @@ extern int __kmpc_dispatch_next_8(id*, int, void*, void*, void*, void*);
 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.
-static int __kmp_hidden_helper_threads_num = 8;
+static int __kmp_hidden_helper_threads_num = 0;
 
 // ---------------------------------------------------------------------------
 int run_loop_64(i64 loop_lb, i64 loop_ub, i64 loop_st, int loop_chunk) {


        


More information about the Openmp-commits mailing list