[Openmp-commits] [PATCH] D96748: [OpenMP] Update HWLOC topology detection for die level

Jonathan Peyton via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Mon Feb 15 21:47:37 PST 2021


jlpeyton created this revision.
jlpeyton added reviewers: AndreyChurbanov, tlwilmar, hbae, Nawrin.
jlpeyton added a project: OpenMP.
Herald added subscribers: guansong, yaxunl.
jlpeyton requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added a subscriber: sstefan1.

Incorporate HWLOC 2.x code to detect die level.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D96748

Files:
  openmp/runtime/src/kmp_affinity.cpp


Index: openmp/runtime/src/kmp_affinity.cpp
===================================================================
--- openmp/runtime/src/kmp_affinity.cpp
+++ openmp/runtime/src/kmp_affinity.cpp
@@ -19,6 +19,10 @@
 #if KMP_USE_HIER_SCHED
 #include "kmp_dispatch_hier.h"
 #endif
+#if KMP_USE_HWLOC
+// Copied from hwloc
+#define HWLOC_GROUP_KIND_INTEL_DIE 104
+#endif
 
 // Store the real or imagined machine hierarchy here
 static hierarchy_info machine_hierarchy;
@@ -583,6 +587,13 @@
     return KMP_HW_CORE;
   case HWLOC_OBJ_PU:
     return KMP_HW_THREAD;
+  case HWLOC_OBJ_GROUP:
+    if (obj->attr->group.kind == HWLOC_GROUP_KIND_INTEL_DIE)
+      return KMP_HW_DIE;
+#if HWLOC_API_VERSION >= 0x00020100
+  case HWLOC_OBJ_DIE:
+    return KMP_HW_DIE;
+#endif
   }
   return KMP_HW_UNKNOWN;
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D96748.323883.patch
Type: text/x-patch
Size: 795 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20210216/751dcfeb/attachment.bin>


More information about the Openmp-commits mailing list