Skip to content

Commit 27aef26

Browse files
authored
Merge pull request #12009 from luotao1/warning
fix compile warning in inference related codes
2 parents ef4895d + fc3e734 commit 27aef26

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

cmake/external/anakin.cmake

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,17 @@ set(ANAKIN_INSTALL_DIR "${THIRD_PARTY_PATH}/install/anakin" CACHE PATH
77
set(ANAKIN_INCLUDE "${ANAKIN_INSTALL_DIR}" CACHE STRING "root of Anakin header files")
88
set(ANAKIN_LIBRARY "${ANAKIN_INSTALL_DIR}" CACHE STRING "path of Anakin library")
99

10-
set(ANAKIN_COMPILE_EXTRA_FLAGS -Wno-error=unused-variable -Wno-error=format-extra-args -Wno-error=comment -Wno-error=format -Wno-error=switch -Wno-error=return-type -Wno-error=non-virtual-dtor -Wno-reorder -Wno-error=cpp)
10+
set(ANAKIN_COMPILE_EXTRA_FLAGS
11+
-Wno-error=unused-variable -Wno-unused-variable
12+
-Wno-error=format-extra-args -Wno-format-extra-args
13+
-Wno-error=comment -Wno-comment
14+
-Wno-error=format -Wno-format
15+
-Wno-error=switch -Wno-switch
16+
-Wno-error=return-type -Wno-return-type
17+
-Wno-error=non-virtual-dtor -Wno-non-virtual-dtor
18+
-Wno-sign-compare
19+
-Wno-reorder
20+
-Wno-error=cpp)
1121

1222
set(ANAKIN_LIBRARY_URL "https://github.com/pangge/Anakin/releases/download/3.0/anakin_release_simple.tar.gz")
1323

paddle/contrib/inference/test_paddle_inference_api_impl.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ void MainThreadsImageClassification(bool use_gpu) {
249249
const size_t len = local_outputs[0].data.length();
250250
float* data = static_cast<float*>(local_outputs[0].data.data());
251251
float* ref_data = refs[tid].data<float>();
252-
EXPECT_EQ(refs[tid].numel(), len / sizeof(float));
252+
EXPECT_EQ((size_t)refs[tid].numel(), len / sizeof(float));
253253
for (int i = 0; i < refs[tid].numel(); ++i) {
254254
EXPECT_NEAR(ref_data[i], data[i], 1e-3);
255255
}

paddle/fluid/inference/analysis/fluid_to_data_flow_graph_pass_tester.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ TEST_F(DFG_Tester, Init) {
2727
DataFlowGraph graph;
2828
pass.Run(&graph);
2929
// Analysis is sensitive to ProgramDesc, careful to change the original model.
30-
ASSERT_EQ(graph.nodes.size(), 37);
30+
ASSERT_EQ(graph.nodes.size(), 37UL);
3131
pass.Finalize();
3232
LOG(INFO) << '\n' << graph.DotString();
3333
}

paddle/fluid/inference/analysis/subgraph_splitter_tester.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ TEST_F(DFG_Tester, Fuse) {
8282

8383
// At least one nodes should be deleted.
8484
ASSERT_EQ(dfg.nodes.size(), count0 + 1); // added a new FunctionBlock
85-
ASSERT_EQ(6UL, count1);
85+
ASSERT_EQ(6, count1);
8686
}
8787

8888
} // namespace analysis

0 commit comments

Comments
 (0)