FrozenGene commented on a change in pull request #9802:
URL: https://github.com/apache/tvm/pull/9802#discussion_r814621274
##########
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:
What I asked is how to handle Python's API pack syntax. If I write the
code as previous, your current code can not handle, because the unpacked
argument will not the type of list like C++.
##########
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:
What I asked is how to handle Python's API pack syntax. If I write the
code as previous, your current code can not handle, because the unpacked
argument will not the type of list like C++. @huajsj
--
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]