[Openmp-commits] [PATCH] D32496: Fix Hwloc API Incompatibility

Jonathan Peyton via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Tue Apr 25 10:24:29 PDT 2017


jlpeyton created this revision.

Older Hwloc's (< 1.10.0) don't offer the `HWLOC_OBJ_NUMANODE` nor `HWLOC_OBJ_PACKAGE` types.  Instead they are named `HWLOC_OBJ_NODE` and `HWLOC_OBJ_SOCKET` instead.  This patch just defines the newer names when using an older Hwloc.  Tested with 1.9.1, 1.10.1, and 1.11.6.


Repository:
  rL LLVM

https://reviews.llvm.org/D32496

Files:
  runtime/src/kmp.h


Index: runtime/src/kmp.h
===================================================================
--- runtime/src/kmp.h
+++ runtime/src/kmp.h
@@ -88,6 +88,10 @@
 
 #if KMP_USE_HWLOC && KMP_AFFINITY_SUPPORTED
 # include "hwloc.h"
+# if HWLOC_API_VERSION < 0x00010a00
+#  define HWLOC_OBJ_NUMANODE HWLOC_OBJ_NODE
+#  define HWLOC_OBJ_PACKAGE HWLOC_OBJ_SOCKET
+# endif
 #endif
 
 #if KMP_ARCH_X86 || KMP_ARCH_X86_64


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D32496.96592.patch
Type: text/x-patch
Size: 408 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20170425/f006e59d/attachment.bin>


More information about the Openmp-commits mailing list