Skip to content

Commit

Permalink
missed flipping logic in multi-edges code, discovered in testing TC
Browse files Browse the repository at this point in the history
  • Loading branch information
ChuckHastings committed Dec 4, 2023
1 parent 54fb84e commit 5cf04ba
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions cpp/src/structure/remove_multi_edges_impl.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -254,14 +254,14 @@ remove_multi_edges(raft::handle_t const& handle,
}
}

auto [keep_count, keep_flags] =
detail::mark_entries(handle,
edgelist_srcs.size(),
[d_edgelist_srcs = edgelist_srcs.data(),
d_edgelist_dsts = edgelist_dsts.data()] __device__(auto idx) {
return (idx > 0) && (d_edgelist_srcs[idx - 1] == d_edgelist_srcs[idx]) &&
(d_edgelist_dsts[idx - 1] == d_edgelist_dsts[idx]);
});
auto [keep_count, keep_flags] = detail::mark_entries(
handle,
edgelist_srcs.size(),
[d_edgelist_srcs = edgelist_srcs.data(),
d_edgelist_dsts = edgelist_dsts.data()] __device__(auto idx) {
return !((idx > 0) && (d_edgelist_srcs[idx - 1] == d_edgelist_srcs[idx]) &&
(d_edgelist_dsts[idx - 1] == d_edgelist_dsts[idx]));
});

if (keep_count < edgelist_srcs.size()) {
edgelist_srcs = detail::keep_flagged_elements(
Expand Down
4 changes: 2 additions & 2 deletions cpp/tests/community/triangle_count_test.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022, NVIDIA CORPORATION.
* Copyright (c) 2022-2023, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -232,7 +232,7 @@ class Tests_TriangleCount
for (size_t i = 0; i < h_cugraph_vertices.size(); ++i) {
auto v = h_cugraph_vertices[i];
auto count = h_cugraph_triangle_counts[i];
ASSERT_TRUE(count == h_reference_triangle_counts[v])
ASSERT_EQ(count, h_reference_triangle_counts[v])
<< "Triangle count values do not match with the reference values.";
}
}
Expand Down

0 comments on commit 5cf04ba

Please sign in to comment.