[Openmp-commits] [openmp] 5d25dbf - [OpenMP][libomp] do not try to dlopen libmemkind on macOS

Jonathan Peyton via Openmp-commits openmp-commits at lists.llvm.org
Thu Jun 2 12:28:19 PDT 2022


Author: Daniel Douglas
Date: 2022-06-02T14:28:09-05:00
New Revision: 5d25dbff677e2854a285019a4cfbda969e64ace2

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

LOG: [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

Added: 
    

Modified: 
    openmp/runtime/src/kmp_alloc.cpp

Removed: 
    


################################################################################
diff  --git a/openmp/runtime/src/kmp_alloc.cpp b/openmp/runtime/src/kmp_alloc.cpp
index 222637bb4eaee..222cd16b8b88e 100644
--- a/openmp/runtime/src/kmp_alloc.cpp
+++ b/openmp/runtime/src/kmp_alloc.cpp
@@ -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);


        


More information about the Openmp-commits mailing list