huajsj commented on a change in pull request #9802:
URL: https://github.com/apache/tvm/pull/9802#discussion_r812669599



##########
File path: src/runtime/thread_pool.cc
##########
@@ -373,13 +375,28 @@ 
TVM_REGISTER_GLOBAL("runtime.config_threadpool").set_body([](TVMArgs args, TVMRe
   threading::ThreadGroup::AffinityMode mode =
       
static_cast<threading::ThreadGroup::AffinityMode>(static_cast<int>(args[0]));
   int nthreads = args[1];
-  ThreadPool::ThreadLocal()->UpdateWorkerConfiguration(mode, nthreads);
+  std::vector<unsigned int> cpus;
+  int max_concurrency = 0;
+  if (args.num_args == 3) {
+    Array<String> cpu_array = args[2];
+    for (auto cpu : cpu_array) {
+      cpus.push_back(std::stoi(cpu));

Review comment:
       thanks @FrozenGene for the follow up, if the core ids is greater than 
threads number, all the threads will be set the affinity with all of the cpu in 
cpu list, at the said case, thread 0 will affinity with cpu (0, 1, 2) , the 
related logic in threading_backend.cc::120 - 129 line.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to