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/03/02 19:23:16 UTC

[GitHub] [tvm] huajsj commented on a change in pull request #10434: [Runtime][ThreadPool] Handle the default value of affinity mode.

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



##########
File path: src/runtime/threading_backend.cc
##########
@@ -279,11 +280,7 @@ void Yield() { std::this_thread::yield(); }
 /*!
  * \bief Set the maximum number of available cores.
  */
-void SetMaxConcurrency(int value) {
-  if (value > 0) {
-    max_concurrency = value;
-  }
-}
+void SetMaxConcurrency(int value) { max_concurrency = std::max(0, value); }

Review comment:
       > If value is negative should we throw an error instead?
   
   agree, about the error report , for that existing logic just using WARNING level log, to keep logic consistence, the new logic use a LOG(WARNING) to report the error.
   
   >Also behavior is slightly different; In the old code, if value <= 0 it does not change max_concurrency. Here it sets it to 0.
   
   fixed,  when value is negative the new logic will just throw a warning then return.




-- 
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