未验证 提交 aab21d1a 编写于 作者: L Li-fAngyU 提交者: GitHub

[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
上级 c0525b82
......@@ -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)
......
......@@ -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<int64_t> edge_array[task_pool_size_];
std::vector<std::unordered_map<uint64_t, int>> count(task_pool_size_);
std::vector<std::future<int>> tasks;
......
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)
......
......@@ -116,7 +116,7 @@ void RunMultiVarMsg(platform::Place place) {
// check var3
framework::Variable* var3 = scope_recv.FindVar("x3");
auto* slr = var3->GetMutable<phi::SelectedRows>();
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);
}
......
......@@ -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<std::vector<int64_t>>, std::vector<float>> res;
VLOG(0) << "start to sample neighbors ";
res = client1.batch_sample_neighbors(
std::string("user2item"), std::vector<int64_t>(1, 96), 4, true, false);
ASSERT_EQ(res.first[0].size(), 3);
ASSERT_EQ(res.first[0].size(), 3UL);
std::vector<int64_t> 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<int64_t> 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();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册