[OpenMP][libomp] do not try to dlopen libmemkind on macOS

The memkind library is only available for linux. Calling dlopen here
can also be problematic in a client app that fork'ed.

Differential Revision: https://reviews.llvm.org/D126579
This commit is contained in:
Daniel Douglas 2022-06-02 14:04:58 -05:00 committed by Jonathan Peyton
parent 30b7ffe74e
commit 5d25dbff67
1 changed files with 2 additions and 2 deletions

View File

@ -1256,7 +1256,7 @@ static bool __kmp_target_mem_available;
MA == llvm_omp_target_shared_mem_alloc || \
MA == llvm_omp_target_device_mem_alloc)
#if KMP_OS_UNIX && KMP_DYNAMIC_LIB
#if KMP_OS_UNIX && KMP_DYNAMIC_LIB && !KMP_OS_DARWIN
static inline void chk_kind(void ***pkind) {
KMP_DEBUG_ASSERT(pkind);
if (*pkind) // symbol found
@ -1267,7 +1267,7 @@ static inline void chk_kind(void ***pkind) {
void __kmp_init_memkind() {
// as of 2018-07-31 memkind does not support Windows*, exclude it for now
#if KMP_OS_UNIX && KMP_DYNAMIC_LIB
#if KMP_OS_UNIX && KMP_DYNAMIC_LIB && !KMP_OS_DARWIN
// use of statically linked memkind is problematic, as it depends on libnuma
kmp_mk_lib_name = "libmemkind.so";
h_memkind = dlopen(kmp_mk_lib_name, RTLD_LAZY);