This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "".
The branch, master has been updated via a51c171ebe9e9b0aaced13bc0956bdb38c8cfc7b (commit) from 0d6c0804640151f8aa9970cc74f1fef28a11fac1 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- commit a51c171ebe9e9b0aaced13bc0956bdb38c8cfc7b Author: Maxim Uvarov maxim.uvarov@linaro.org Date: Thu Jan 19 17:34:50 2017 +0300
example: hello: ask odp for available core
Core 0 might be not available and app should ask for available core before pinning to it. https://bugs.linaro.org/show_bug.cgi?id=2806
Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org Reviewed-by: Mike Holmes mike.holmes@linaro.org
diff --git a/example/hello/odp_hello.c b/example/hello/odp_hello.c index 6d114ee..dba3495 100644 --- a/example/hello/odp_hello.c +++ b/example/hello/odp_hello.c @@ -61,6 +61,7 @@ int main(int argc, char *argv[]) pid_t pid; cpu_set_t cpu_set; int i; + odp_cpumask_t mask;
memset(&opt, 0, sizeof(opt)); opt.cpu = 0; @@ -70,6 +71,15 @@ int main(int argc, char *argv[]) return -1;
pid = getpid(); + + if (odp_init_global(&inst, NULL, NULL)) { + printf("Global init failed.\n"); + return -1; + } + + odp_cpumask_default_control(&mask, 0); + opt.cpu = odp_cpumask_first(&mask); + CPU_ZERO(&cpu_set); CPU_SET(opt.cpu, &cpu_set);
@@ -78,11 +88,6 @@ int main(int argc, char *argv[]) return -1; }
- if (odp_init_global(&inst, NULL, NULL)) { - printf("Global init failed.\n"); - return -1; - } - if (odp_init_local(inst, ODP_THREAD_CONTROL)) { printf("Local init failed.\n"); return -1;
-----------------------------------------------------------------------
Summary of changes: example/hello/odp_hello.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
hooks/post-receive