diff --git a/paddle/infrt/api/infrt_api.cc b/paddle/infrt/api/infrt_api.cc index 8b4b14a3ca08ba10595b633d439f747b01ccf4e3..ec6293f9a2bdbbf5caf11732618d924f2e86a1aa 100644 --- a/paddle/infrt/api/infrt_api.cc +++ b/paddle/infrt/api/infrt_api.cc @@ -257,11 +257,13 @@ int InfRtPredictor::Init(const InfRtConfig& config) { ::mlir::OpPassManager& pass_manager = pm.nest<::mlir::FuncOp>(); if (config.tensorrt_enabled()) { pass_manager.addPass(::infrt::CreateInfrtWeightsUnfoldPass()); +#if defined(INFRT_WITH_GPU) && defined(INFRT_WITH_TRT) pass_manager.addPass(::infrt::trt::CreateTrtOpTellerPass()); pass_manager.addPass(::infrt::trt::CreateTrtGraphFusePass()); pass_manager.addPass(::infrt::trt::CreateTrtGraphSplitPass(1)); pass_manager.addPass(::infrt::trt::CreateTrtOpConverterPass()); pass_manager.addPass(::infrt::trt::CreateTrtTypeConvertPass()); +#endif pass_manager.addPass(::mlir::createCanonicalizerPass()); } else { std::vector<::infrt::Place> valid_places = {