inthwloc_cpukinds_get_by_cpuset(hwloc_topology_ttopology,hwloc_const_bitmap_tcpuset,unsignedlongflags)
Get the index of the CPU kind that contains CPUs listed in cpuset. flags must be 0 for now.
Returns
The index of the CPU kind (positive integer or 0) on success.
-1 with errno set to EXDEV if cpuset is only partially included in the some kind.
-1 with errno set to ENOENT if cpuset is not included in any kind, even partially.
-1 with errno set to EINVAL if parameters are invalid.
inthwloc_cpukinds_get_info(hwloc_topology_ttopology,unsignedkind_index,hwloc_bitmap_tcpuset,int*efficiency,unsigned*nr_infos,structhwloc_info_s**infos,unsignedlongflags)
Get the CPU set and infos about a CPU kind in the topology. kind_index identifies one kind of CPU between
0 and the number of kinds returned by hwloc_cpukinds_get_nr() minus 1.
If not NULL, the bitmap cpuset will be filled with the set of PUs of this kind.
The integer pointed by efficiency, if not NULL will, be filled with the ranking of this kind of CPU in
term of efficiency (see above). It ranges from 0 to the number of kinds (as reported by
hwloc_cpukinds_get_nr()) minus 1.
Kinds with lower efficiency are reported first.
If there is a single kind in the topology, its efficiency 0. If the efficiency of some kinds of cores is
unknown, the efficiency of all kinds is set to -1, and kinds are reported in no specific order.
The array of info attributes (for instance the 'CoreType', 'FrequencyMaxMHz' or 'FrequencyBaseMHz', see
CPUKinds) and its length are returned in infos or nr_infos. The array belongs to the topology, it should
not be freed or modified.
If nr_infos or infos is NULL, no info is returned.
flags must be 0 for now.
Returns
0 on success.
-1 with errno set to ENOENT if kind_index does not match any CPU kind.
-1 with errno set to EINVAL if parameters are invalid.
inthwloc_cpukinds_get_nr(hwloc_topology_ttopology,unsignedlongflags)
Get the number of different kinds of CPU cores in the topology. flags must be 0 for now.
Returns
The number of CPU kinds (positive integer) on success.
0 if no information about kinds was found.
-1 with errno set to EINVAL if flags is invalid.
inthwloc_cpukinds_register(hwloc_topology_ttopology,hwloc_bitmap_tcpuset,intforced_efficiency,unsignednr_infos,structhwloc_info_s*infos,unsignedlongflags)
Register a kind of CPU in the topology. Mark the PUs listed in cpuset as being of the same kind with
respect to the given attributes.
forced_efficiency should be -1 if unknown. Otherwise it is an abstracted efficiency value to enforce the
ranking of all kinds if all of them have valid (and different) efficiencies.
The array infos of size nr_infos may be used to provide info names and values describing this kind of
PUs.
flags must be 0 for now.
Parameters cpuset and infos will be duplicated internally, the caller is responsible for freeing them.
If cpuset overlaps with some existing kinds, those might get modified or split. For instance if existing
kind A contains PUs 0 and 1, and one registers another kind for PU 1 and 2, there will be 3 resulting
kinds: existing kind A is restricted to only PU 0; new kind B contains only PU 1 and combines information
from A and from the newly-registered kind; new kind C contains only PU 2 and only gets information from
the newly-registered kind.
Note
The efficiency forced_efficiency provided to this function may be different from the one reported
later by hwloc_cpukinds_get_info() because hwloc will scale efficiency values down to between 0 and
the number of kinds minus 1.
Returns
0 on success.
-1 with errno set to EINVAL if some parameters are invalid, for instance if cpuset is NULL or empty.