提交 96545b51 编写于 作者: Z zhangjun

update

上级 940b6aa8
...@@ -528,7 +528,7 @@ class CloneDBReloadableInferEngine ...@@ -528,7 +528,7 @@ class CloneDBReloadableInferEngine
}; };
template <typename FluidFamilyCore> template <typename FluidFamilyCore>
#ifdef WITH_TRT #ifdef WITH_TRT | WITH_XPU
class FluidInferEngine : public DBReloadableInferEngine<FluidFamilyCore> { class FluidInferEngine : public DBReloadableInferEngine<FluidFamilyCore> {
#else #else
class FluidInferEngine : public CloneDBReloadableInferEngine<FluidFamilyCore> { class FluidInferEngine : public CloneDBReloadableInferEngine<FluidFamilyCore> {
......
...@@ -128,14 +128,6 @@ class FluidArmAnalysisCore : public FluidFamilyCore { ...@@ -128,14 +128,6 @@ class FluidArmAnalysisCore : public FluidFamilyCore {
config.DisableGpu(); config.DisableGpu();
config.SetCpuMathLibraryNumThreads(1); config.SetCpuMathLibraryNumThreads(1);
if (params.enable_memory_optimization()) {
config.EnableMemoryOptim();
}
if (params.enable_memory_optimization()) {
config.EnableMemoryOptim();
}
if (params.use_lite()) { if (params.use_lite()) {
config.EnableLiteEngine(PrecisionType::kFloat32, true); config.EnableLiteEngine(PrecisionType::kFloat32, true);
} }
...@@ -144,6 +136,16 @@ class FluidArmAnalysisCore : public FluidFamilyCore { ...@@ -144,6 +136,16 @@ class FluidArmAnalysisCore : public FluidFamilyCore {
config.EnableXpu(2 * 1024 * 1024); config.EnableXpu(2 * 1024 * 1024);
} }
if (params.enable_memory_optimization()) {
config.EnableMemoryOptim();
}
if (params.enable_ir_optimization()) {
config.SwitchIrOptim(true);
} else {
config.SwitchIrOptim(false);
}
config.SwitchSpecifyInputNames(true); config.SwitchSpecifyInputNames(true);
AutoLock lock(GlobalPaddleCreateMutex::instance()); AutoLock lock(GlobalPaddleCreateMutex::instance());
_core = CreatePredictor(config); _core = CreatePredictor(config);
...@@ -173,6 +175,14 @@ class FluidArmAnalysisDirCore : public FluidFamilyCore { ...@@ -173,6 +175,14 @@ class FluidArmAnalysisDirCore : public FluidFamilyCore {
config.SwitchSpecifyInputNames(true); config.SwitchSpecifyInputNames(true);
config.SetCpuMathLibraryNumThreads(1); config.SetCpuMathLibraryNumThreads(1);
if (params.use_lite()) {
config.EnableLiteEngine(PrecisionType::kFloat32, true);
}
if (params.use_xpu()) {
config.EnableXpu(2 * 1024 * 1024);
}
if (params.enable_memory_optimization()) { if (params.enable_memory_optimization()) {
config.EnableMemoryOptim(); config.EnableMemoryOptim();
} }
...@@ -183,14 +193,6 @@ class FluidArmAnalysisDirCore : public FluidFamilyCore { ...@@ -183,14 +193,6 @@ class FluidArmAnalysisDirCore : public FluidFamilyCore {
config.SwitchIrOptim(false); config.SwitchIrOptim(false);
} }
if (params.use_lite()) {
config.EnableLiteEngine(PrecisionType::kFloat32, true);
}
if (params.use_xpu()) {
config.EnableXpu(1 * 1024 * 1024);
}
AutoLock lock(GlobalPaddleCreateMutex::instance()); AutoLock lock(GlobalPaddleCreateMutex::instance());
_core = CreatePredictor(config); _core = CreatePredictor(config);
if (NULL == _core.get()) { if (NULL == _core.get()) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册