diff --git a/cpp/include/cugraph/detail/utility_wrappers.hpp b/cpp/include/cugraph/detail/utility_wrappers.hpp index 585ee4658f..c0be99f413 100644 --- a/cpp/include/cugraph/detail/utility_wrappers.hpp +++ b/cpp/include/cugraph/detail/utility_wrappers.hpp @@ -66,46 +66,46 @@ template void scalar_fill(raft::handle_t const& handle, value_t* d_value, size_t size, value_t value); /** - * @brief Sort a buffer + * @brief Sort a device span * * @tparam value_t type of the value to operate on * * @param [in] handle RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, * and handles to various CUDA libraries) to run graph algorithms. - * @param[out] d_value device array to sort + * @param[out] d_span device span to sort * */ template -void sort(raft::handle_t const& handle, raft::device_span d_value); +void sort(raft::handle_t const& handle, raft::device_span d_span); /** - * @brief Keep unique element from a buffer + * @brief Keep unique element from a device span * * @tparam value_t type of the value to operate on * * @param [in] handle RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, * and handles to various CUDA libraries) to run graph algorithms. - * @param[in] d_value device array of unique elements. + * @param[in] d_span device span of unique elements. * @return the number of unique elements. * */ template -size_t unique(raft::handle_t const& handle, raft::device_span d_value); +size_t unique(raft::handle_t const& handle, raft::device_span d_span); /** - * @brief Increment the values of a buffer by a constant value + * @brief Increment the values of a device span by a constant value * * @tparam value_t type of the value to operate on * * @param [in] handle RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, * and handles to various CUDA libraries) to run graph algorithms. - * @param[out] d_value device array to update + * @param[out] d_span device span to update * @param[in] value value to be added to each element of the buffer * */ template void transform_increment(rmm::cuda_stream_view const& stream_view, - raft::device_span d_value, + raft::device_span d_span, value_t value); /** diff --git a/cpp/src/detail/utility_wrappers_32.cu b/cpp/src/detail/utility_wrappers_32.cu index 3fe1a50787..c59006985a 100644 --- a/cpp/src/detail/utility_wrappers_32.cu +++ b/cpp/src/detail/utility_wrappers_32.cu @@ -63,10 +63,10 @@ template void scalar_fill(raft::handle_t const& handle, size_t* d_value, size_t template void scalar_fill(raft::handle_t const& handle, float* d_value, size_t size, float value); -template void sort(raft::handle_t const& handle, raft::device_span d_value); +template void sort(raft::handle_t const& handle, raft::device_span d_span); -template size_t unique(raft::handle_t const& handle, raft::device_span d_value); -template size_t unique(raft::handle_t const& handle, raft::device_span d_value); +template size_t unique(raft::handle_t const& handle, raft::device_span d_span); +template size_t unique(raft::handle_t const& handle, raft::device_span d_span); template void sequence_fill(rmm::cuda_stream_view const& stream_view, int32_t* d_value, @@ -79,11 +79,11 @@ template void sequence_fill(rmm::cuda_stream_view const& stream_view, uint32_t start_value); template void transform_increment(rmm::cuda_stream_view const& stream_view, - raft::device_span d_value, + raft::device_span d_span, int32_t value); template void transform_increment(rmm::cuda_stream_view const& stream_view, - raft::device_span d_value, + raft::device_span d_span, uint32_t value); template void stride_fill(rmm::cuda_stream_view const& stream_view, diff --git a/cpp/src/detail/utility_wrappers_64.cu b/cpp/src/detail/utility_wrappers_64.cu index 4012aa69b5..f78c709024 100644 --- a/cpp/src/detail/utility_wrappers_64.cu +++ b/cpp/src/detail/utility_wrappers_64.cu @@ -61,10 +61,10 @@ template void scalar_fill(raft::handle_t const& handle, template void scalar_fill(raft::handle_t const& handle, double* d_value, size_t size, double value); -template void sort(raft::handle_t const& handle, raft::device_span d_value); +template void sort(raft::handle_t const& handle, raft::device_span d_span); -template size_t unique(raft::handle_t const& handle, raft::device_span d_value); -template size_t unique(raft::handle_t const& handle, raft::device_span d_value); +template size_t unique(raft::handle_t const& handle, raft::device_span d_span); +template size_t unique(raft::handle_t const& handle, raft::device_span d_span); template void sequence_fill(rmm::cuda_stream_view const& stream_view, int64_t* d_value, @@ -77,11 +77,11 @@ template void sequence_fill(rmm::cuda_stream_view const& stream_view, uint64_t start_value); template void transform_increment(rmm::cuda_stream_view const& stream_view, - raft::device_span d_value, + raft::device_span d_span, int64_t value); template void transform_increment(rmm::cuda_stream_view const& stream_view, - raft::device_span d_value, + raft::device_span d_span, uint64_t value); template void stride_fill(rmm::cuda_stream_view const& stream_view, diff --git a/cpp/src/detail/utility_wrappers_impl.cuh b/cpp/src/detail/utility_wrappers_impl.cuh index 320ab65d37..7522f3a9c5 100644 --- a/cpp/src/detail/utility_wrappers_impl.cuh +++ b/cpp/src/detail/utility_wrappers_impl.cuh @@ -65,17 +65,17 @@ void scalar_fill(raft::handle_t const& handle, value_t* d_value, size_t size, va } template -void sort(raft::handle_t const& handle, raft::device_span d_value) +void sort(raft::handle_t const& handle, raft::device_span d_span) { - thrust::sort(handle.get_thrust_policy(), d_value.begin(), d_value.end()); + thrust::sort(handle.get_thrust_policy(), d_span.begin(), d_span.end()); } template -size_t unique(raft::handle_t const& handle, raft::device_span d_value) +size_t unique(raft::handle_t const& handle, raft::device_span d_span) { auto unique_element_last = - thrust::unique(handle.get_thrust_policy(), d_value.begin(), d_value.end()); - return thrust::distance(d_value.begin(), unique_element_last); + thrust::unique(handle.get_thrust_policy(), d_span.begin(), d_span.end()); + return thrust::distance(d_span.begin(), unique_element_last); } template @@ -89,23 +89,18 @@ void sequence_fill(rmm::cuda_stream_view const& stream_view, template void transform_increment(rmm::cuda_stream_view const& stream_view, - raft::device_span d_value, + raft::device_span d_span, value_t incr) { thrust::transform(rmm::exec_policy(stream_view), - d_value.begin(), - d_value.end(), - d_value.begin(), + d_span.begin(), + d_span.end(), + d_span.begin(), cuda::proclaim_return_type([incr] __device__(value_t value) { return static_cast(value + incr); })); } -template -void transform_increment_(rmm::cuda_stream_view const& stream_view, value_t d_value) -{ -} - template void stride_fill(rmm::cuda_stream_view const& stream_view, value_t* d_value,