From 4073ecd01b754babe5415ab0028b47ea80ecab29 Mon Sep 17 00:00:00 2001 From: zhangjun Date: Fri, 28 May 2021 04:03:37 +0000 Subject: [PATCH] update --- paddle_inference/paddle/include/paddle_engine.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/paddle_inference/paddle/include/paddle_engine.h b/paddle_inference/paddle/include/paddle_engine.h index ea6530e0..262a0378 100755 --- a/paddle_inference/paddle/include/paddle_engine.h +++ b/paddle_inference/paddle/include/paddle_engine.h @@ -194,6 +194,12 @@ class PaddleInferenceEngine : public EngineCore { (engine_conf.has_use_lite() && !engine_conf.use_lite() && engine_conf.has_use_gpu() && !engine_conf.use_gpu())) { #ifdef WITH_MKLML +#ifdef WITH_MKLDNN + config.EnableMKLDNN(); + config.SwitchIrOptim(true); + config.DisableGpu(); + // config.SetCpuMathLibraryNumThreads(2); + if (precision_type == PrecisionType::kInt8) { config.EnableMkldnnQuantizer(); auto quantizer_config = config.mkldnn_quantizer_config(); @@ -203,12 +209,8 @@ class PaddleInferenceEngine : public EngineCore { // quantizer_config -> SetEnabledOpTypes(4); } else if (precision_type == PrecisionType::kHalf) { config.EnableMkldnnBfloat16(); - } else { -#ifdef WITH_MKLDNN - config.EnableMKLDNN(); - config.SwitchIrOptim(true); -#endif } +#endif #endif } -- GitLab