Skip to content

Commit c1a7491

Browse files
committed
API: add a new MEMCACHE object type for Memory-side Caches
These caches are coming in Intel platforms, and they will be exposed by the ACPI HMAT table and Linux 5.2+. KNL MCDRAM in Cache was actually a memory-side cache but the platform was not ready to expose it. This is a new (second) "memory" object type (the other one is NUMA node). It's not considered a "cache" type as other usual CPU-side caches. Object attributes are identical to usual cache attributes. These caches have their own virtual depth. They will be placed between CPU-side parent and NUMA nodes, in the memory hierarchy of children. e.g. on KNL in Hybrid mode: Group(Cluster) MemCache NUMANode(DDR) NUMANode(MCDRAM) L2 PU ... Memory-side caches are disabled by default to avoid disturbing existing applications where we usually want NUMA nodes as immediate memory children of CPU-side objects. This breaks the shmem ABI, which means 2.1 won't be able to share topologies in shmem with 2.0. Signed-off-by: Brice Goglin <[email protected]>
1 parent 0740983 commit c1a7491

File tree

12 files changed

+131
-48
lines changed

12 files changed

+131
-48
lines changed

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ bug fixes (and other actions) for each version of hwloc since version
1919
Version 2.1.0
2020
-------------
2121
* API
22+
+ Add the new HWLOC_OBJ_MEMCACHE object type for memory-side caches.
23+
- They are filtered-out by default, except in command-line tools.
2224
+ Add HWLOC_RESTRICT_FLAG_BYNODESET and _REMOVE_MEMLESS for restricting
2325
topologies based on some memory nodes.
2426
+ Add hwloc_topology_set_components() for blacklisting some components

doc/hwloc.doxy

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ Make sure to have had a look at those too!
514514
a NUMA memory node, etc. The different types detected by hwloc are
515515
detailed in the ::hwloc_obj_type_t enumeration.
516516

517-
There are four kinds of Objects: Memory (NUMA nodes), I/O (Bridges, PCI and OS devices),
517+
There are four kinds of Objects: Memory (NUMA nodes and Memory-side caches), I/O (Bridges, PCI and OS devices),
518518
Misc, and Normal (everything else, including Machine, Package, Core, PU, CPU Caches, etc.).
519519
Normal and Memory objects have (non-NULL) CPU sets and nodesets, while I/O and Misc don't.
520520

@@ -552,6 +552,16 @@ Make sure to have had a look at those too!
552552
(see \ref termsanddefs_tree).
553553
</dd>
554554

555+
<dt>Memory-side Cache</dt>
556+
<dd>
557+
A cache in front of a specific memory region (e.g. a range of physical addresses).
558+
It caches all accesses to that region without caring about which core issued the request.
559+
This is the opposite of usual CPU caches where only accesses from the local cores
560+
are cached, without caring about the target memory.
561+
562+
In hwloc, memory-side caches are memory objects placed between their local CPU objects
563+
(parent) and the target NUMA node memory (child).
564+
</dd>
555565
</dl>
556566

557567

@@ -3948,7 +3958,7 @@ hwloc_get_next_child() may still be used to iterate over all children of all lis
39483958
Given the above, objects may now be of 4 kinds:
39493959
<ul>
39503960
<li>Normal (everything not listed below, including Machine, Package, Core, PU, CPU Caches, etc);</li>
3951-
<li>Memory (currently only NUMA nodes), attached to parents as Memory children;</li>
3961+
<li>Memory (currently NUMA nodes or Memory-side Caches), attached to parents as Memory children;</li>
39523962
<li>I/O (Bridges, PCI and OS devices), attached to parents as I/O children;</li>
39533963
<li>Misc objects, attached to parents as Misc children.</li>
39543964
</ul>

hwloc/hwloc2.dtd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!--
22
Copyright © 2009 CNRS
3-
Copyright © 2009-2017 Inria. All rights reserved.
3+
Copyright © 2009-2019 Inria. All rights reserved.
44
Copyright © 2009-2011 Université Bordeaux.
55
See COPYING in top-level directory.
66

@@ -11,7 +11,7 @@
1111
<!ATTLIST topology version CDATA "">
1212

1313
<!ELEMENT object (page_type*,info*,userdata*,object*)>
14-
<!ATTLIST object type (Machine | Misc | Group | NUMANode | Package | L1Cache | L2Cache | L3Cache | L4Cache | L5Cache | L1iCache | L2iCache | L3iCache | Core | PU | Bridge | PCIDev | OSDev) #REQUIRED>
14+
<!ATTLIST object type (Machine | Misc | Group | NUMANode | MemCache | Package | L1Cache | L2Cache | L3Cache | L4Cache | L5Cache | L1iCache | L2iCache | L3iCache | Core | PU | Bridge | PCIDev | OSDev) #REQUIRED>
1515
<!ATTLIST object subtype CDATA "" >
1616
<!ATTLIST object os_index CDATA "-1" >
1717
<!ATTLIST object gp_index CDATA "-1" >

hwloc/topology.c

Lines changed: 43 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,29 +1003,31 @@ hwloc_topology_dup(hwloc_topology_t *newp,
10031003
/***** Make sure you update obj_type_priority[] below as well. *****/
10041004
static 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 */
10261027
static 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

10831086
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)
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);

hwloc/traversal.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright © 2009 CNRS
3-
* Copyright © 2009-2018 Inria. All rights reserved.
3+
* Copyright © 2009-2019 Inria. All rights reserved.
44
* Copyright © 2009-2010 Université Bordeaux
55
* Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved.
66
* See COPYING in top-level directory.
@@ -41,6 +41,8 @@ hwloc_get_depth_type (hwloc_topology_t topology, int depth)
4141
return HWLOC_OBJ_OS_DEVICE;
4242
case HWLOC_TYPE_DEPTH_MISC:
4343
return HWLOC_OBJ_MISC;
44+
case HWLOC_TYPE_DEPTH_MEMCACHE:
45+
return HWLOC_OBJ_MEMCACHE;
4446
default:
4547
return HWLOC_OBJ_TYPE_NONE;
4648
}
@@ -238,6 +240,7 @@ hwloc_obj_type_string (hwloc_obj_type_t obj)
238240
case HWLOC_OBJ_MACHINE: return "Machine";
239241
case HWLOC_OBJ_MISC: return "Misc";
240242
case HWLOC_OBJ_GROUP: return "Group";
243+
case HWLOC_OBJ_MEMCACHE: return "MemCache";
241244
case HWLOC_OBJ_NUMANODE: return "NUMANode";
242245
case HWLOC_OBJ_PACKAGE: return "Package";
243246
case HWLOC_OBJ_L1CACHE: return "L1Cache";
@@ -337,6 +340,9 @@ hwloc_type_sscanf(const char *string, hwloc_obj_type_t *typep,
337340
} else if (hwloc__type_match(string, "numanode", 2)
338341
|| hwloc__type_match(string, "node", 2)) { /* for convenience */
339342
type = HWLOC_OBJ_NUMANODE;
343+
} else if (hwloc__type_match(string, "memcache", 5)
344+
|| hwloc__type_match(string, "memory-side cache", 8)) {
345+
type = HWLOC_OBJ_MEMCACHE;
340346
} else if (hwloc__type_match(string, "package", 2)
341347
|| hwloc__type_match(string, "socket", 2)) { /* backward compat with v1.10 */
342348
type = HWLOC_OBJ_PACKAGE;
@@ -468,6 +474,7 @@ hwloc_obj_type_snprintf(char * __hwloc_restrict string, size_t size, hwloc_obj_t
468474
case HWLOC_OBJ_MISC:
469475
case HWLOC_OBJ_MACHINE:
470476
case HWLOC_OBJ_NUMANODE:
477+
case HWLOC_OBJ_MEMCACHE:
471478
case HWLOC_OBJ_PACKAGE:
472479
case HWLOC_OBJ_CORE:
473480
case HWLOC_OBJ_PU:
@@ -570,6 +577,7 @@ hwloc_obj_attr_snprintf(char * __hwloc_restrict string, size_t size, hwloc_obj_t
570577
case HWLOC_OBJ_L1ICACHE:
571578
case HWLOC_OBJ_L2ICACHE:
572579
case HWLOC_OBJ_L3ICACHE:
580+
case HWLOC_OBJ_MEMCACHE:
573581
if (verbose) {
574582
char assoc[32];
575583
if (obj->attr->cache.associativity == -1)

include/hwloc.h

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,10 @@ typedef enum {
234234
* It is usually close to some cores (the corresponding objects
235235
* are descendants of the NUMA node object in the hwloc tree).
236236
*
237+
* This is the smallest object representing Memory resources,
238+
* it cannot have any child except Misc objects.
239+
* However it may have Memory-side cache parents.
240+
*
237241
* There is always at least one such object in the topology
238242
* even if the machine is not NUMA.
239243
*
@@ -280,6 +284,19 @@ typedef enum {
280284
* Misc objects have NULL CPU and node sets.
281285
*/
282286

287+
HWLOC_OBJ_MEMCACHE, /**< \brief Memory-side cache (filtered out by default).
288+
* A cache in front of a specific NUMA node.
289+
*
290+
* This object always has at least one NUMA node as a memory child.
291+
*
292+
* Memory objects are not listed in the main children list,
293+
* but rather in the dedicated Memory children list.
294+
*
295+
* Memory-side cache have a special depth ::HWLOC_TYPE_DEPTH_MEMCACHE
296+
* instead of a normal depth just like other objects in the
297+
* main tree.
298+
*/
299+
283300
HWLOC_OBJ_TYPE_MAX /**< \private Sentinel value */
284301
} hwloc_obj_type_t;
285302

@@ -435,9 +452,15 @@ struct hwloc_obj {
435452
* These children are listed in \p memory_first_child.
436453
*/
437454
struct hwloc_obj *memory_first_child; /**< \brief First Memory child.
438-
* NUMA nodes are listed here (\p memory_arity and \p memory_first_child)
455+
* NUMA nodes and Memory-side caches are listed here
456+
* (\p memory_arity and \p memory_first_child)
439457
* instead of in the normal children list.
440458
* See also hwloc_obj_type_is_memory().
459+
*
460+
* A memory hierarchy starts from a normal CPU-side object
461+
* (e.g. Package) and ends with NUMA nodes as leaves.
462+
* There might exist some memory-side caches between them
463+
* in the middle of the memory subtree.
441464
*/
442465
/**@}*/
443466

@@ -770,7 +793,8 @@ enum hwloc_get_type_depth_e {
770793
HWLOC_TYPE_DEPTH_BRIDGE = -4, /**< \brief Virtual depth for bridge object level. \hideinitializer */
771794
HWLOC_TYPE_DEPTH_PCI_DEVICE = -5, /**< \brief Virtual depth for PCI device object level. \hideinitializer */
772795
HWLOC_TYPE_DEPTH_OS_DEVICE = -6, /**< \brief Virtual depth for software device object level. \hideinitializer */
773-
HWLOC_TYPE_DEPTH_MISC = -7 /**< \brief Virtual depth for Misc object. \hideinitializer */
796+
HWLOC_TYPE_DEPTH_MISC = -7, /**< \brief Virtual depth for Misc object. \hideinitializer */
797+
HWLOC_TYPE_DEPTH_MEMCACHE = -8 /**< \brief Virtual depth for MemCache object. \hideinitializer */
774798
};
775799

776800
/** \brief Return the depth of parents where memory objects are attached.
@@ -2088,11 +2112,15 @@ HWLOC_DECLSPEC int hwloc_topology_get_type_filter(hwloc_topology_t topology, hwl
20882112
*/
20892113
HWLOC_DECLSPEC int hwloc_topology_set_all_types_filter(hwloc_topology_t topology, enum hwloc_type_filter_e filter);
20902114

2091-
/** \brief Set the filtering for all cache object types.
2115+
/** \brief Set the filtering for all CPU cache object types.
2116+
*
2117+
* Memory-side caches are not involved since they are not CPU caches.
20922118
*/
20932119
HWLOC_DECLSPEC int hwloc_topology_set_cache_types_filter(hwloc_topology_t topology, enum hwloc_type_filter_e filter);
20942120

2095-
/** \brief Set the filtering for all instruction cache object types.
2121+
/** \brief Set the filtering for all CPU instruction cache object types.
2122+
*
2123+
* Memory-side caches are not involved since they are not CPU caches.
20962124
*/
20972125
HWLOC_DECLSPEC int hwloc_topology_set_icache_types_filter(hwloc_topology_t topology, enum hwloc_type_filter_e filter);
20982126

include/hwloc/helper.h

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -527,30 +527,36 @@ hwloc_obj_type_is_io(hwloc_obj_type_t type);
527527
*
528528
* Memory objects are objects attached to their parents
529529
* in the Memory children list.
530-
* This current only includes NUMA nodes.
530+
* This current includes NUMA nodes and Memory-side caches.
531531
*
532532
* \return 1 if an object of type \p type is a Memory object, 0 otherwise.
533533
*/
534534
HWLOC_DECLSPEC int
535535
hwloc_obj_type_is_memory(hwloc_obj_type_t type);
536536

537-
/** \brief Check whether an object type is a Cache (Data, Unified or Instruction).
537+
/** \brief Check whether an object type is a CPU Cache (Data, Unified or Instruction).
538+
*
539+
* Memory-side caches are not CPU caches.
538540
*
539541
* \return 1 if an object of type \p type is a Cache, 0 otherwise.
540542
*/
541543
HWLOC_DECLSPEC int
542544
hwloc_obj_type_is_cache(hwloc_obj_type_t type);
543545

544-
/** \brief Check whether an object type is a Data or Unified Cache.
546+
/** \brief Check whether an object type is a CPU Data or Unified Cache.
547+
*
548+
* Memory-side caches are not CPU caches.
545549
*
546-
* \return 1 if an object of type \p type is a Data or Unified Cache, 0 otherwise.
550+
* \return 1 if an object of type \p type is a CPU Data or Unified Cache, 0 otherwise.
547551
*/
548552
HWLOC_DECLSPEC int
549553
hwloc_obj_type_is_dcache(hwloc_obj_type_t type);
550554

551-
/** \brief Check whether an object type is a Instruction Cache,
555+
/** \brief Check whether an object type is a CPU Instruction Cache,
556+
*
557+
* Memory-side caches are not CPU caches.
552558
*
553-
* \return 1 if an object of type \p type is a Instruction Cache, 0 otherwise.
559+
* \return 1 if an object of type \p type is a CPU Instruction Cache, 0 otherwise.
554560
*/
555561
HWLOC_DECLSPEC int
556562
hwloc_obj_type_is_icache(hwloc_obj_type_t type);

include/hwloc/rename.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ extern "C" {
4949

5050
#define HWLOC_OBJ_MACHINE HWLOC_NAME_CAPS(OBJ_MACHINE)
5151
#define HWLOC_OBJ_NUMANODE HWLOC_NAME_CAPS(OBJ_NUMANODE)
52+
#define HWLOC_OBJ_MEMCACHE HWLOC_NAME_CAPS(OBJ_MEMCACHE)
5253
#define HWLOC_OBJ_PACKAGE HWLOC_NAME_CAPS(OBJ_PACKAGE)
5354
#define HWLOC_OBJ_CORE HWLOC_NAME_CAPS(OBJ_CORE)
5455
#define HWLOC_OBJ_PU HWLOC_NAME_CAPS(OBJ_PU)
@@ -183,6 +184,7 @@ extern "C" {
183184
#define HWLOC_TYPE_DEPTH_OS_DEVICE HWLOC_NAME_CAPS(TYPE_DEPTH_OS_DEVICE)
184185
#define HWLOC_TYPE_DEPTH_MISC HWLOC_NAME_CAPS(TYPE_DEPTH_MISC)
185186
#define HWLOC_TYPE_DEPTH_NUMANODE HWLOC_NAME_CAPS(TYPE_DEPTH_NUMANODE)
187+
#define HWLOC_TYPE_DEPTH_MEMCACHE HWLOC_NAME_CAPS(TYPE_DEPTH_MEMCACHE)
186188

187189
#define hwloc_get_depth_type HWLOC_NAME(get_depth_type)
188190
#define hwloc_get_nbobjs_by_depth HWLOC_NAME(get_nbobjs_by_depth)

0 commit comments

Comments
 (0)