From 23e0d11c473c1af95d9d5a2b117d84a166e77b19 Mon Sep 17 00:00:00 2001 From: lichao18 Date: Wed, 26 Dec 2018 10:58:04 +0800 Subject: [PATCH] Fix the omp_num_threads bug --- mace/core/runtime/cpu/cpu_runtime.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mace/core/runtime/cpu/cpu_runtime.cc b/mace/core/runtime/cpu/cpu_runtime.cc index f9baac6e..89c57206 100644 --- a/mace/core/runtime/cpu/cpu_runtime.cc +++ b/mace/core/runtime/cpu/cpu_runtime.cc @@ -223,7 +223,7 @@ MaceStatus CPURuntime::SetOpenMPThreadsAndAffinityPolicy( } ++cores_to_use; } - num_threads_hint = cores_to_use; + num_threads_hint = std::min(num_threads_hint, cores_to_use); } else { cores_to_use = num_threads_hint; } -- GitLab