Skip to content

Commit

Permalink
[FIX] Fix using num_workers in omp (#7078)
Browse files Browse the repository at this point in the history
Co-authored-by: zhangfucheng <zhangfucheng.jason@bytedance.com>
  • Loading branch information
CaramelFc and zhangfucheng authored Dec 26, 2020
1 parent 959669c commit 6fcc64c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/runtime/thread_pool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -369,8 +369,8 @@ int TVMBackendParallelLaunch(FTVMParallelLambda flambda, void* cdata, int num_ta
#else
int num_workers = tvm::runtime::threading::MaxConcurrency();
if (num_task == 0) num_task = num_workers;
omp_set_num_threads(num_workers);
#pragma omp parallel num_threads(num_workers)
omp_set_num_threads(num_task);
#pragma omp parallel num_threads(num_task)
{
TVMParallelGroupEnv env;
env.num_task = num_task;
Expand Down

0 comments on commit 6fcc64c

Please sign in to comment.