提交 732a4052 编写于 作者: Z zhangjun

update

上级 465bf946
...@@ -166,6 +166,13 @@ class PaddleInferenceEngine : public EngineCore { ...@@ -166,6 +166,13 @@ class PaddleInferenceEngine : public EngineCore {
} }
precision_type = GetPrecision(FLAGS_precision); 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_trt() && engine_conf.use_trt()) {
if (!engine_conf.has_use_gpu() || !engine_conf.use_gpu()) { if (!engine_conf.has_use_gpu() || !engine_conf.use_gpu()) {
config.EnableUseGpu(2000, FLAGS_gpuid); config.EnableUseGpu(2000, FLAGS_gpuid);
...@@ -209,12 +216,6 @@ class PaddleInferenceEngine : public EngineCore { ...@@ -209,12 +216,6 @@ class PaddleInferenceEngine : public EngineCore {
// 2 MB l3 cache // 2 MB l3 cache
config.EnableXpu(2 * 1024 * 1024); 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() && if (engine_conf.has_enable_memory_optimization() &&
engine_conf.enable_memory_optimization()) { engine_conf.enable_memory_optimization()) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册