This is an automated email from the ASF dual-hosted git repository.

tqchen pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git


The following commit(s) were added to refs/heads/main by this push:
     new 6fcc64c  [FIX] Fix using num_workers in omp (#7078)
6fcc64c is described below

commit 6fcc64c49b4072fb1e90ed1f31c55ce232fb0de0
Author: CaramelFc <[email protected]>
AuthorDate: Sat Dec 26 22:21:27 2020 +0800

    [FIX] Fix using num_workers in omp (#7078)
    
    Co-authored-by: zhangfucheng <[email protected]>
---
 src/runtime/thread_pool.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/runtime/thread_pool.cc b/src/runtime/thread_pool.cc
index 9bb00ee..ba14c73 100644
--- a/src/runtime/thread_pool.cc
+++ b/src/runtime/thread_pool.cc
@@ -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;

Reply via email to