On 29/01/16 02:44, Bill Fischofer wrote:
Add odp_cpu_socket_id() and odp_cpu_socket_id_cpu() routines Signed-off-by: Bill Fischofer <bill.fischo...@linaro.org> --- include/odp/api/cpu.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/include/odp/api/cpu.h b/include/odp/api/cpu.h index 4cbaf58..fe74825 100644 --- a/include/odp/api/cpu.h +++ b/include/odp/api/cpu.h @@ -36,6 +36,29 @@ 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 specified CPU on NUMA systems. + * Socket ID numbering is system specific. + * + * @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.
Maybe worth to differentiate between the two scenario with different return value? To query for an invalid CPU sounds like a serious problem in the application while the other is part of normal operation.
+ */ +uint32_t odp_cpu_socket_id_cpu(int cpu_id); + +/** * CPU count * * Report the number of CPU's available to this ODP program.
_______________________________________________ lng-odp mailing list lng-odp@lists.linaro.org https://lists.linaro.org/mailman/listinfo/lng-odp