Hi, As I mentioned in BKK, I think we should not hurry to add a simple socket ID API.
CPU/cache/accelerator topology inside SoCs may include already multiple hierarchy levels. CPUs may be clustered and each cluster may have its own set of accelerators. Instead, we should choose terminology for expressing SoC and socket hierarchies. With virtualization all these IDs (CPUs, sockets, etc) are guest local, which may not anymore represent the real world hierarchy (that's OK but we should be specific about that). For example, a quick test with KVM resulted a default setup that did place each CPU into its own "socket". Four consecutive CPUs on the same physical socket did show up as four different sockets - single CPU on each socket (without any L3 cache !). -Petri > -----Original Message----- > From: lng-odp [mailto:lng-odp-boun...@lists.linaro.org] On Behalf Of EXT > Bill Fischofer > Sent: Thursday, March 24, 2016 12:19 AM > To: lng-odp@lists.linaro.org > Subject: [lng-odp] [API-NEXT PATCHv2 2/4] api: cpu: add routines for > obtaining socket ids > > Add odp_cpu_socket_id() and odp_cpu_socket_id_cpu() routines > > Signed-off-by: Bill Fischofer <bill.fischo...@linaro.org> > --- > include/odp/api/spec/cpu.h | 25 +++++++++++++++++++++++++ > 1 file changed, 25 insertions(+) > > diff --git a/include/odp/api/spec/cpu.h b/include/odp/api/spec/cpu.h > index f0e20c4..d383c3b 100644 > --- a/include/odp/api/spec/cpu.h > +++ b/include/odp/api/spec/cpu.h > @@ -36,6 +36,31 @@ extern "C" { > int odp_cpu_id(void); > > /** > + * CPU socket id > + * > + * Returns the socket id associated with the calling CPU on NUMA systems. > + * Socket ID numbering is system specific. > + * > + * @return Socket ID of the calling CPU > + * @retval ODP_SOCKET_ID_ANY If the caller is not running on a NUMA > system. > + */ > +uint32_t odp_cpu_socket_id(void); > + > +/** > + * CPU socket id of designated CPU > + * > + * Returns the socket id associated with a specific CPU on NUMA systems. > + * Socket ID numbering is system specific. > + * > + * @param cpu_id ID of the CPU for which socket ID information is > requested. > + * > + * @return Socket ID of the designated CPU > + * @retval ODP_SOCKET_ID_ANY If the specified CPU is unknown or caller is > + * not running on a NUMA system. > + */ > +uint32_t odp_cpu_socket_id_cpu(int cpu_id); > + > +/** > * CPU count > * > * Report the number of CPU's available to this ODP program. > -- > 2.5.0 > > _______________________________________________ > lng-odp mailing list > lng-odp@lists.linaro.org > https://lists.linaro.org/mailman/listinfo/lng-odp _______________________________________________ lng-odp mailing list lng-odp@lists.linaro.org https://lists.linaro.org/mailman/listinfo/lng-odp