[Openmp-commits] [openmp] [OpenMP][test][VE] Limit the number of AFFINITY_MAX_CPUS for VE (PR #65872)

Kazushi Marukawa via Openmp-commits openmp-commits at lists.llvm.org
Sat Sep 9 20:42:46 PDT 2023


https://github.com/kaz7 created https://github.com/llvm/llvm-project/pull/65872:

Limit the number of AFFINITY_MAX_CPUS for VE because VE's sched_getaffinity doesn't work correctly with large sized mask buffer.

>From 17376219bd10434559b06b961f1e51fa74539179 Mon Sep 17 00:00:00 2001
From: "Kazushi (Jam) Marukawa" <marukawa at nec.com>
Date: Sat, 2 Sep 2023 02:37:43 +0200
Subject: [PATCH] [OpenMP][test][VE] Limit the number of AFFINITY_MAX_CPUS for
 VE

Limit the number of AFFINITY_MAX_CPUS for VE because VE's sched_getaffinity
doesn't work correctly with large sized mask buffer.
---
 openmp/runtime/test/affinity/libomp_test_affinity.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/openmp/runtime/test/affinity/libomp_test_affinity.h b/openmp/runtime/test/affinity/libomp_test_affinity.h
index 1464d9c41414192..fb9316a3ed2dc4e 100644
--- a/openmp/runtime/test/affinity/libomp_test_affinity.h
+++ b/openmp/runtime/test/affinity/libomp_test_affinity.h
@@ -13,7 +13,13 @@ typedef struct affinity_mask_t {
   cpu_set_t *set;
 } affinity_mask_t;
 
+#ifdef __ve__
+// VE's sched_getaffinity put garbage if the buffer is too big.  512 is
+// a good number to make all tests run correctly.
+#define AFFINITY_MAX_CPUS 512
+#else
 #define AFFINITY_MAX_CPUS (32 * 64)
+#endif
 
 // Operating system affinity mask API
 static void affinity_mask_zero(affinity_mask_t *mask) {



More information about the Openmp-commits mailing list