hwlocality_levelzero(3)
π hwlocality_levelzero
okay so bestie, this is a page from the hwloc manual β the hwlocality_levelzero(3) one β and it's literally all about interoperability with the oneAPI Level Zero interface. that's the whole vibe. let's get into it π«Ά
β¨ SYNOPSIS β¨
πΈ Functions
here's the whole squad of function signatures, copy-pasted with love (and exactness, because duh):
int hwloc_levelzero_get_device_cpuset (hwloc_topology_t topology,
ze_device_handle_t device, hwloc_cpuset_t set)
int hwloc_levelzero_get_sysman_device_cpuset (hwloc_topology_t topology,
zes_device_handle_t device, hwloc_cpuset_t set)
hwloc_obj_t hwloc_levelzero_get_device_osdev (hwloc_topology_t topology,
ze_device_handle_t device)
hwloc_obj_t hwloc_levelzero_get_sysman_device_osdev (hwloc_topology_t
topology, zes_device_handle_t device)
π¦ Detailed Description
so what's the whole point? this interface gives you ways to retrieve topology info about devices managed by the Level Zero API β and that's both for the main Core devices (the ZE API) and the Sysman devices (the ZES API). two flavors, one page. icon energy β¨
π Function Documentation
π int hwloc_levelzero_get_device_cpuset (hwloc_topology_t topology, ze_device_handle_t device, hwloc_cpuset_t set) [inline]
bestie this one gets you the CPU set of the logical processors that are physically close to the Level Zero device device. it stores in set the CPU-set describing the locality of the Level Zero device device. slay.
some ground rules though, no cap:
- Topology
topologyand devicedevicemust match the local machine. - The Level Zero library must have been initialized with
zeInit(). - I/O devices detection and the Level Zero component are not needed in the topology.
this function only returns the locality of the device, that's it. if you need more info about the device, use OS objects instead β see hwloc_levelzero_get_device_osdev().
also heads up: this function is currently only implemented in a meaningful way for Linux π§; other systems will simply get the cpuset of the entire topology. not me getting the whole machine's cpuset π.
Returns
0on success β¨-1on error, for instance if device information could not be found π
Note β zeDevicePciGetPropertiesExt() must be supported, or the entire machine locality will be returned. so like... support it, or get the whole machine. your call babe π
π hwloc_obj_t hwloc_levelzero_get_device_osdev (hwloc_topology_t topology, ze_device_handle_t device) [inline]
this one snags you the hwloc OS device object that corresponds to Level Zero device device. matching game, but make it topology.
Returns
- The hwloc OS device object that describes the given Level Zero device
deviceπ«Ά NULLif none could be found π
the fine print, because there always is some:
- Topology
topologyand devicedv_indmust match the local machine. - The Level Zero library must have been initialized with
zeInit(). - I/O devices detection and the Level Zero component must be enabled in the topology. if not, the locality of the object may still be found using
hwloc_levelzero_get_device_cpuset().
Note β if the input ZE device is actually a subdevice, then its parent (root device) is actually translated, i.e. the main hwloc OS device is returned instead of one of its children. plot twist π
Note β the corresponding hwloc PCI device may be found by looking at the result parent pointer (unless PCI devices are filtered out).
Note β zeDevicePciGetPropertiesExt() must be supported. periodt.
π int hwloc_levelzero_get_sysman_device_cpuset (hwloc_topology_t topology, zes_device_handle_t device, hwloc_cpuset_t set) [inline]
same as before but make it Sysman π
β this gets the CPU set of logical processors physically close to the Level Zero Sysman device device. stores in set the CPU-set describing the locality of the Level Zero device device.
the rules for this one:
- Topology
topologyand devicedevicemust match the local machine. - The Level Zero library must have been initialized with Sysman enabled with
zesInit(). (note thezes, notzeβ iykyk) - I/O devices detection and the Level Zero component are not needed in the topology.
again, this function only returns the locality of the device. if you need more info about the device, use OS objects instead β see hwloc_levelzero_get_device_osdev().
and same disclaimer as its sibling: currently only implemented in a meaningful way for Linux; other systems will simply get the cpuset of the entire topology.
Returns
0on success β¨-1on error, for instance if device information could not be found π
π hwloc_obj_t hwloc_levelzero_get_sysman_device_osdev (hwloc_topology_t topology, zes_device_handle_t device) [inline]
the Sysman twin π§ β gets the hwloc OS device object corresponding to Level Zero Sysman device device.
Returns
- The hwloc OS device object that describes the given Level Zero device
deviceπ«Ά NULLif none could be found π
the prerequisites, don't skip them:
- Topology
topologyand devicedv_indmust match the local machine. - The Level Zero library must have been initialized with Sysman enabled with
zesInit(). - I/O devices detection and the Level Zero component must be enabled in the topology. if not, the locality of the object may still be found using
hwloc_levelzero_get_device_cpuset().
Note β if the input ZES device is actually a subdevice, then its parent (root device) is actually translated, i.e. the main hwloc OS device is returned instead of one of its children. yep, same subdevice shenanigans π
Note β the corresponding hwloc PCI device may be found by looking at the result parent pointer (unless PCI devices are filtered out).
Note β zeDevicePciGetPropertiesExt() must be supported.
πΈ Author
Generated automatically by Doxygen for Hardware Locality (hwloc) from the source code. not a human, just vibes and a doc generator π€β¨
okay that's the whole page bestie, you ate that π go forth and query your devices π
Hardware Locality (hwloc) β Version 2.15.0 β hwlocality_levelzero(3) π that's the version and the date right there at the end, mwah π
π¦ where this page comes from
- arch rolling: hwloc 2.15.0-1 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms