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



##########
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?
   
   Also behavior is slightly different; In the old code, if value <= 0 it does 
not change `max_concurrency`.  Here it sets it to 0. 




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