From 6b6df68ac65ae540eeca79b3701f02bbd566fdbe Mon Sep 17 00:00:00 2001 From: lidanqing-intel Date: Tue, 29 Sep 2020 04:37:30 +0200 Subject: [PATCH] change assert to WARNING --- deploy/cpp_infer/src/main.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/deploy/cpp_infer/src/main.cpp b/deploy/cpp_infer/src/main.cpp index 3f3cae9a..4b84dbd0 100644 --- a/deploy/cpp_infer/src/main.cpp +++ b/deploy/cpp_infer/src/main.cpp @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "glog/logging.h" #include "omp.h" #include "opencv2/core.hpp" #include "opencv2/imgcodecs.hpp" @@ -71,7 +72,13 @@ int main(int argc, char **argv) { #ifdef USE_MKL #pragma omp parallel for (auto i = 0; i < 10; i++) { - assert(config.cpu_math_library_num_threads == omp_get_num_threads()); + LOG_IF(WARNING, + config.cpu_math_library_num_threads != omp_get_num_threads()) + << "WARNING! MKL is running on " << omp_get_num_threads() + << " threads while cpu_math_library_num_threads is set to " + << config.cpu_math_library_num_threads + << ". Possible reason could be 1. You have set omp_set_num_threads() " + "somewhere; 2. MKL is not linked properly"; } #endif -- GitLab