You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2022/02/17 06:44:25 UTC

[GitHub] [tvm] huajsj commented on a change in pull request #9802: [Runtime][ThreadPool]Refactor affinity function and support CPU affinity list setting.

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



##########
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:
       'max_concurrency_value' is cooperating with the 'ParallelLauncher' which is running the worker thread is a thread_local variable,  so we need to make max_concurrency_value to be a thread_local variable too, then when different thread run 'ParallelLauncher', the different 'ParallelLauncher' can get different value of 'max_concurrency_value'




-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org