> -----Original Message----- > From: ext [email protected] > [mailto:[email protected]] > Sent: Tuesday, August 11, 2015 10:34 AM > To: [email protected] > Cc: [email protected]; [email protected]; Savolainen, Petri > (Nokia - FI/Espoo); [email protected]; Hongbo Zhang > Subject: [API-NEXT PATCH v4 09/10] linux-generic: cpumask: add API > odp_cpumask_available() > > From: Hongbo Zhang <[email protected]> > > In some cases, odp_cpu_count() isn't enough to show all the available > CPUs, so a new API odp_cpumask_available() is introduced, which returns > all the worker and control CPUs. > > Signed-off-by: Hongbo Zhang <[email protected]> > --- > include/odp/api/cpumask.h | 10 ++++++++++ > platform/linux-generic/odp_cpumask.c | 11 +++++++++++ > 2 files changed, 21 insertions(+) > > diff --git a/include/odp/api/cpumask.h b/include/odp/api/cpumask.h > index 2ad7fea..eef6404 100644 > --- a/include/odp/api/cpumask.h > +++ b/include/odp/api/cpumask.h > @@ -218,6 +218,16 @@ int odp_cpumask_def_worker(odp_cpumask_t *mask, > int num); > int odp_cpumask_def_control(odp_cpumask_t *mask, int num); > > /** > + * Report all the available CPUs > + * > + * All the available CPUs include both worker CPUs and control CPUs > + * > + * @param[out] mask CPU mask to hold all available CPUs > + * @return cpu number of all available CPUs > + */ > +int odp_cpumask_available(odp_cpumask_t *mask); > + > +/** > * @} > */
This could be even more explicit int odp_cpumask_all_available(odp_cpumask_t *mask); Also in theory, there can be more CPUs available for ODP than the default (recommended) CPU masks return. E.g. dual threading could functionally work (every CPU in the mask), but ODP implementation recommends to run only one worker thread per physical CPU (every second CPU in the mask). "All available CPUs include both default worker and control CPUs, and potentially additional CPUs" -Petri _______________________________________________ lng-odp mailing list [email protected] https://lists.linaro.org/mailman/listinfo/lng-odp
