-
Notifications
You must be signed in to change notification settings - Fork 297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace raw pointers with device_span in induced subgraph #2348
Replace raw pointers with device_span in induced subgraph #2348
Conversation
Can one of the admins verify this patch? |
1 similar comment
Can one of the admins verify this patch? |
This PR updates the public API of induced_subgrpah, so breaking. |
size_t const* subgraph_offsets, | ||
int32_t const* subgraph_vertices, | ||
raft::device_span<size_t const> subgraph_offsets /*size_t const* subgraph_offsets*/, | ||
raft::device_span<int_32 const> subgraph_vertices /*int32_t const* subgraph_vertices*/, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume int_32
here should be int32_t
rerun tests |
cpp/src/community/legacy/egonet.cu
Outdated
return cugraph::extract_induced_subgraphs( | ||
handle, csr_view, neighbors_offsets.data().get(), neighbors.data().get(), n_subgraphs); | ||
//return cugraph::extract_induced_subgraphs( | ||
//handle, csr_view, dspan_neighbors_offsets, dspan_neighbors, n_subgraphs, false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you commented this out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to comment out these lines to finish the compiling. And the EGO_TEST does not work now.
There are errors on line 171 when I construct raft::device_span<size_t const> d_neighbors_offsets and raft::device_span<vertex_t const> d_neighbors, no matter I use neighbors_offsets.data() or neighbors_offsets.data().get() as the input pointer.
error message:
/home/nfs/yangh/cugraph/cpp/src/community/legacy/egonet.cu(171): error: a pointer to a bound function may only be used to call the function
detected during instantiation of "std::tuple<rmm::device_uvector<vertex_t>, rmm::device_uvector<vertex_t>, std::optional<rmm::device_uvector<weight_t>>, rmm::device_uvector<size_t>> cugraph::extract_ego(const raft::handle_t &, const cugraph::graph_view_t<vertex_t, edge_t, weight_t, false, multi_gpu, void> &, vertex_t *, vertex_t, vertex_t) [with vertex_t=int32_t, edge_t=int32_t, weight_t=float, multi_gpu=false]"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return cugraph::extract_induced_subgraphs(handle, csr_view, raft::device_span<size_t const>(neighbor_offsets.data().get(), neighbor_offsets.size()), raft::device_span<vertex_t const>(neighbors.data().get(), neighbors.size(), n_subgraphs, false);
subgraph_offsets + 1, | ||
thrust::upper_bound(thrust::seq, subgraph_offsets, subgraph_offsets + num_subgraphs, i)); | ||
subgraph_offsets.begin()+1, | ||
thrust::upper_bound(thrust::seq, subgraph_offsets.begin(), subgraph_offsets.end()-1, i)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need change .end()-1 to .data() + num_subgraphs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thrust::upper_bound
works with iterators so, you can use either begin()
and end() - 1
or .data()
and .data() + num_subhgraphs
(but shouldn't mix begin()
and data() + num_subgraphs
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, I don't see a need to replace end() - 1 to data() + num_subgraphs.,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
rerun tests |
add to allowlist |
@yang-hu-nv
You need to run clang-format for the files mentioned above to address this. |
so, if you have updated a file, the copyright statement should be updated to include the current year as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!!!
@gpucibot merge |
Changed the interface of function extract_induced_subgraphs, and all corresponding test codes using this interface.