From f78e8fd8e4dbae99708cba2933fa6e8d578c32d9 Mon Sep 17 00:00:00 2001 From: nihuini Date: Thu, 16 Aug 2018 17:26:53 +0800 Subject: [PATCH] use max threads as cpu count on openmp capable runtime --- src/cpu.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/cpu.cpp b/src/cpu.cpp index a6485cb9f..5b3a051d2 100644 --- a/src/cpu.cpp +++ b/src/cpu.cpp @@ -228,8 +228,12 @@ static int get_cpucount() count = 1; return count; +#else +#ifdef _OPENMP + return omp_get_max_threads(); #else return 1; +#endif // _OPENMP #endif }