Commit e8e84fa0 by Yida Wang Committed by Tianqi Chen

make ThreadPool thread local (#1152)

* make ThreadPool thread local

* add return
parent d454f570
......@@ -291,9 +291,8 @@ class ThreadPool {
return res;
}
static ThreadPool* Global() {
static ThreadPool inst;
return &inst;
static ThreadPool* ThreadLocal() {
return dmlc::ThreadLocalStore<ThreadPool>::Get();
}
private:
......@@ -331,7 +330,7 @@ int TVMBackendParallelLaunch(
FTVMParallelLambda flambda,
void* cdata,
int num_task) {
int res = tvm::runtime::ThreadPool::Global()->Launch(
int res = tvm::runtime::ThreadPool::ThreadLocal()->Launch(
flambda, cdata, num_task, 1);
return res;
}
......
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