@@ -1003,29 +1003,31 @@ hwloc_topology_dup(hwloc_topology_t *newp,
10031003/***** Make sure you update obj_type_priority[] below as well. *****/
10041004static const unsigned obj_type_order [] = {
10051005 /* first entry is HWLOC_OBJ_MACHINE */ 0 ,
1006- /* next entry is HWLOC_OBJ_PACKAGE */ 3 ,
1007- /* next entry is HWLOC_OBJ_CORE */ 12 ,
1008- /* next entry is HWLOC_OBJ_PU */ 16 ,
1009- /* next entry is HWLOC_OBJ_L1CACHE */ 10 ,
1010- /* next entry is HWLOC_OBJ_L2CACHE */ 8 ,
1011- /* next entry is HWLOC_OBJ_L3CACHE */ 6 ,
1012- /* next entry is HWLOC_OBJ_L4CACHE */ 5 ,
1013- /* next entry is HWLOC_OBJ_L5CACHE */ 4 ,
1014- /* next entry is HWLOC_OBJ_L1ICACHE */ 11 ,
1015- /* next entry is HWLOC_OBJ_L2ICACHE */ 9 ,
1016- /* next entry is HWLOC_OBJ_L3ICACHE */ 7 ,
1006+ /* next entry is HWLOC_OBJ_PACKAGE */ 4 ,
1007+ /* next entry is HWLOC_OBJ_CORE */ 13 ,
1008+ /* next entry is HWLOC_OBJ_PU */ 17 ,
1009+ /* next entry is HWLOC_OBJ_L1CACHE */ 11 ,
1010+ /* next entry is HWLOC_OBJ_L2CACHE */ 9 ,
1011+ /* next entry is HWLOC_OBJ_L3CACHE */ 7 ,
1012+ /* next entry is HWLOC_OBJ_L4CACHE */ 6 ,
1013+ /* next entry is HWLOC_OBJ_L5CACHE */ 5 ,
1014+ /* next entry is HWLOC_OBJ_L1ICACHE */ 12 ,
1015+ /* next entry is HWLOC_OBJ_L2ICACHE */ 10 ,
1016+ /* next entry is HWLOC_OBJ_L3ICACHE */ 8 ,
10171017 /* next entry is HWLOC_OBJ_GROUP */ 1 ,
1018- /* next entry is HWLOC_OBJ_NUMANODE */ 2 ,
1019- /* next entry is HWLOC_OBJ_BRIDGE */ 13 ,
1020- /* next entry is HWLOC_OBJ_PCI_DEVICE */ 14 ,
1021- /* next entry is HWLOC_OBJ_OS_DEVICE */ 15 ,
1022- /* next entry is HWLOC_OBJ_MISC */ 17
1018+ /* next entry is HWLOC_OBJ_NUMANODE */ 3 ,
1019+ /* next entry is HWLOC_OBJ_BRIDGE */ 14 ,
1020+ /* next entry is HWLOC_OBJ_PCI_DEVICE */ 15 ,
1021+ /* next entry is HWLOC_OBJ_OS_DEVICE */ 16 ,
1022+ /* next entry is HWLOC_OBJ_MISC */ 18 ,
1023+ /* next entry is HWLOC_OBJ_MEMCACHE */ 2
10231024};
10241025
10251026#ifndef NDEBUG /* only used in debug check assert if !NDEBUG */
10261027static const hwloc_obj_type_t obj_order_type [] = {
10271028 HWLOC_OBJ_MACHINE ,
10281029 HWLOC_OBJ_GROUP ,
1030+ HWLOC_OBJ_MEMCACHE ,
10291031 HWLOC_OBJ_NUMANODE ,
10301032 HWLOC_OBJ_PACKAGE ,
10311033 HWLOC_OBJ_L5CACHE ,
@@ -1077,7 +1079,8 @@ static const int obj_type_priority[] = {
10771079 /* next entry is HWLOC_OBJ_BRIDGE */ 0 ,
10781080 /* next entry is HWLOC_OBJ_PCI_DEVICE */ 100 ,
10791081 /* next entry is HWLOC_OBJ_OS_DEVICE */ 100 ,
1080- /* next entry is HWLOC_OBJ_MISC */ 0
1082+ /* next entry is HWLOC_OBJ_MISC */ 0 ,
1083+ /* next entry is HWLOC_OBJ_MEMCACHE */ 19
10811084};
10821085
10831086int hwloc_compare_types (hwloc_obj_type_t type1 , hwloc_obj_type_t type2 )
@@ -2698,7 +2701,17 @@ hwloc_list_special_objects(hwloc_topology_t topology, hwloc_obj_t obj)
26982701 /* Insert the main NUMA node list */
26992702 hwloc_append_special_object (& topology -> slevels [HWLOC_SLEVEL_NUMANODE ], obj );
27002703
2701- /* Recurse */
2704+ /* Recurse, NUMA nodes only have Misc children */
2705+ for_each_misc_child (child , obj )
2706+ hwloc_list_special_objects (topology , child );
2707+
2708+ } else if (obj -> type == HWLOC_OBJ_MEMCACHE ) {
2709+ obj -> next_cousin = NULL ;
2710+ obj -> depth = HWLOC_TYPE_DEPTH_MEMCACHE ;
2711+ /* Insert the main MemCache list */
2712+ hwloc_append_special_object (& topology -> slevels [HWLOC_SLEVEL_MEMCACHE ], obj );
2713+
2714+ /* Recurse, MemCaches have NUMA nodes or Misc children */
27022715 for_each_memory_child (child , obj )
27032716 hwloc_list_special_objects (topology , child );
27042717 for_each_misc_child (child , obj )
@@ -2731,6 +2744,7 @@ hwloc_list_special_objects(hwloc_topology_t topology, hwloc_obj_t obj)
27312744 /* Insert in the main osdev list */
27322745 hwloc_append_special_object (& topology -> slevels [HWLOC_SLEVEL_OSDEV ], obj );
27332746 }
2747+
27342748 /* Recurse, I/O only have I/O and Misc children */
27352749 for_each_io_child (child , obj )
27362750 hwloc_list_special_objects (topology , child );
@@ -3337,6 +3351,7 @@ hwloc_topology_setup_defaults(struct hwloc_topology *topology)
33373351 HWLOC_BUILD_ASSERT (HWLOC_SLEVEL_BRIDGE == HWLOC_SLEVEL_FROM_DEPTH (HWLOC_TYPE_DEPTH_BRIDGE ));
33383352 HWLOC_BUILD_ASSERT (HWLOC_SLEVEL_PCIDEV == HWLOC_SLEVEL_FROM_DEPTH (HWLOC_TYPE_DEPTH_PCI_DEVICE ));
33393353 HWLOC_BUILD_ASSERT (HWLOC_SLEVEL_OSDEV == HWLOC_SLEVEL_FROM_DEPTH (HWLOC_TYPE_DEPTH_OS_DEVICE ));
3354+ HWLOC_BUILD_ASSERT (HWLOC_SLEVEL_MEMCACHE == HWLOC_SLEVEL_FROM_DEPTH (HWLOC_TYPE_DEPTH_MEMCACHE ));
33403355
33413356 /* sane values to type_depth */
33423357 hwloc_reset_normal_type_depths (topology );
@@ -3345,6 +3360,7 @@ hwloc_topology_setup_defaults(struct hwloc_topology *topology)
33453360 topology -> type_depth [HWLOC_OBJ_BRIDGE ] = HWLOC_TYPE_DEPTH_BRIDGE ;
33463361 topology -> type_depth [HWLOC_OBJ_PCI_DEVICE ] = HWLOC_TYPE_DEPTH_PCI_DEVICE ;
33473362 topology -> type_depth [HWLOC_OBJ_OS_DEVICE ] = HWLOC_TYPE_DEPTH_OS_DEVICE ;
3363+ topology -> type_depth [HWLOC_OBJ_MEMCACHE ] = HWLOC_TYPE_DEPTH_MEMCACHE ;
33483364
33493365 /* Create the actual machine object, but don't touch its attributes yet
33503366 * since the OS backend may still change the object into something else
@@ -3513,6 +3529,7 @@ hwloc__topology_filter_init(struct hwloc_topology *topology)
35133529 topology -> type_filter [HWLOC_OBJ_L1ICACHE ] = HWLOC_TYPE_FILTER_KEEP_NONE ;
35143530 topology -> type_filter [HWLOC_OBJ_L2ICACHE ] = HWLOC_TYPE_FILTER_KEEP_NONE ;
35153531 topology -> type_filter [HWLOC_OBJ_L3ICACHE ] = HWLOC_TYPE_FILTER_KEEP_NONE ;
3532+ topology -> type_filter [HWLOC_OBJ_MEMCACHE ] = HWLOC_TYPE_FILTER_KEEP_NONE ;
35163533 topology -> type_filter [HWLOC_OBJ_GROUP ] = HWLOC_TYPE_FILTER_KEEP_STRUCTURE ;
35173534 topology -> type_filter [HWLOC_OBJ_MISC ] = HWLOC_TYPE_FILTER_KEEP_NONE ;
35183535 topology -> type_filter [HWLOC_OBJ_BRIDGE ] = HWLOC_TYPE_FILTER_KEEP_NONE ;
@@ -4426,6 +4443,8 @@ hwloc__check_object(hwloc_topology_t topology, hwloc_bitmap_t gp_indexes, hwloc_
44264443 assert (obj -> cpuset );
44274444 if (obj -> type == HWLOC_OBJ_NUMANODE )
44284445 assert (obj -> depth == HWLOC_TYPE_DEPTH_NUMANODE );
4446+ else if (obj -> type == HWLOC_OBJ_MEMCACHE )
4447+ assert (obj -> depth == HWLOC_TYPE_DEPTH_MEMCACHE );
44294448 else
44304449 assert (obj -> depth >= 0 );
44314450 }
@@ -4622,7 +4641,8 @@ hwloc_topology_check(struct hwloc_topology *topology)
46224641 HWLOC_BUILD_ASSERT (HWLOC_OBJ_BRIDGE + 1 == HWLOC_OBJ_PCI_DEVICE );
46234642 HWLOC_BUILD_ASSERT (HWLOC_OBJ_PCI_DEVICE + 1 == HWLOC_OBJ_OS_DEVICE );
46244643 HWLOC_BUILD_ASSERT (HWLOC_OBJ_OS_DEVICE + 1 == HWLOC_OBJ_MISC );
4625- HWLOC_BUILD_ASSERT (HWLOC_OBJ_MISC + 1 == HWLOC_OBJ_TYPE_MAX );
4644+ HWLOC_BUILD_ASSERT (HWLOC_OBJ_MISC + 1 == HWLOC_OBJ_MEMCACHE );
4645+ HWLOC_BUILD_ASSERT (HWLOC_OBJ_MEMCACHE + 1 == HWLOC_OBJ_TYPE_MAX );
46264646
46274647 /* make sure order and priority arrays have the right size */
46284648 HWLOC_BUILD_ASSERT (sizeof (obj_type_order )/sizeof (* obj_type_order ) == HWLOC_OBJ_TYPE_MAX );
@@ -4668,6 +4688,7 @@ hwloc_topology_check(struct hwloc_topology *topology)
46684688 int d ;
46694689 type = hwloc_get_depth_type (topology , j );
46704690 assert (type != HWLOC_OBJ_NUMANODE );
4691+ assert (type != HWLOC_OBJ_MEMCACHE );
46714692 assert (type != HWLOC_OBJ_PCI_DEVICE );
46724693 assert (type != HWLOC_OBJ_BRIDGE );
46734694 assert (type != HWLOC_OBJ_OS_DEVICE );
@@ -4683,6 +4704,9 @@ hwloc_topology_check(struct hwloc_topology *topology)
46834704 if (type == HWLOC_OBJ_NUMANODE ) {
46844705 assert (d == HWLOC_TYPE_DEPTH_NUMANODE );
46854706 assert (hwloc_get_depth_type (topology , d ) == HWLOC_OBJ_NUMANODE );
4707+ } else if (type == HWLOC_OBJ_MEMCACHE ) {
4708+ assert (d == HWLOC_TYPE_DEPTH_MEMCACHE );
4709+ assert (hwloc_get_depth_type (topology , d ) == HWLOC_OBJ_MEMCACHE );
46864710 } else if (type == HWLOC_OBJ_BRIDGE ) {
46874711 assert (d == HWLOC_TYPE_DEPTH_BRIDGE );
46884712 assert (hwloc_get_depth_type (topology , d ) == HWLOC_OBJ_BRIDGE );
0 commit comments