2323#include < cugraph/graph.hpp>
2424#include < cugraph/utilities/error.hpp>
2525
26+ #include < cuda/std/__algorithm_>
2627#include < cuda/std/iterator>
27- #include < thrust/binary_search.h>
2828#include < thrust/iterator/counting_iterator.h>
2929
3030namespace {
@@ -87,8 +87,8 @@ cugraph_error_code_t renumber_arbitrary_edgelist(
8787 raft::device_span<vertex_t const >{renumber_chunk.data (), renumber_chunk.size ()},
8888 vertices_span,
8989 ids_span] __device__ (size_t idx) {
90- auto pos = thrust ::lower_bound (
91- thrust::seq, vertices_span.begin (), vertices_span.end (), renumber_chunk_span[idx]);
90+ auto pos = cuda::std ::lower_bound (
91+ vertices_span.begin (), vertices_span.end (), renumber_chunk_span[idx]);
9292 if ((pos != vertices_span.end ()) && (*pos == renumber_chunk_span[idx])) {
9393 ids_span[cuda::std::distance (vertices_span.begin (), pos)] =
9494 static_cast <vertex_t >(chunk_base_offset + idx);
@@ -102,27 +102,25 @@ cugraph_error_code_t renumber_arbitrary_edgelist(
102102 cugraph::invalid_vertex_id<vertex_t >::value) == 0 ,
103103 " some vertices were not renumbered" );
104104
105- thrust::transform (
106- handle.get_thrust_policy (),
107- srcs->as_type <vertex_t >(),
108- srcs->as_type <vertex_t >() + srcs->size_ ,
109- srcs->as_type <vertex_t >(),
110- [vertices_span, ids_span] __device__ (vertex_t v) {
111- return ids_span[cuda::std::distance (
112- vertices_span.begin (),
113- thrust::lower_bound (thrust::seq, vertices_span.begin (), vertices_span.end (), v))];
114- });
115-
116- thrust::transform (
117- handle.get_thrust_policy (),
118- dsts->as_type <vertex_t >(),
119- dsts->as_type <vertex_t >() + srcs->size_ ,
120- dsts->as_type <vertex_t >(),
121- [vertices_span, ids_span] __device__ (vertex_t v) {
122- return ids_span[cuda::std::distance (
123- vertices_span.begin (),
124- thrust::lower_bound (thrust::seq, vertices_span.begin (), vertices_span.end (), v))];
125- });
105+ thrust::transform (handle.get_thrust_policy (),
106+ srcs->as_type <vertex_t >(),
107+ srcs->as_type <vertex_t >() + srcs->size_ ,
108+ srcs->as_type <vertex_t >(),
109+ [vertices_span, ids_span] __device__ (vertex_t v) {
110+ return ids_span[cuda::std::distance (
111+ vertices_span.begin (),
112+ cuda::std::lower_bound (vertices_span.begin (), vertices_span.end (), v))];
113+ });
114+
115+ thrust::transform (handle.get_thrust_policy (),
116+ dsts->as_type <vertex_t >(),
117+ dsts->as_type <vertex_t >() + srcs->size_ ,
118+ dsts->as_type <vertex_t >(),
119+ [vertices_span, ids_span] __device__ (vertex_t v) {
120+ return ids_span[cuda::std::distance (
121+ vertices_span.begin (),
122+ cuda::std::lower_bound (vertices_span.begin (), vertices_span.end (), v))];
123+ });
126124
127125 return CUGRAPH_SUCCESS;
128126}
0 commit comments