diff --git a/paddle/fluid/inference/api/analysis_predictor.cc b/paddle/fluid/inference/api/analysis_predictor.cc index cd52114713ba85cf5ced617a18fe901eb3c0cf86..684e0ce0e292d852d4601ebd1ccd920382e42c8b 100644 --- a/paddle/fluid/inference/api/analysis_predictor.cc +++ b/paddle/fluid/inference/api/analysis_predictor.cc @@ -77,7 +77,7 @@ bool AnalysisPredictor::Init( OptimizeInferenceProgram(); ctx_ = executor_->Prepare(*inference_program_, 0); - if (config_.use_mkldnn) { + if (config_._use_mkldnn) { executor_->EnableMKLDNN(*inference_program_); } diff --git a/paddle/fluid/inference/api/api_impl.cc b/paddle/fluid/inference/api/api_impl.cc index c6cb09667e0e58962c073dbbb7affebf76cc185d..2e9e10139fa7008a46c3782960dfd44d3228cc26 100644 --- a/paddle/fluid/inference/api/api_impl.cc +++ b/paddle/fluid/inference/api/api_impl.cc @@ -106,7 +106,7 @@ bool NativePaddlePredictor::Init( } ctx_ = executor_->Prepare(*inference_program_, 0); - if (config_.use_mkldnn) { + if (config_._use_mkldnn) { executor_->EnableMKLDNN(*inference_program_); } executor_->CreateVariables(*inference_program_, diff --git a/paddle/fluid/inference/api/paddle_inference_api.h b/paddle/fluid/inference/api/paddle_inference_api.h index e8d51bb72cd08cb443b809d196c3e95f6050f5be..55a07ca705f9fafa9ea223a867300bd14e10c364 100644 --- a/paddle/fluid/inference/api/paddle_inference_api.h +++ b/paddle/fluid/inference/api/paddle_inference_api.h @@ -121,8 +121,8 @@ struct NativeConfig : public PaddlePredictor::Config { bool use_gpu{false}; int device{0}; float fraction_of_gpu_memory{-1.f}; // Negative to notify initialization. - // MKLDNN related fields. - bool use_mkldnn{false}; + // NOTE: NOT use it, just for the internal test, will discard later + bool _use_mkldnn{false}; // Specify the variable's name of each input. bool specify_input_name{false}; diff --git a/paddle/fluid/inference/tests/api/analyzer_vis_tester.cc b/paddle/fluid/inference/tests/api/analyzer_vis_tester.cc index 135a81a85c2d86e1cb06c5b1adf02c23d91857f6..3675c5f7f378f50d24d9de52e5e60bfc2bdfb71f 100644 --- a/paddle/fluid/inference/tests/api/analyzer_vis_tester.cc +++ b/paddle/fluid/inference/tests/api/analyzer_vis_tester.cc @@ -72,7 +72,7 @@ void TestVisualPrediction(bool use_mkldnn) { cfg.param_file = FLAGS_infer_model + "/__params__"; cfg.prog_file = FLAGS_infer_model + "/__model__"; cfg.use_gpu = false; - cfg.use_mkldnn = use_mkldnn; + cfg._use_mkldnn = use_mkldnn; cfg.device = 0; cfg.enable_ir_optim = true; cfg.ir_passes.push_back("fc_gru_fuse_pass");