CPU IDs are system dependent. So e.g. odp_cpu_count() == 2 would not necessarily result a cpumask with cpus 0 and 1 set, but e.g. cpus 7 and 17 set. Typically, the mask comes from user/system level (user has decided to run the ODP app on cpus 7 and 17).
We may need two new functions: /** * @return the max CPU available to the ODP program */ int odp_cpu_max(void) , but still that would not tell which ids between 0 and max are valid, so we need also /** * Output mask of CPUs available to the ODP program */ void odp_cpu_mask(odp_cpumask_t *mask) -Petri From: lng-odp-boun...@lists.linaro.org [mailto:lng-odp-boun...@lists.linaro.org] On Behalf Of ext Christophe Milard Sent: Tuesday, March 10, 2015 4:22 PM To: lng-odp@lists.linaro.org Subject: [lng-odp] odp_cpu_count() vs odp_cpumask size Hi, I am writing validation tests for the odp_cpumask functions. The question is: How many CPUs should the cpu mask be tested for?. Of course, the answer is implementation dependent, but if we want the tests to be non platform dependent, the tests should know the max number of CPU the mask could contain. In the API the function odp_cpu_count(void) is defined. This function "reports the number of CPUs available to this ODP program". Is this also the maximum number of CPU in the mask, or should the mask also have room for non "odp reserved cpus"? For instance, in a system running 2 linux (control) cpus, and 5 ODP cpus, should the mask be tested for 5 or 7 CPUs? If 7 is the answer, how do I get this number from the current API... /Christophe.
_______________________________________________ lng-odp mailing list lng-odp@lists.linaro.org http://lists.linaro.org/mailman/listinfo/lng-odp