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/06/16 23:06:09 UTC

[GitHub] [tvm] areusch commented on a diff in pull request #11599: [Bugfix][Runtime] Fix sched_setaffinity in Android

areusch commented on code in PR #11599:
URL: https://github.com/apache/tvm/pull/11599#discussion_r899629648


##########
src/runtime/threading_backend.cc:
##########
@@ -164,9 +172,13 @@ class ThreadGroup::Impl {
       CPU_SET(id, &cpuset);
     }
 #if defined(__ANDROID__)
-    sched_setaffinity(thread, sizeof(cpu_set_t), &cpuset);
+    if (sched_setaffinity(tid, sizeof(cpu_set_t), &cpuset) == -1) {

Review Comment:
   per the man page we should check for != 0 here, correct?



##########
src/runtime/threading_backend.cc:
##########
@@ -164,9 +172,13 @@ class ThreadGroup::Impl {
       CPU_SET(id, &cpuset);
     }
 #if defined(__ANDROID__)
-    sched_setaffinity(thread, sizeof(cpu_set_t), &cpuset);
+    if (sched_setaffinity(tid, sizeof(cpu_set_t), &cpuset) == -1) {
+      LOG(WARNING) << "SetThreadAffinity fail!";

Review Comment:
   possible to obtain more detail from strerror() or similar?



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