Hello,
Sorry for coming late in the thread, I've been busy at conference,
traveling, teaching, moving between flats :)
Brice Goglin, le Thu 22 Sep 2011 22:25:33 +0200, a écrit :
> > (2d) more specifically: since all caches are of type HWLOC_OBJ_CACHE, we find ourselves putting in special case logic for caches all over our code. Ick.
> >
> > Note: I'm not sure how to add new HWLOC_OBJ_CACHE_Lx types and preserve backwards compatibility. :-\
>
> Long standing problem, yes. Not only about caches unfortunately. Also
> about groups, and maybe other one day.
Introducing CACHE_Lx is a way to not be generic: when an L4 gets
introducted, applications will not automatically know that it's simply a
newer cache level and simply use the cache size etc. automatically, so
I've rather keep with CACHE objects and a depth parameter.
That being said, maybe hwloc_get_obj_by_type should have a
hwloc_get_obj_by_type_and_depth sibling, so we can call
hwloc_get_obj_by_type_and_depth(topology, HWLOC_OBJ_CACHE, 3, 0);
Samuel
|