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

via Openmp-commits openmp-commits at lists.llvm.org
Sat Sep 9 20:43:27 PDT 2023


llvmbot wrote:

@llvm/pr-subscribers-openmp

<details>
<summary>Changes</summary>

Limit the number of AFFINITY_MAX_CPUS for VE because VE's sched_getaffinity doesn't work correctly with large sized mask buffer.
--
Full diff: https://github.com/llvm/llvm-project/pull/65872.diff

1 Files Affected:

- (modified) openmp/runtime/test/affinity/libomp_test_affinity.h (+6) 


<pre>
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) {
</pre>

</details>

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


More information about the Openmp-commits mailing list