From aab21d1abd73454307e1a3ffa6ca0e1d80c3efd4 Mon Sep 17 00:00:00 2001 From: Li-fAngyU <56572498+Li-fAngyU@users.noreply.github.com> Date: Wed, 26 Oct 2022 10:16:54 +0800 Subject: [PATCH] [Wsign-compare] Close Wno-error of sign-compare (#47252) * Close Wno-error of sign-compare * fix sign-compare in graph_node_test.cc * fix sign-compare in graph_node_test.cc file * fix sign-compare in common_graph_table.cc file --- paddle/fluid/distributed/CMakeLists.txt | 2 +- .../distributed/ps/table/common_graph_table.cc | 2 +- paddle/fluid/distributed/rpc/CMakeLists.txt | 2 +- .../fluid/distributed/test/brpc_utils_test.cc | 2 +- .../fluid/distributed/test/graph_node_test.cc | 18 +++++++++--------- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/paddle/fluid/distributed/CMakeLists.txt b/paddle/fluid/distributed/CMakeLists.txt index ac4747adb8..b7d3328fe6 100755 --- a/paddle/fluid/distributed/CMakeLists.txt +++ b/paddle/fluid/distributed/CMakeLists.txt @@ -40,7 +40,7 @@ endif() proto_library(ps_framework_proto SRCS the_one_ps.proto) set(DISTRIBUTE_COMPILE_FLAGS - "-Wno-error=unused-value -Wno-non-virtual-dtor -Wno-error=non-virtual-dtor -Wno-error=delete-non-virtual-dtor -Wno-error=sign-compare -Wno-error=unused-variable -Wno-error=return-type -Wno-error=unused-but-set-variable -Wno-error=unknown-pragmas -Wno-error=parentheses -Wno-error=unused-result" + "-Wno-error=unused-value -Wno-non-virtual-dtor -Wno-error=non-virtual-dtor -Wno-error=delete-non-virtual-dtor -Wno-error=unused-variable -Wno-error=return-type -Wno-error=unused-but-set-variable -Wno-error=unknown-pragmas -Wno-error=parentheses -Wno-error=unused-result" ) if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0) diff --git a/paddle/fluid/distributed/ps/table/common_graph_table.cc b/paddle/fluid/distributed/ps/table/common_graph_table.cc index a8977ad58a..7fcc7512bc 100644 --- a/paddle/fluid/distributed/ps/table/common_graph_table.cc +++ b/paddle/fluid/distributed/ps/table/common_graph_table.cc @@ -556,7 +556,7 @@ int32_t GraphTable::dump_edges_to_ssd(int idx) { } int32_t GraphTable::make_complementary_graph(int idx, int64_t byte_size) { VLOG(0) << "make_complementary_graph"; - const int64_t fixed_size = byte_size / 8; + const size_t fixed_size = byte_size / 8; // std::vector edge_array[task_pool_size_]; std::vector> count(task_pool_size_); std::vector> tasks; diff --git a/paddle/fluid/distributed/rpc/CMakeLists.txt b/paddle/fluid/distributed/rpc/CMakeLists.txt index dae4efd6e8..e4a3b6b3c2 100644 --- a/paddle/fluid/distributed/rpc/CMakeLists.txt +++ b/paddle/fluid/distributed/rpc/CMakeLists.txt @@ -1,6 +1,6 @@ set(PADDLE_RPC_SRCS python_rpc_handler.cc rpc_agent.cc) set(DISTRIBUTE_COMPILE_FLAGS - "-Wno-error=unused-value -Wno-non-virtual-dtor -Wno-error=non-virtual-dtor -Wno-error=delete-non-virtual-dtor -Wno-error=sign-compare -Wno-error=unused-variable -Wno-error=return-type -Wno-error=unused-but-set-variable -Wno-error=unknown-pragmas -Wno-error=parentheses -Wno-error=unused-result" + "-Wno-error=unused-value -Wno-non-virtual-dtor -Wno-error=non-virtual-dtor -Wno-error=delete-non-virtual-dtor -Wno-error=unused-variable -Wno-error=return-type -Wno-error=unused-but-set-variable -Wno-error=unknown-pragmas -Wno-error=parentheses -Wno-error=unused-result" ) if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0) diff --git a/paddle/fluid/distributed/test/brpc_utils_test.cc b/paddle/fluid/distributed/test/brpc_utils_test.cc index 502778e40d..3614dedeeb 100644 --- a/paddle/fluid/distributed/test/brpc_utils_test.cc +++ b/paddle/fluid/distributed/test/brpc_utils_test.cc @@ -116,7 +116,7 @@ void RunMultiVarMsg(platform::Place place) { // check var3 framework::Variable* var3 = scope_recv.FindVar("x3"); auto* slr = var3->GetMutable(); - EXPECT_EQ(slr->rows().size(), 564); + EXPECT_EQ(slr->rows().size(), 564UL); for (int i = 0; i < 564; ++i) { EXPECT_EQ(slr->rows()[i], i); } diff --git a/paddle/fluid/distributed/test/graph_node_test.cc b/paddle/fluid/distributed/test/graph_node_test.cc index de12b715de..8b2cc5f6aa 100644 --- a/paddle/fluid/distributed/test/graph_node_test.cc +++ b/paddle/fluid/distributed/test/graph_node_test.cc @@ -546,7 +546,7 @@ void RunBrpcPushSparse() { VLOG(0) << "start to pull graph list"; nodes = client1.pull_graph_list(std::string("user"), 0, 1, 4, 1); VLOG(0) << "pull list done"; - ASSERT_EQ(nodes[0].get_id(), 59); + ASSERT_EQ(nodes[0].get_id(), 59UL); nodes.clear(); // Test Pull by step @@ -566,23 +566,23 @@ void RunBrpcPushSparse() { nodes.clear(); } } - ASSERT_EQ(count_item_nodes.size(), 12); + ASSERT_EQ(count_item_nodes.size(), 12UL); } std::pair>, std::vector> res; VLOG(0) << "start to sample neighbors "; res = client1.batch_sample_neighbors( std::string("user2item"), std::vector(1, 96), 4, true, false); - ASSERT_EQ(res.first[0].size(), 3); + ASSERT_EQ(res.first[0].size(), 3UL); std::vector node_ids; node_ids.push_back(96); node_ids.push_back(37); res = client1.batch_sample_neighbors( std::string("user2item"), node_ids, 4, true, false); - ASSERT_EQ(res.first[1].size(), 1); + ASSERT_EQ(res.first[1].size(), 1UL); std::vector nodes_ids = client2.random_sample_nodes("user", 0, 6); - ASSERT_EQ(nodes_ids.size(), 2); + ASSERT_EQ(nodes_ids.size(), 2UL); ASSERT_EQ(true, (nodes_ids[0] == 59 && nodes_ids[1] == 37) || (nodes_ids[0] == 37 && nodes_ids[1] == 59)); @@ -597,8 +597,8 @@ void RunBrpcPushSparse() { feature_names.push_back(std::string("d")); auto node_feat = client1.get_node_feat(std::string("user"), node_ids, feature_names); - ASSERT_EQ(node_feat.size(), 2); - ASSERT_EQ(node_feat[0].size(), 2); + ASSERT_EQ(node_feat.size(), 2UL); + ASSERT_EQ(node_feat[0].size(), 2UL); VLOG(0) << "get_node_feat: " << node_feat[0][0]; VLOG(0) << "get_node_feat: " << node_feat[0][1]; VLOG(0) << "get_node_feat: " << node_feat[1][0]; @@ -625,8 +625,8 @@ void RunBrpcPushSparse() { feature_names.push_back(std::string("b")); node_feat = client1.get_node_feat(std::string("user"), node_ids, feature_names); - ASSERT_EQ(node_feat.size(), 2); - ASSERT_EQ(node_feat[0].size(), 2); + ASSERT_EQ(node_feat.size(), 2UL); + ASSERT_EQ(node_feat[0].size(), 2UL); VLOG(0) << "get_node_feat: " << node_feat[0][0].size(); VLOG(0) << "get_node_feat: " << node_feat[0][1].size(); VLOG(0) << "get_node_feat: " << node_feat[1][0].size(); -- GitLab