@@ -1003,29 +1003,31 @@ hwloc_topology_dup(hwloc_topology_t *newp,
1003
1003
/***** Make sure you update obj_type_priority[] below as well. *****/
1004
1004
static const unsigned obj_type_order [] = {
1005
1005
/* 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 ,
1017
1017
/* 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
1023
1024
};
1024
1025
1025
1026
#ifndef NDEBUG /* only used in debug check assert if !NDEBUG */
1026
1027
static const hwloc_obj_type_t obj_order_type [] = {
1027
1028
HWLOC_OBJ_MACHINE ,
1028
1029
HWLOC_OBJ_GROUP ,
1030
+ HWLOC_OBJ_MEMCACHE ,
1029
1031
HWLOC_OBJ_NUMANODE ,
1030
1032
HWLOC_OBJ_PACKAGE ,
1031
1033
HWLOC_OBJ_L5CACHE ,
@@ -1077,7 +1079,8 @@ static const int obj_type_priority[] = {
1077
1079
/* next entry is HWLOC_OBJ_BRIDGE */ 0 ,
1078
1080
/* next entry is HWLOC_OBJ_PCI_DEVICE */ 100 ,
1079
1081
/* 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
1081
1084
};
1082
1085
1083
1086
int 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)
2698
2701
/* Insert the main NUMA node list */
2699
2702
hwloc_append_special_object (& topology -> slevels [HWLOC_SLEVEL_NUMANODE ], obj );
2700
2703
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 */
2702
2715
for_each_memory_child (child , obj )
2703
2716
hwloc_list_special_objects (topology , child );
2704
2717
for_each_misc_child (child , obj )
@@ -2731,6 +2744,7 @@ hwloc_list_special_objects(hwloc_topology_t topology, hwloc_obj_t obj)
2731
2744
/* Insert in the main osdev list */
2732
2745
hwloc_append_special_object (& topology -> slevels [HWLOC_SLEVEL_OSDEV ], obj );
2733
2746
}
2747
+
2734
2748
/* Recurse, I/O only have I/O and Misc children */
2735
2749
for_each_io_child (child , obj )
2736
2750
hwloc_list_special_objects (topology , child );
@@ -3337,6 +3351,7 @@ hwloc_topology_setup_defaults(struct hwloc_topology *topology)
3337
3351
HWLOC_BUILD_ASSERT (HWLOC_SLEVEL_BRIDGE == HWLOC_SLEVEL_FROM_DEPTH (HWLOC_TYPE_DEPTH_BRIDGE ));
3338
3352
HWLOC_BUILD_ASSERT (HWLOC_SLEVEL_PCIDEV == HWLOC_SLEVEL_FROM_DEPTH (HWLOC_TYPE_DEPTH_PCI_DEVICE ));
3339
3353
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 ));
3340
3355
3341
3356
/* sane values to type_depth */
3342
3357
hwloc_reset_normal_type_depths (topology );
@@ -3345,6 +3360,7 @@ hwloc_topology_setup_defaults(struct hwloc_topology *topology)
3345
3360
topology -> type_depth [HWLOC_OBJ_BRIDGE ] = HWLOC_TYPE_DEPTH_BRIDGE ;
3346
3361
topology -> type_depth [HWLOC_OBJ_PCI_DEVICE ] = HWLOC_TYPE_DEPTH_PCI_DEVICE ;
3347
3362
topology -> type_depth [HWLOC_OBJ_OS_DEVICE ] = HWLOC_TYPE_DEPTH_OS_DEVICE ;
3363
+ topology -> type_depth [HWLOC_OBJ_MEMCACHE ] = HWLOC_TYPE_DEPTH_MEMCACHE ;
3348
3364
3349
3365
/* Create the actual machine object, but don't touch its attributes yet
3350
3366
* since the OS backend may still change the object into something else
@@ -3513,6 +3529,7 @@ hwloc__topology_filter_init(struct hwloc_topology *topology)
3513
3529
topology -> type_filter [HWLOC_OBJ_L1ICACHE ] = HWLOC_TYPE_FILTER_KEEP_NONE ;
3514
3530
topology -> type_filter [HWLOC_OBJ_L2ICACHE ] = HWLOC_TYPE_FILTER_KEEP_NONE ;
3515
3531
topology -> type_filter [HWLOC_OBJ_L3ICACHE ] = HWLOC_TYPE_FILTER_KEEP_NONE ;
3532
+ topology -> type_filter [HWLOC_OBJ_MEMCACHE ] = HWLOC_TYPE_FILTER_KEEP_NONE ;
3516
3533
topology -> type_filter [HWLOC_OBJ_GROUP ] = HWLOC_TYPE_FILTER_KEEP_STRUCTURE ;
3517
3534
topology -> type_filter [HWLOC_OBJ_MISC ] = HWLOC_TYPE_FILTER_KEEP_NONE ;
3518
3535
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_
4426
4443
assert (obj -> cpuset );
4427
4444
if (obj -> type == HWLOC_OBJ_NUMANODE )
4428
4445
assert (obj -> depth == HWLOC_TYPE_DEPTH_NUMANODE );
4446
+ else if (obj -> type == HWLOC_OBJ_MEMCACHE )
4447
+ assert (obj -> depth == HWLOC_TYPE_DEPTH_MEMCACHE );
4429
4448
else
4430
4449
assert (obj -> depth >= 0 );
4431
4450
}
@@ -4622,7 +4641,8 @@ hwloc_topology_check(struct hwloc_topology *topology)
4622
4641
HWLOC_BUILD_ASSERT (HWLOC_OBJ_BRIDGE + 1 == HWLOC_OBJ_PCI_DEVICE );
4623
4642
HWLOC_BUILD_ASSERT (HWLOC_OBJ_PCI_DEVICE + 1 == HWLOC_OBJ_OS_DEVICE );
4624
4643
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 );
4626
4646
4627
4647
/* make sure order and priority arrays have the right size */
4628
4648
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)
4668
4688
int d ;
4669
4689
type = hwloc_get_depth_type (topology , j );
4670
4690
assert (type != HWLOC_OBJ_NUMANODE );
4691
+ assert (type != HWLOC_OBJ_MEMCACHE );
4671
4692
assert (type != HWLOC_OBJ_PCI_DEVICE );
4672
4693
assert (type != HWLOC_OBJ_BRIDGE );
4673
4694
assert (type != HWLOC_OBJ_OS_DEVICE );
@@ -4683,6 +4704,9 @@ hwloc_topology_check(struct hwloc_topology *topology)
4683
4704
if (type == HWLOC_OBJ_NUMANODE ) {
4684
4705
assert (d == HWLOC_TYPE_DEPTH_NUMANODE );
4685
4706
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 );
4686
4710
} else if (type == HWLOC_OBJ_BRIDGE ) {
4687
4711
assert (d == HWLOC_TYPE_DEPTH_BRIDGE );
4688
4712
assert (hwloc_get_depth_type (topology , d ) == HWLOC_OBJ_BRIDGE );
0 commit comments