Commit 3d64cf92 by eqy Committed by Tianqi Chen

fix Android build w/ threading_backend (#1059)

parent 5a96c9df
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
#include "../src/runtime/rpc/rpc_module.cc" #include "../src/runtime/rpc/rpc_module.cc"
#include "../src/runtime/rpc/rpc_socket_impl.cc" #include "../src/runtime/rpc/rpc_socket_impl.cc"
#include "../src/runtime/thread_pool.cc" #include "../src/runtime/thread_pool.cc"
#include "../src/runtime/threading_backend.cc"
#include "../src/runtime/graph/graph_runtime.cc" #include "../src/runtime/graph/graph_runtime.cc"
#ifdef TVM_OPENCL_RUNTIME #ifdef TVM_OPENCL_RUNTIME
......
...@@ -81,8 +81,13 @@ class ThreadGroup::Impl { ...@@ -81,8 +81,13 @@ class ThreadGroup::Impl {
cpu_set_t cpuset; cpu_set_t cpuset;
CPU_ZERO(&cpuset); CPU_ZERO(&cpuset);
CPU_SET(0, &cpuset); CPU_SET(0, &cpuset);
#if defined(__ANDROID__)
sched_setaffinity(pthread_self(),
sizeof(cpu_set_t), &cpuset);
#else
pthread_setaffinity_np(pthread_self(), pthread_setaffinity_np(pthread_self(),
sizeof(cpu_set_t), &cpuset); sizeof(cpu_set_t), &cpuset);
#endif
} }
#endif #endif
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment