Browse Source

!3881 fix thread pool bug

Merge pull request !3881 from 张学同/to_merge
tags/v0.7.0-beta
mindspore-ci-bot Gitee 5 years ago
parent
commit
61639d9020
2 changed files with 2 additions and 1 deletions
  1. +1
    -0
      mindspore/lite/src/lite_session.cc
  2. +1
    -1
      mindspore/lite/src/runtime/thread_pool.cc

+ 1
- 0
mindspore/lite/src/lite_session.cc View File

@@ -167,6 +167,7 @@ std::vector<mindspore::tensor::MSTensor *> LiteSession::GetInputs() {


int LiteSession::RunGraph() { int LiteSession::RunGraph() {
MS_EXCEPTION_IF_NULL(this->context_); MS_EXCEPTION_IF_NULL(this->context_);
SetMaxWokerNum(context_->threadNum);
Executor executor; Executor executor;
return executor.Run(this->inputs, this->outputs, this->kernels, this->context_->allocator.get()); return executor.Run(this->inputs, this->outputs, this->kernels, this->context_->allocator.get());
} }


+ 1
- 1
mindspore/lite/src/runtime/thread_pool.cc View File

@@ -201,7 +201,7 @@ bool LiteThreadBind::SetCPUBind(pthread_t threadId, cpu_set_t *cpuSet) {
#if __ANDROID_API__ >= 21 #if __ANDROID_API__ >= 21
int ret = sched_setaffinity(pthread_gettid_np(threadId), sizeof(cpu_set_t), cpuSet); int ret = sched_setaffinity(pthread_gettid_np(threadId), sizeof(cpu_set_t), cpuSet);
if (ret != 0) { if (ret != 0) {
MS_LOG(ERROR) << "bind thread %ld to cpu failed.ERROR %d", threadId, ret;
MS_LOG(ERROR) << "bind thread " << threadId << "to cpu failed.ERROR " << ret;
} }
#endif #endif
#else #else


Loading…
Cancel
Save