diff --git a/paddle_inference/paddle/include/paddle_engine.h b/paddle_inference/paddle/include/paddle_engine.h index 58144e7da769cb144def73c396aa1f0c04543fb2..ea6530e01c8a07604539bebc77b83e0dabe4a872 100755 --- a/paddle_inference/paddle/include/paddle_engine.h +++ b/paddle_inference/paddle/include/paddle_engine.h @@ -166,6 +166,13 @@ class PaddleInferenceEngine : public EngineCore { } precision_type = GetPrecision(FLAGS_precision); + if (engine_conf.has_enable_ir_optimization() && + !engine_conf.enable_ir_optimization()) { + config.SwitchIrOptim(false); + } else { + config.SwitchIrOptim(true); + } + if (engine_conf.has_use_trt() && engine_conf.use_trt()) { if (!engine_conf.has_use_gpu() || !engine_conf.use_gpu()) { config.EnableUseGpu(2000, FLAGS_gpuid); @@ -209,12 +216,6 @@ class PaddleInferenceEngine : public EngineCore { // 2 MB l3 cache config.EnableXpu(2 * 1024 * 1024); } - if (engine_conf.has_enable_ir_optimization() && - !engine_conf.enable_ir_optimization()) { - config.SwitchIrOptim(false); - } else { - config.SwitchIrOptim(true); - } if (engine_conf.has_enable_memory_optimization() && engine_conf.enable_memory_optimization()) {