Skip to content

Commit 7871f62

Browse files
co63ocmaxiaolong001
authored andcommitted
test/deprecated/cpp modify use_mkldnn [fluid_ops] (PaddlePaddle#74502)
1 parent 5affe1a commit 7871f62

File tree

5 files changed

+16
-16
lines changed

5 files changed

+16
-16
lines changed

test/deprecated/cpp/inference/api/analysis_predictor_tester.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ TEST(AnalysisPredictor, bf16_gpu_pass_strategy) {
317317
config.SetModel(FLAGS_dirname);
318318
config.SwitchIrOptim(true);
319319
config.EnableUseGpu(100, 0);
320-
config.EnableMkldnnBfloat16();
320+
config.EnableOnednnBfloat16();
321321
#ifdef PADDLE_WITH_DNNL
322322
if (phi::backends::cpu::MayIUse(phi::backends::cpu::cpu_isa_t::avx512_core))
323323
ASSERT_EQ(config.onednn_bfloat16_enabled(), true);
@@ -332,7 +332,7 @@ TEST(AnalysisPredictor, bf16_gpu_pass_strategy) {
332332
TEST(AnalysisPredictor, bf16_pass_strategy) {
333333
std::vector<std::string> passes;
334334
PassStrategy passStrategy(passes);
335-
passStrategy.EnableMkldnnBfloat16();
335+
passStrategy.EnableOnednnBfloat16();
336336
}
337337

338338
TEST(AnalysisPredictor, onednn_fc_pass_strategy) {

test/deprecated/cpp/inference/api/analyzer_bert_tester_deprecated.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ TEST(Analyzer_bert, compare) {
6969
CompareNativeAndAnalysisWrapper();
7070
}
7171
#ifdef PADDLE_WITH_DNNL
72-
TEST(Analyzer_bert, compare_mkldnn) {
72+
TEST(Analyzer_bert, compare_onednn) {
7373
auto use_onednn = true;
7474
CompareNativeAndAnalysisWrapper(use_onednn);
7575
}
@@ -210,7 +210,7 @@ AnalysisConfig SetConfig(bool use_onednn, bool use_bfloat16) {
210210
config.EnableONEDNN();
211211
}
212212

213-
if (use_bfloat16) config.EnableMkldnnBfloat16();
213+
if (use_bfloat16) config.EnableOnednnBfloat16();
214214

215215
return config;
216216
}

test/deprecated/cpp/inference/api/analyzer_image_classification_tester.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ void SetInput(std::vector<std::vector<PaddleTensor>> *inputs) {
3737
}
3838

3939
// Easy for profiling independently.
40-
void profile(bool use_mkldnn = false) {
40+
void profile(bool use_onednn = false) {
4141
AnalysisConfig cfg;
4242
SetConfig(&cfg);
4343

44-
if (use_mkldnn) {
44+
if (use_onednn) {
4545
cfg.EnableONEDNN();
4646
if (FLAGS_disable_onednn_fc) {
4747
cfg.DisableOnednnFcPasses();
@@ -59,14 +59,14 @@ void profile(bool use_mkldnn = false) {
5959

6060
TEST(Analyzer_resnet50, profile) { profile(); }
6161
#ifdef PADDLE_WITH_DNNL
62-
TEST(Analyzer_resnet50, profile_mkldnn) { profile(true /* use_mkldnn */); }
62+
TEST(Analyzer_resnet50, profile_onednn) { profile(true /* use_onednn */); }
6363
#endif
6464

6565
// Compare result of NativeConfig and AnalysisConfig
66-
void compare(bool use_mkldnn = false) {
66+
void compare(bool use_onednn = false) {
6767
AnalysisConfig cfg;
6868
SetConfig(&cfg);
69-
if (use_mkldnn) {
69+
if (use_onednn) {
7070
cfg.EnableONEDNN();
7171
if (FLAGS_disable_onednn_fc) {
7272
cfg.DisableOnednnFcPasses();
@@ -81,7 +81,7 @@ void compare(bool use_mkldnn = false) {
8181

8282
TEST(Analyzer_resnet50, compare) { compare(); }
8383
#ifdef PADDLE_WITH_DNNL
84-
TEST(Analyzer_resnet50, compare_mkldnn) { compare(true /* use_mkldnn */); }
84+
TEST(Analyzer_resnet50, compare_onednn) { compare(true /* use_onednn */); }
8585
#endif
8686

8787
// Compare Deterministic result

test/deprecated/cpp/inference/api/analyzer_transformer_compare_tester.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ namespace inference {
1919
namespace analysis {
2020
namespace transformer_tester {
2121

22-
void compare(bool use_mkldnn = false) {
22+
void compare(bool use_onednn = false) {
2323
AnalysisConfig cfg;
2424
SetConfig(&cfg);
25-
if (!use_mkldnn) {
25+
if (!use_onednn) {
2626
cfg.DisableONEDNN();
2727
}
2828

@@ -34,7 +34,7 @@ void compare(bool use_mkldnn = false) {
3434

3535
TEST(Analyzer_Transformer, compare) { compare(); }
3636
#ifdef PADDLE_WITH_DNNL
37-
TEST(Analyzer_Transformer, compare_mkldnn) { compare(true /* use_mkldnn */); }
37+
TEST(Analyzer_Transformer, compare_onednn) { compare(true /* use_onednn */); }
3838
#endif
3939

4040
} // namespace transformer_tester

test/deprecated/cpp/inference/api/analyzer_transformer_profile_tester.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ namespace inference {
1919
namespace analysis {
2020
namespace transformer_tester {
2121

22-
void profile(bool use_mkldnn = false) {
22+
void profile(bool use_onednn = false) {
2323
AnalysisConfig cfg;
2424
SetConfig(&cfg);
2525
std::vector<std::vector<PaddleTensor>> outputs;
26-
if (use_mkldnn) {
26+
if (use_onednn) {
2727
cfg.EnableONEDNN();
2828
}
2929

@@ -37,7 +37,7 @@ void profile(bool use_mkldnn = false) {
3737

3838
TEST(Analyzer_Transformer, profile) { profile(); }
3939
#ifdef PADDLE_WITH_DNNL
40-
TEST(Analyzer_Transformer, profile_mkldnn) { profile(true); }
40+
TEST(Analyzer_Transformer, profile_onednn) { profile(true); }
4141
#endif
4242

4343
} // namespace transformer_tester

0 commit comments

Comments
 (0)