From 10a1c2bb86d602f27490079adda1ab594fdeeed9 Mon Sep 17 00:00:00 2001 From: tensor-tang Date: Fri, 27 Jul 2018 10:16:14 +0800 Subject: [PATCH] control omp num_threads --- paddle/fluid/platform/cpu_helper.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/paddle/fluid/platform/cpu_helper.cc b/paddle/fluid/platform/cpu_helper.cc index 77ecb170111..234a04b5c2e 100644 --- a/paddle/fluid/platform/cpu_helper.cc +++ b/paddle/fluid/platform/cpu_helper.cc @@ -16,6 +16,7 @@ limitations under the License. */ #include "paddle/fluid/platform/enforce.h" #ifdef PADDLE_WITH_MKLML +#include #include "paddle/fluid/platform/dynload/mklml.h" #endif @@ -33,6 +34,7 @@ void SetNumThreads(int num_threads) { #elif defined(PADDLE_WITH_MKLML) int real_num_threads = num_threads > 1 ? num_threads : 1; platform::dynload::MKL_Set_Num_Threads(real_num_threads); + omp_set_num_threads(num_threads); #else PADDLE_ENFORCE(false, "To be implemented."); #endif -- GitLab