Skip to content

Commit e1980bd

Browse files
committed
XML: update for memory-side caches
Signed-off-by: Brice Goglin <[email protected]>
1 parent 44f0a4d commit e1980bd

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

hwloc/topology-xml.c

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ hwloc__xml_import_object_attr(struct hwloc_topology *topology,
158158

159159
else if (!strcmp(name, "cache_size")) {
160160
unsigned long long lvalue = strtoull(value, NULL, 10);
161-
if (hwloc__obj_type_is_cache(obj->type) || obj->type == _HWLOC_OBJ_CACHE_OLD)
161+
if (hwloc__obj_type_is_cache(obj->type) || obj->type == _HWLOC_OBJ_CACHE_OLD || obj->type == HWLOC_OBJ_MEMCACHE)
162162
obj->attr->cache.size = lvalue;
163163
else if (hwloc__xml_verbose())
164164
fprintf(stderr, "%s: ignoring cache_size attribute for non-cache object type\n",
@@ -167,7 +167,7 @@ hwloc__xml_import_object_attr(struct hwloc_topology *topology,
167167

168168
else if (!strcmp(name, "cache_linesize")) {
169169
unsigned long lvalue = strtoul(value, NULL, 10);
170-
if (hwloc__obj_type_is_cache(obj->type) || obj->type == _HWLOC_OBJ_CACHE_OLD)
170+
if (hwloc__obj_type_is_cache(obj->type) || obj->type == _HWLOC_OBJ_CACHE_OLD || obj->type == HWLOC_OBJ_MEMCACHE)
171171
obj->attr->cache.linesize = lvalue;
172172
else if (hwloc__xml_verbose())
173173
fprintf(stderr, "%s: ignoring cache_linesize attribute for non-cache object type\n",
@@ -176,7 +176,7 @@ hwloc__xml_import_object_attr(struct hwloc_topology *topology,
176176

177177
else if (!strcmp(name, "cache_associativity")) {
178178
int lvalue = atoi(value);
179-
if (hwloc__obj_type_is_cache(obj->type) || obj->type == _HWLOC_OBJ_CACHE_OLD)
179+
if (hwloc__obj_type_is_cache(obj->type) || obj->type == _HWLOC_OBJ_CACHE_OLD || obj->type == HWLOC_OBJ_MEMCACHE)
180180
obj->attr->cache.associativity = lvalue;
181181
else if (hwloc__xml_verbose())
182182
fprintf(stderr, "%s: ignoring cache_associativity attribute for non-cache object type\n",
@@ -185,7 +185,7 @@ hwloc__xml_import_object_attr(struct hwloc_topology *topology,
185185

186186
else if (!strcmp(name, "cache_type")) {
187187
unsigned long lvalue = strtoul(value, NULL, 10);
188-
if (hwloc__obj_type_is_cache(obj->type) || obj->type == _HWLOC_OBJ_CACHE_OLD) {
188+
if (hwloc__obj_type_is_cache(obj->type) || obj->type == _HWLOC_OBJ_CACHE_OLD || obj->type == HWLOC_OBJ_MEMCACHE) {
189189
if (lvalue == HWLOC_OBJ_CACHE_UNIFIED
190190
|| lvalue == HWLOC_OBJ_CACHE_DATA
191191
|| lvalue == HWLOC_OBJ_CACHE_INSTRUCTION)
@@ -211,7 +211,7 @@ hwloc__xml_import_object_attr(struct hwloc_topology *topology,
211211

212212
else if (!strcmp(name, "depth")) {
213213
unsigned long lvalue = strtoul(value, NULL, 10);
214-
if (hwloc__obj_type_is_cache(obj->type) || obj->type == _HWLOC_OBJ_CACHE_OLD) {
214+
if (hwloc__obj_type_is_cache(obj->type) || obj->type == _HWLOC_OBJ_CACHE_OLD || obj->type == HWLOC_OBJ_MEMCACHE) {
215215
obj->attr->cache.depth = lvalue;
216216
} else if (obj->type == HWLOC_OBJ_GROUP || obj->type == HWLOC_OBJ_BRIDGE) {
217217
/* will be overwritten by the core */
@@ -796,13 +796,6 @@ hwloc__xml_import_object(hwloc_topology_t topology,
796796
state->global->msgprefix);
797797
goto error_with_object;
798798
}
799-
} else if (!strcasecmp(attrvalue, "MemCache")) {
800-
/* ignore likely-future types */
801-
obj->type = _HWLOC_OBJ_FUTURE;
802-
ignored = 1;
803-
if (hwloc__xml_verbose())
804-
fprintf(stderr, "%s: %s object not-supported, will be ignored\n",
805-
state->global->msgprefix, attrvalue);
806799
} else {
807800
if (hwloc__xml_verbose())
808801
fprintf(stderr, "%s: unrecognized object type string %s\n",
@@ -2034,6 +2027,7 @@ hwloc__xml_export_object_contents (hwloc__xml_export_state_t state, hwloc_topolo
20342027
case HWLOC_OBJ_L1ICACHE:
20352028
case HWLOC_OBJ_L2ICACHE:
20362029
case HWLOC_OBJ_L3ICACHE:
2030+
case HWLOC_OBJ_MEMCACHE:
20372031
sprintf(tmp, "%llu", (unsigned long long) obj->attr->cache.size);
20382032
state->new_prop(state, "cache_size", tmp);
20392033
sprintf(tmp, "%u", obj->attr->cache.depth);

0 commit comments

Comments
 (0)