Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 9 additions & 16 deletions cpp/src/prims/transform_e.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -291,23 +291,16 @@ void transform_e(raft::handle_t const& handle,
auto major = thrust::get<0>(edge);
auto minor = thrust::get<1>(edge);

vertex_t major_offset{};
vertex_t major_idx{};
auto major_hypersparse_first = edge_partition.major_hypersparse_first();
if (major_hypersparse_first) {
if (major < *major_hypersparse_first) {
major_offset = edge_partition.major_offset_from_major_nocheck(major);
major_idx = major_offset;
} else {
auto major_hypersparse_idx =
edge_partition.major_hypersparse_idx_from_major_nocheck(major);
assert(major_hypersparse_idx);
major_idx = edge_partition.major_offset_from_major_nocheck(*major_hypersparse_first) +
*major_hypersparse_idx;
}
} else {
major_offset = edge_partition.major_offset_from_major_nocheck(major);
major_idx = major_offset;
auto major_offset = edge_partition.major_offset_from_major_nocheck(major);
vertex_t major_idx{major_offset};

if ((major_hypersparse_first) && (major >= *major_hypersparse_first)) {
auto major_hypersparse_idx =
edge_partition.major_hypersparse_idx_from_major_nocheck(major);
assert(major_hypersparse_idx);
major_idx = edge_partition.major_offset_from_major_nocheck(*major_hypersparse_first) +
*major_hypersparse_idx;
Copy link
Contributor

@seunghwak seunghwak Jul 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the difference between these two?

First, if ((major_hypersparse_first) && (*major_hypersparse_first < major)) should be if ((major_hypersparse_first) && (*major_hypersparse_first <= major))

And if I am not mistaken, if we're using DCSR/DCSC and major is in the hypersparse range, we are setting major_idx to major_hypersparse_idx + major_idx of the beginning of the hypersparse range. Otherwise major_idx is just major_offset.

I am not sure how these two are different.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see, this isn't about major_idx, but this is about major_offset, let me take a closer look.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if ((major_hypersparse_first) && (*major_hypersparse_first < major))
=>
if ((major_hypersparse_first) && (major >= *major_hypersparse_first))

Otherwise, LGTM.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

}

auto minor_offset = edge_partition.minor_offset_from_minor_nocheck(minor);
Expand Down