huajsj commented on a change in pull request #9802:
URL: https://github.com/apache/tvm/pull/9802#discussion_r808755585
##########
File path: src/runtime/threading_backend.cc
##########
@@ -37,11 +35,14 @@
#if defined(__hexagon__)
#include <dlfcn.h>
#endif
+#include <algorithm>
+#include <thread>
+#define CURRENT_THREAD_HANDLE (static_cast<std::thread::native_handle_type>(0))
namespace tvm {
namespace runtime {
namespace threading {
-
+thread_local int max_concurrency_value = 0;
Review comment:
fixed.
##########
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));
+ }
+ }
+ if (args.num_args == 4) {
+ max_concurrency = args[3];
+ }
Review comment:
fixed.
##########
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:
fixed.
--
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]