Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android编译openMP未开启多核是什么原因。 #528

Closed
Justin-bin opened this issue Aug 13, 2018 · 1 comment
Closed

Android编译openMP未开启多核是什么原因。 #528

Justin-bin opened this issue Aug 13, 2018 · 1 comment

Comments

@Justin-bin
Copy link

开启OMP
ncnn::set_omp_dynamic(1);
ncnn::Option opt;
opt.lightmode = true;
opt.num_threads = 4;

    ncnn::set_default_option(opt);

    ncnn::set_omp_num_threads( 4 );

打印结果:
LOGE("ncnn cpu num = %d",ncnn::get_cpu_count());
LOGE("ncnn cpu num omp = %d",ncnn::get_omp_num_threads());
ncnn cpu num = 8;
ncnn cpu num omp =1 ;

想问一下为什么 num omp 为1 。

@nihui
Copy link
Member

nihui commented Aug 20, 2018

you can query the current num_threads setting via ncnn::get_default_option().num_threads

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants