diff options
author | Jonathan Peyton <jonathan.l.peyton@intel.com> | 2022-10-03 15:14:40 -0500 |
---|---|---|
committer | Jonathan Peyton <jonathan.l.peyton@intel.com> | 2022-10-28 15:21:07 -0500 |
commit | 7a9643fd2a07976576fd82b987d1eca924a747dd (patch) | |
tree | e7fa48880d8ba632e2f8c444ad0c1403cf3044bd /openmp/runtime/src/z_Linux_util.cpp | |
parent | b03d67f7f58b305a26bb742860a444ad837f1f42 (diff) | |
download | llvm-7a9643fd2a07976576fd82b987d1eca924a747dd.zip llvm-7a9643fd2a07976576fd82b987d1eca924a747dd.tar.gz llvm-7a9643fd2a07976576fd82b987d1eca924a747dd.tar.bz2 |
[OpenMP][libomp] Add hidden helper affinity
Add new hidden helper affinity via the environment variable,
KMP_HIDDEN_HELPER_AFFINITY, which allows users to assign thread
affinity to hidden helper threads using the same syntax as
KMP_AFFINITY. OMP_PLACES/OMP_PROC_BIND have no interaction with
KMP_HIDDEN_HELPER_AFFINITY.
Differential Revision: https://reviews.llvm.org/D135113
Diffstat (limited to 'openmp/runtime/src/z_Linux_util.cpp')
-rw-r--r-- | openmp/runtime/src/z_Linux_util.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/openmp/runtime/src/z_Linux_util.cpp b/openmp/runtime/src/z_Linux_util.cpp index 7b027a2..21771e6 100644 --- a/openmp/runtime/src/z_Linux_util.cpp +++ b/openmp/runtime/src/z_Linux_util.cpp @@ -1231,7 +1231,8 @@ static void __kmp_atfork_child(void) { if (__kmp_nested_proc_bind.bind_types != NULL) { __kmp_nested_proc_bind.bind_types[0] = proc_bind_false; } - __kmp_affinity = KMP_AFFINITY_INIT("KMP_AFFINITY"); + for (kmp_affinity_t *affinity : __kmp_affinities) + *affinity = KMP_AFFINITY_INIT(affinity->env_var); __kmp_affin_fullMask = nullptr; __kmp_affin_origMask = nullptr; #endif // KMP_AFFINITY_SUPPORTED |