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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to