From 87323cf0f1d818a99d71fdc3739075166540c8cd Mon Sep 17 00:00:00 2001 From: z00505269 Date: Mon, 3 Aug 2020 17:07:13 +0800 Subject: [PATCH] fix thread pool bug --- mindspore/lite/src/lite_session.cc | 1 + mindspore/lite/src/runtime/thread_pool.cc | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/mindspore/lite/src/lite_session.cc b/mindspore/lite/src/lite_session.cc index 599aa9f56..62fd38000 100644 --- a/mindspore/lite/src/lite_session.cc +++ b/mindspore/lite/src/lite_session.cc @@ -167,6 +167,7 @@ std::vector LiteSession::GetInputs() { int LiteSession::RunGraph() { MS_EXCEPTION_IF_NULL(this->context_); + SetMaxWokerNum(context_->threadNum); Executor executor; return executor.Run(this->inputs, this->outputs, this->kernels, this->context_->allocator.get()); } diff --git a/mindspore/lite/src/runtime/thread_pool.cc b/mindspore/lite/src/runtime/thread_pool.cc index e9d9c8f1d..933a49664 100644 --- a/mindspore/lite/src/runtime/thread_pool.cc +++ b/mindspore/lite/src/runtime/thread_pool.cc @@ -201,7 +201,7 @@ bool LiteThreadBind::SetCPUBind(pthread_t threadId, cpu_set_t *cpuSet) { #if __ANDROID_API__ >= 21 int ret = sched_setaffinity(pthread_gettid_np(threadId), sizeof(cpu_set_t), cpuSet); 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 #else -- GitLab