diff --git a/cpp/include/cudf/aggregation/host_udf.hpp b/cpp/include/cudf/aggregation/host_udf.hpp index 77c6f246e0c5..313dd1ff8500 100644 --- a/cpp/include/cudf/aggregation/host_udf.hpp +++ b/cpp/include/cudf/aggregation/host_udf.hpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -11,9 +11,10 @@ #include #include -#include #include +#include + #include #include @@ -96,7 +97,7 @@ class host_udf_base { * column_view const& input, * data_type output_dtype, * std::optional> init, - * rmm::cuda_stream_view stream, + * cuda::stream_ref stream, * rmm::device_async_resource_ref mr) const override * { * // Perform reduction computation using the input data and return the reduction result. @@ -132,7 +133,7 @@ struct reduce_host_udf : host_udf_base { column_view const& input, data_type output_dtype, std::optional> init, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const = 0; }; @@ -154,7 +155,7 @@ struct reduce_host_udf : host_udf_base { * data_type output_dtype, * null_policy null_handling, * std::optional> init, - * rmm::cuda_stream_view stream, + * cuda::stream_ref stream, * rmm::device_async_resource_ref mr) const override * { * // Perform computation using the input data and return the result. @@ -196,7 +197,7 @@ struct segmented_reduce_host_udf : host_udf_base { data_type output_dtype, null_policy null_handling, std::optional> init, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const = 0; }; @@ -226,14 +227,14 @@ struct aggregate_result_functor; * my_udf_aggregation() = default; * * [[nodiscard]] std::unique_ptr get_empty_output( - * rmm::cuda_stream_view stream, + * cuda::stream_ref stream, * rmm::device_async_resource_ref mr) const override * { * // Return a column corresponding to the result when the input values column is empty. * } * * [[nodiscard]] std::unique_ptr operator()( - * rmm::cuda_stream_view stream, + * cuda::stream_ref stream, * rmm::device_async_resource_ref mr) const override * { * // Perform UDF computation using the input data and return the result. @@ -265,7 +266,7 @@ struct groupby_host_udf : host_udf_base { * @return The output result of the aggregation when the input values column is empty */ [[nodiscard]] virtual std::unique_ptr get_empty_output( - rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr) const = 0; + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const = 0; /** * @brief Perform the main groupby computation for the host-based UDF. @@ -275,7 +276,7 @@ struct groupby_host_udf : host_udf_base { * @return The output result of the aggregation */ [[nodiscard]] virtual std::unique_ptr operator()( - rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr) const = 0; + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const = 0; private: // Allow the struct `aggregate_result_functor` to set its private callback variables. diff --git a/cpp/include/cudf/binaryop.hpp b/cpp/include/cudf/binaryop.hpp index e699d4d63bbb..19899a836c3e 100644 --- a/cpp/include/cudf/binaryop.hpp +++ b/cpp/include/cudf/binaryop.hpp @@ -160,7 +160,7 @@ std::unique_ptr binary_operation( column_view const& rhs, binary_operator op, data_type output_type, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -191,7 +191,7 @@ std::unique_ptr binary_operation( scalar const& rhs, binary_operator op, data_type output_type, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -221,7 +221,7 @@ std::unique_ptr binary_operation( column_view const& rhs, binary_operator op, data_type output_type, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -252,7 +252,7 @@ std::unique_ptr binary_operation( column_view const& rhs, std::string const& ptx, data_type output_type, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -305,7 +305,7 @@ bool is_supported_operation(data_type out, data_type lhs, data_type rhs, binary_ std::pair scalar_col_valid_mask_and( column_view const& col, scalar const& s, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); } // namespace binops @@ -333,6 +333,6 @@ void apply_sorting_struct_binary_op(mutable_column_view& out, bool is_lhs_scalar, bool is_rhs_scalar, binary_operator op, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); } // namespace binops::compiled::detail } // namespace CUDF_EXPORT cudf diff --git a/cpp/include/cudf/contiguous_split.hpp b/cpp/include/cudf/contiguous_split.hpp index 673a4bb9feee..ecf3cbfde842 100644 --- a/cpp/include/cudf/contiguous_split.hpp +++ b/cpp/include/cudf/contiguous_split.hpp @@ -104,6 +104,7 @@ struct contiguous_split_state; * // data. In memory constrained cases, this can be used to set aside scratch memory * // for `chunked_pack` at the beginning of a program. * auto mr = cudf::get_current_device_resource_ref(); + * cuda::stream_ref stream = cudf::get_default_stream(); * * // Define a buffer size for each chunk: the larger the buffer is, the more SMs can be * // occupied by this algorithm. @@ -116,7 +117,7 @@ struct contiguous_split_state; * // * std::size_t user_buffer_size = 128*1024*1024; * - * auto chunked_packer = cudf::chunked_pack::create(tv, user_buffer_size, mr); + * auto chunked_packer = cudf::chunked_pack::create(tv, user_buffer_size, stream, mr); * * std::size_t host_offset = 0; * auto host_buffer = ...; // obtain a host buffer you would like to copy to @@ -134,7 +135,7 @@ struct contiguous_split_state; * user_buffer.data(), * bytes_copied, * cudaMemcpyDefault, - * stream); + * stream.get()); * * host_offset += bytes_copied; * } diff --git a/cpp/include/cudf/detail/binaryop.hpp b/cpp/include/cudf/detail/binaryop.hpp index f5b24047aa79..1bc3bc40f917 100644 --- a/cpp/include/cudf/detail/binaryop.hpp +++ b/cpp/include/cudf/detail/binaryop.hpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2018-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2018-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ #pragma once @@ -8,7 +8,7 @@ #include #include -#include +#include namespace cudf { //! Inner interfaces and implementations @@ -16,46 +16,46 @@ namespace detail { /** * @copydoc cudf::binary_operation(column_view const&, column_view const&, - * std::string const&, data_type, rmm::cuda_stream_view, rmm::device_async_resource_ref) + * std::string const&, data_type, cuda::stream_ref, rmm::device_async_resource_ref) */ std::unique_ptr binary_operation(column_view const& lhs, column_view const& rhs, std::string const& ptx, data_type output_type, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** * @copydoc cudf::binary_operation(scalar const&, column_view const&, binary_operator, - * data_type, rmm::cuda_stream_view, rmm::device_async_resource_ref) + * data_type, cuda::stream_ref, rmm::device_async_resource_ref) */ std::unique_ptr binary_operation(scalar const& lhs, column_view const& rhs, binary_operator op, data_type output_type, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** * @copydoc cudf::binary_operation(column_view const&, scalar const&, binary_operator, - * data_type, rmm::cuda_stream_view, rmm::device_async_resource_ref) + * data_type, cuda::stream_ref, rmm::device_async_resource_ref) */ std::unique_ptr binary_operation(column_view const& lhs, scalar const& rhs, binary_operator op, data_type output_type, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** * @copydoc cudf::binary_operation(column_view const&, column_view const&, - * binary_operator, data_type, rmm::cuda_stream_view, rmm::device_async_resource_ref) + * binary_operator, data_type, cuda::stream_ref, rmm::device_async_resource_ref) */ std::unique_ptr binary_operation(column_view const& lhs, column_view const& rhs, binary_operator op, data_type output_type, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); } // namespace detail } // namespace cudf diff --git a/cpp/include/cudf/detail/groupby.hpp b/cpp/include/cudf/detail/groupby.hpp index 687a6957d713..85c9e395379f 100644 --- a/cpp/include/cudf/detail/groupby.hpp +++ b/cpp/include/cudf/detail/groupby.hpp @@ -9,7 +9,7 @@ #include #include -#include +#include #include #include @@ -32,7 +32,7 @@ std::pair, std::vector> groupby( table_view const& keys, std::span requests, null_policy include_null_keys, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); } // namespace groupby::detail::hash } // namespace cudf diff --git a/cpp/include/cudf/detail/groupby/group_replace_nulls.hpp b/cpp/include/cudf/detail/groupby/group_replace_nulls.hpp index eeb78e32f393..c029e0888385 100644 --- a/cpp/include/cudf/detail/groupby/group_replace_nulls.hpp +++ b/cpp/include/cudf/detail/groupby/group_replace_nulls.hpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -30,7 +30,7 @@ namespace detail { std::unique_ptr group_replace_nulls(cudf::column_view const& grouped_value, device_span group_labels, cudf::replace_policy replace_policy, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); } // namespace detail diff --git a/cpp/include/cudf/detail/groupby/sort_helper.hpp b/cpp/include/cudf/detail/groupby/sort_helper.hpp index e4b8cee8433a..71b9a6a00da2 100644 --- a/cpp/include/cudf/detail/groupby/sort_helper.hpp +++ b/cpp/include/cudf/detail/groupby/sort_helper.hpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -11,9 +11,10 @@ #include #include -#include #include +#include + namespace cudf { namespace groupby::detail::sort { /** @@ -76,7 +77,7 @@ struct sort_groupby_helper { * @return the sorted and grouped column */ std::unique_ptr sorted_values(column_view const& values, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -92,7 +93,7 @@ struct sort_groupby_helper { * @return the grouped column */ std::unique_ptr grouped_values(column_view const& values, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -100,21 +101,19 @@ struct sort_groupby_helper { * * @return a new table in which each row is a unique row in the sorted key table. */ - std::unique_ptr unique_keys(rmm::cuda_stream_view stream, - rmm::device_async_resource_ref mr); + std::unique_ptr
unique_keys(cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** * @brief Get a table of sorted keys * * @return a new table containing the sorted keys. */ - std::unique_ptr
sorted_keys(rmm::cuda_stream_view stream, - rmm::device_async_resource_ref mr); + std::unique_ptr
sorted_keys(cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** * @brief Get the number of groups in `keys` */ - size_type num_groups(rmm::cuda_stream_view stream) { return group_offsets(stream).size() - 1; } + size_type num_groups(cuda::stream_ref stream) { return group_offsets(stream).size() - 1; } /** * @brief check if the groupby keys are presorted @@ -128,7 +127,7 @@ struct sort_groupby_helper { * When include_null_keys = NO, returned value is the number of rows in `keys` * in which no element is null */ - size_type num_keys(rmm::cuda_stream_view stream); + size_type num_keys(cuda::stream_ref stream); /** * @brief Get the sorted order of `keys`. @@ -143,7 +142,7 @@ struct sort_groupby_helper { * * @return the sort order indices for `keys`. */ - column_view key_sort_order(rmm::cuda_stream_view stream); + column_view key_sort_order(cuda::stream_ref stream); /** * @brief Get each group's offset into the sorted order of `keys`. @@ -156,7 +155,7 @@ struct sort_groupby_helper { * @return vector of offsets of the starting point of each group in the sorted * key table */ - index_vector const& group_offsets(rmm::cuda_stream_view stream); + index_vector const& group_offsets(cuda::stream_ref stream); /** * @brief Get the group labels corresponding to the sorted order of `keys`. @@ -171,7 +170,7 @@ struct sort_groupby_helper { * * @return vector of group labels for each row in the sorted key column */ - index_vector const& group_labels(rmm::cuda_stream_view stream); + index_vector const& group_labels(cuda::stream_ref stream); private: /** @@ -188,7 +187,7 @@ struct sort_groupby_helper { * @return A nullable column of `INT32` containing group labels in the order * of the unsorted key table */ - column_view unsorted_keys_labels(rmm::cuda_stream_view stream); + column_view unsorted_keys_labels(cuda::stream_ref stream); /** * @brief Get the column representing the row bitmask for the `keys` @@ -202,7 +201,7 @@ struct sort_groupby_helper { * Computes and stores bitmask on first invocation and returns stored column * on subsequent calls. */ - column_view keys_bitmask_column(rmm::cuda_stream_view stream); + column_view keys_bitmask_column(cuda::stream_ref stream); column_ptr _key_sorted_order; ///< Indices to produce _keys in sorted order column_ptr _unsorted_keys_labels; ///< Group labels for unsorted _keys diff --git a/cpp/include/cudf/detail/join/distinct_hash_join.cuh b/cpp/include/cudf/detail/join/distinct_hash_join.cuh index 9aedb49749f4..bcaacdc8457a 100644 --- a/cpp/include/cudf/detail/join/distinct_hash_join.cuh +++ b/cpp/include/cudf/detail/join/distinct_hash_join.cuh @@ -8,11 +8,11 @@ #include #include -#include #include #include #include +#include #include #include @@ -115,11 +115,11 @@ class distinct_hash_join { */ distinct_hash_join(cudf::table_view const& right, cudf::null_equality compare_nulls, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, cuda::mr::any_resource mr); /** - * @copydoc distinct_hash_join(cudf::table_view const&, null_equality, rmm::cuda_stream_view, + * @copydoc distinct_hash_join(cudf::table_view const&, null_equality, cuda::stream_ref, * cuda::mr::any_resource) * * @param load_factor The hash table occupancy ratio in (0,1]. A value of 0.5 means 50% occupancy. @@ -127,7 +127,7 @@ class distinct_hash_join { distinct_hash_join(cudf::table_view const& right, cudf::null_equality compare_nulls, double load_factor, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, cuda::mr::any_resource mr); /** @@ -136,16 +136,14 @@ class distinct_hash_join { std::pair>, std::unique_ptr>> inner_join(cudf::table_view const& left, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const; /** * @copydoc cudf::distinct_hash_join::left_join */ std::unique_ptr> left_join( - cudf::table_view const& left, - rmm::cuda_stream_view stream, - rmm::device_async_resource_ref mr) const; + cudf::table_view const& left, cuda::stream_ref stream, rmm::device_async_resource_ref mr) const; private: using probing_scheme_type = cuco::linear_probing<1, hasher>; diff --git a/cpp/include/cudf/detail/join/filtered_join.cuh b/cpp/include/cudf/detail/join/filtered_join.cuh index 1206857b684f..0f886217a076 100644 --- a/cpp/include/cudf/detail/join/filtered_join.cuh +++ b/cpp/include/cudf/detail/join/filtered_join.cuh @@ -11,7 +11,6 @@ #include #include -#include #include #include #include @@ -21,6 +20,7 @@ #include #include #include +#include #include #include @@ -135,26 +135,26 @@ class filtered_join { filtered_join(cudf::table_view const& right, cudf::null_equality compare_nulls, double load_factor, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, cuda::mr::any_resource mr); /** * @brief Returns indices of left table rows that have matching keys in the right table */ std::unique_ptr> semi_join( - cudf::table_view const& left, rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr); + cudf::table_view const& left, cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** * @brief Returns indices of left table rows that do not have matching keys in the right table */ std::unique_ptr> anti_join( - cudf::table_view const& left, rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr); + cudf::table_view const& left, cuda::stream_ref stream, rmm::device_async_resource_ref mr); private: std::unique_ptr> semi_anti_join( cudf::table_view const& left, join_kind kind, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); // Queries the hash table for every left row and writes the matches to contains_map. @@ -163,25 +163,25 @@ class filtered_join { Iterator left_iter, Ref query_ref, cudf::device_span contains_map, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); void query_right_table_primitive( cudf::table_view const& left, std::shared_ptr const& preprocessed_left, cudf::device_span contains_map, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); void query_right_table_flat( cudf::table_view const& left, std::shared_ptr const& preprocessed_left, cudf::device_span contains_map, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); void query_right_table_nested( cudf::table_view const& left, std::shared_ptr const& preprocessed_left, cudf::device_span contains_map, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); enum class row_operator_mode : uint8_t { PRIMITIVE, FLAT, NESTED }; @@ -212,13 +212,13 @@ class filtered_join { // Build and probe row operators must use matching nullate modes. Since probe nullability is // unknown at build time, primitive paths use DYNAMIC true and other paths use YES. - void insert_right_table_primitive(rmm::cuda_stream_view stream); + void insert_right_table_primitive(cuda::stream_ref stream); // Populates the hash table from the right-row iterator. template - void insert_right_table(Iterator right_iter, Ref const& insert_ref, rmm::cuda_stream_view stream); + void insert_right_table(Iterator right_iter, Ref const& insert_ref, cuda::stream_ref stream); - void insert_right_table_flat(rmm::cuda_stream_view stream); - void insert_right_table_nested(rmm::cuda_stream_view stream); + void insert_right_table_flat(cuda::stream_ref stream); + void insert_right_table_nested(cuda::stream_ref stream); /** * @brief Calculates the required storage size for the hash table diff --git a/cpp/include/cudf/detail/join/hash_join.hpp b/cpp/include/cudf/detail/join/hash_join.hpp index b3f5f8f5a39a..fc32d86c0e5d 100644 --- a/cpp/include/cudf/detail/join/hash_join.hpp +++ b/cpp/include/cudf/detail/join/hash_join.hpp @@ -13,10 +13,11 @@ #include #include -#include #include #include +#include + #include #include #include @@ -64,11 +65,11 @@ class hash_join { hash_join(cudf::table_view const& right, bool has_nulls, cudf::null_equality compare_nulls, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, cuda::mr::any_resource mr); /** - * @copydoc hash_join(cudf::table_view const&, bool, null_equality, rmm::cuda_stream_view, + * @copydoc hash_join(cudf::table_view const&, bool, null_equality, cuda::stream_ref, * cuda::mr::any_resource) * * @param load_factor The hash table occupancy ratio in (0,1]. A value of 0.5 means 50% occupancy. @@ -77,7 +78,7 @@ class hash_join { bool has_nulls, cudf::null_equality compare_nulls, double load_factor, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, cuda::mr::any_resource mr); /** @@ -87,7 +88,7 @@ class hash_join { std::unique_ptr>> inner_join(cudf::table_view const& left, std::optional output_size, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const; /** @@ -97,7 +98,7 @@ class hash_join { std::unique_ptr>> left_join(cudf::table_view const& left, std::optional output_size, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const; /** @@ -107,51 +108,45 @@ class hash_join { std::unique_ptr>> full_join(cudf::table_view const& left, std::optional output_size, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const; /** * @copydoc cudf::hash_join::inner_join_size */ [[nodiscard]] std::size_t inner_join_size(cudf::table_view const& left, - rmm::cuda_stream_view stream) const; + cuda::stream_ref stream) const; /** * @copydoc cudf::hash_join::left_join_size */ [[nodiscard]] std::size_t left_join_size(cudf::table_view const& left, - rmm::cuda_stream_view stream) const; + cuda::stream_ref stream) const; /** * @copydoc cudf::hash_join::full_join_size */ [[nodiscard]] std::size_t full_join_size(cudf::table_view const& left, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const; /** * @copydoc cudf::hash_join::inner_join_match_context */ [[nodiscard]] cudf::join_match_context inner_join_match_context( - cudf::table_view const& left, - rmm::cuda_stream_view stream, - rmm::device_async_resource_ref mr) const; + cudf::table_view const& left, cuda::stream_ref stream, rmm::device_async_resource_ref mr) const; /** * @copydoc cudf::hash_join::left_join_match_context */ [[nodiscard]] cudf::join_match_context left_join_match_context( - cudf::table_view const& left, - rmm::cuda_stream_view stream, - rmm::device_async_resource_ref mr) const; + cudf::table_view const& left, cuda::stream_ref stream, rmm::device_async_resource_ref mr) const; /** * @copydoc cudf::hash_join::full_join_match_context */ [[nodiscard]] cudf::join_match_context full_join_match_context( - cudf::table_view const& left, - rmm::cuda_stream_view stream, - rmm::device_async_resource_ref mr) const; + cudf::table_view const& left, cuda::stream_ref stream, rmm::device_async_resource_ref mr) const; /** * @copydoc cudf::hash_join::partitioned_inner_join @@ -159,7 +154,7 @@ class hash_join { [[nodiscard]] std::pair>, std::unique_ptr>> partitioned_inner_join(cudf::join_partition_context const& context, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const; /** @@ -168,7 +163,7 @@ class hash_join { [[nodiscard]] std::pair>, std::unique_ptr>> partitioned_left_join(cudf::join_partition_context const& context, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const; /** @@ -177,7 +172,7 @@ class hash_join { [[nodiscard]] std::pair>, std::unique_ptr>> partitioned_full_join(cudf::join_partition_context const& context, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const; private: @@ -192,14 +187,14 @@ class hash_join { [[nodiscard]] std::unique_ptr> make_match_counts( join_kind join, cudf::table_view const& left, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const; [[nodiscard]] std::pair>, std::unique_ptr>> partitioned_join_retrieve(join_kind join, cudf::join_partition_context const& context, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const; template @@ -207,16 +202,15 @@ class hash_join { std::unique_ptr>> join_retrieve(cudf::table_view const& probe, std::optional output_size, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const; template - [[nodiscard]] std::size_t join_size(cudf::table_view const& left, - rmm::cuda_stream_view stream) const; + [[nodiscard]] std::size_t join_size(cudf::table_view const& left, cuda::stream_ref stream) const; template [[nodiscard]] std::size_t join_size(cudf::table_view const& left, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const; }; diff --git a/cpp/include/cudf/detail/join/join.hpp b/cpp/include/cudf/detail/join/join.hpp index 92d43eb055a7..227ac6024bc2 100644 --- a/cpp/include/cudf/detail/join/join.hpp +++ b/cpp/include/cudf/detail/join/join.hpp @@ -10,10 +10,11 @@ #include #include -#include #include #include +#include + #include #include #include @@ -44,7 +45,7 @@ filter_join_indices(table_view const& left, ast::expression const& predicate, join_kind join_kind, std::optional output_size, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); } // namespace detail diff --git a/cpp/include/cudf/detail/rolling.hpp b/cpp/include/cudf/detail/rolling.hpp index 4e1c0f801ec1..a962361d64f0 100644 --- a/cpp/include/cudf/detail/rolling.hpp +++ b/cpp/include/cudf/detail/rolling.hpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -11,7 +11,7 @@ #include #include -#include +#include #include @@ -49,7 +49,7 @@ struct preprocessed_group_info { [[nodiscard]] rmm::device_uvector nulls_per_group( column_view const& orderby, rmm::device_uvector const& offsets, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); /** * @copydoc std::unique_ptr rolling_window( @@ -67,7 +67,7 @@ std::unique_ptr rolling_window(column_view const& input, column_view const& following_window, size_type min_periods, rolling_aggregation const& agg, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -96,7 +96,7 @@ std::unique_ptr rolling_window(column_view const& input, order order, null_order null_order, range_window_type window, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); } // namespace detail diff --git a/cpp/include/cudf/detail/scan.hpp b/cpp/include/cudf/detail/scan.hpp index 07ead00074a5..182446e0aa6b 100644 --- a/cpp/include/cudf/detail/scan.hpp +++ b/cpp/include/cudf/detail/scan.hpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ #pragma once @@ -8,7 +8,7 @@ #include #include -#include +#include namespace cudf { namespace detail { @@ -39,7 +39,7 @@ namespace detail { std::unique_ptr scan_exclusive(column_view const& input, scan_aggregation const& agg, null_policy null_handling, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -65,7 +65,7 @@ std::unique_ptr scan_exclusive(column_view const& input, std::unique_ptr scan_inclusive(column_view const& input, scan_aggregation const& agg, null_policy null_handling, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -77,7 +77,7 @@ std::unique_ptr scan_inclusive(column_view const& input, * @return rank values. */ std::unique_ptr inclusive_rank_scan(column_view const& order_by, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -90,7 +90,7 @@ std::unique_ptr inclusive_rank_scan(column_view const& order_by, */ CUDF_EXPORT std::unique_ptr inclusive_dense_rank_scan(column_view const& order_by, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -104,7 +104,7 @@ std::unique_ptr inclusive_dense_rank_scan(column_view const& order_by, * @return rank values. */ std::unique_ptr inclusive_one_normalized_percent_rank_scan( - column_view const& order_by, rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr); + column_view const& order_by, cuda::stream_ref stream, rmm::device_async_resource_ref mr); } // namespace detail } // namespace cudf diff --git a/cpp/include/cudf/detail/scatter.hpp b/cpp/include/cudf/detail/scatter.hpp index f56424c298a6..7045aea44c3a 100644 --- a/cpp/include/cudf/detail/scatter.hpp +++ b/cpp/include/cudf/detail/scatter.hpp @@ -58,7 +58,7 @@ std::unique_ptr
scatter(table_view const& source, /** * @copydoc cudf::detail::scatter(table_view const&,column_view const&,table_view - * const&,bool,cuda::stream_ref,rmm::device_async_resource_ref) + * const&,cuda::stream_ref,rmm::device_async_resource_ref) * * @throws cudf::logic_error if `scatter_map` span size is larger than max of `size_type`. */ diff --git a/cpp/include/cudf/detail/sorting.hpp b/cpp/include/cudf/detail/sorting.hpp index aa2aeeb25dca..9c5e8dc4af07 100644 --- a/cpp/include/cudf/detail/sorting.hpp +++ b/cpp/include/cudf/detail/sorting.hpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -10,7 +10,7 @@ #include #include -#include +#include #include #include @@ -26,7 +26,7 @@ namespace detail { std::unique_ptr sorted_order(table_view const& input, std::vector const& column_order, std::vector const& null_precedence, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -37,7 +37,7 @@ std::unique_ptr sorted_order(table_view const& input, std::unique_ptr stable_sorted_order(table_view const& input, std::vector const& column_order, std::vector const& null_precedence, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -49,7 +49,7 @@ std::unique_ptr
sort_by_key(table_view const& values, table_view const& keys, std::vector const& column_order, std::vector const& null_precedence, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -63,7 +63,7 @@ std::unique_ptr rank(column_view const& input, null_policy null_handling, null_order null_precedence, bool percentage, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -75,7 +75,7 @@ std::unique_ptr
stable_sort_by_key(table_view const& values, table_view const& keys, std::vector const& column_order, std::vector const& null_precedence, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -87,7 +87,7 @@ std::unique_ptr segmented_sorted_order(table_view const& keys, column_view const& segment_offsets, std::vector const& column_order, std::vector const& null_precedence, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -100,7 +100,7 @@ std::unique_ptr stable_segmented_sorted_order( column_view const& segment_offsets, std::vector const& column_order, std::vector const& null_precedence, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -113,7 +113,7 @@ std::unique_ptr
segmented_sort_by_key(table_view const& values, column_view const& segment_offsets, std::vector const& column_order, std::vector const& null_precedence, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -126,7 +126,7 @@ std::unique_ptr
stable_segmented_sort_by_key(table_view const& values, column_view const& segment_offsets, std::vector const& column_order, std::vector const& null_precedence, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -137,7 +137,7 @@ std::unique_ptr
stable_segmented_sort_by_key(table_view const& values, std::unique_ptr
sort(table_view const& values, std::vector const& column_order, std::vector const& null_precedence, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -148,7 +148,7 @@ std::unique_ptr
sort(table_view const& values, std::unique_ptr
stable_sort(table_view const& values, std::vector const& column_order, std::vector const& null_precedence, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -159,7 +159,7 @@ std::unique_ptr segmented_top_k(column_view const& col, column_view const& segment_offsets, size_type k, order topk_order, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); } // namespace detail diff --git a/cpp/include/cudf/detail/transform.hpp b/cpp/include/cudf/detail/transform.hpp index d561f24c9e90..f6fd1ca386c7 100644 --- a/cpp/include/cudf/detail/transform.hpp +++ b/cpp/include/cudf/detail/transform.hpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -11,7 +11,7 @@ #include #include -#include +#include namespace cudf { namespace detail { @@ -23,7 +23,7 @@ namespace detail { */ std::unique_ptr compute_column(table_view const& table, ast::expression const& expr, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -32,7 +32,7 @@ std::unique_ptr compute_column(table_view const& table, * @param stream CUDA stream used for device memory operations and kernel launches. */ std::pair, cudf::size_type> bools_to_mask( - column_view const& input, rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr); + column_view const& input, cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** * @copydoc cudf::encode @@ -40,7 +40,7 @@ std::pair, cudf::size_type> bools_to_mask( * @param stream CUDA stream used for device memory operations and kernel launches. */ std::pair, std::unique_ptr> encode( - cudf::table_view const& input, rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr); + cudf::table_view const& input, cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** * @copydoc cudf::one_hot_encode @@ -49,7 +49,7 @@ std::pair, std::unique_ptr> encode( */ std::pair, table_view> one_hot_encode(column_view const& input, column_view const& categories, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -60,7 +60,7 @@ std::pair, table_view> one_hot_encode(column_view const& std::unique_ptr mask_to_bools(bitmask_type const* null_mask, size_type begin_bit, size_type end_bit, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -69,7 +69,7 @@ std::unique_ptr mask_to_bools(bitmask_type const* null_mask, * @param stream CUDA stream used for device memory operations and kernel launches. */ std::unique_ptr row_bit_count(table_view const& t, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -79,7 +79,7 @@ std::unique_ptr row_bit_count(table_view const& t, */ std::unique_ptr segmented_row_bit_count(table_view const& t, size_type segment_length, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); } // namespace detail diff --git a/cpp/include/cudf/detail/unary.hpp b/cpp/include/cudf/detail/unary.hpp index e55ccfb16aea..fd86d4d897e3 100644 --- a/cpp/include/cudf/detail/unary.hpp +++ b/cpp/include/cudf/detail/unary.hpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2018-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2018-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -10,7 +10,7 @@ #include #include -#include +#include namespace cudf { namespace detail { @@ -20,14 +20,14 @@ namespace detail { */ std::unique_ptr unary_operation(cudf::column_view const& input, cudf::unary_operator op, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** * @copydoc cudf::is_valid */ std::unique_ptr is_valid(cudf::column_view const& input, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -35,21 +35,21 @@ std::unique_ptr is_valid(cudf::column_view const& input, */ std::unique_ptr cast(column_view const& input, data_type type, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** * @copydoc cudf::is_nan */ std::unique_ptr is_nan(cudf::column_view const& input, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** * @copydoc cudf::is_not_nan */ std::unique_ptr is_not_nan(cudf::column_view const& input, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); } // namespace detail diff --git a/cpp/include/cudf/groupby.hpp b/cpp/include/cudf/groupby.hpp index fb8e06170625..a5d3a49893c8 100644 --- a/cpp/include/cudf/groupby.hpp +++ b/cpp/include/cudf/groupby.hpp @@ -14,7 +14,7 @@ #include #include -#include +#include #include #include @@ -180,7 +180,7 @@ class groupby { */ std::pair, std::vector> aggregate( std::span requests, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** * @brief Performs grouped scans on the specified values. @@ -236,7 +236,7 @@ class groupby { */ std::pair, std::vector> scan( std::span requests, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -294,7 +294,7 @@ class groupby { table_view const& values, std::span offsets, std::vector> const& fill_values, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -325,7 +325,7 @@ class groupby { * @return A `groups` object representing grouped keys and values */ groups get_groups(cudf::table_view values = {}, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -367,7 +367,7 @@ class groupby { std::pair, std::unique_ptr
> replace_nulls( table_view const& values, std::span replace_policies, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); private: @@ -398,18 +398,18 @@ class groupby { */ std::pair, std::vector> dispatch_aggregation( std::span requests, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); // Sort-based groupby std::pair, std::vector> sort_aggregate( std::span requests, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); std::pair, std::vector> sort_scan( std::span requests, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); }; @@ -525,7 +525,7 @@ class streaming_groupby { * @throws std::invalid_argument if `data.num_rows()` exceeds `max_distinct_keys` * @throws cudf::logic_error if cumulative distinct keys exceed `max_distinct_keys` */ - void aggregate(table_view const& data, rmm::cuda_stream_view stream = cudf::get_default_stream()); + void aggregate(table_view const& data, cuda::stream_ref stream = cudf::get_default_stream()); /** * @brief Merge another streaming_groupby's accumulated partial state into this one. @@ -543,8 +543,7 @@ class streaming_groupby { * @throws cudf::logic_error if this object has not been initialized via `aggregate()` * @throws cudf::logic_error if distinct keys exceed `max_distinct_keys` after merge */ - void merge(streaming_groupby const& other, - rmm::cuda_stream_view stream = cudf::get_default_stream()); + void merge(streaming_groupby const& other, cuda::stream_ref stream = cudf::get_default_stream()); /** * @brief Finalize the accumulated partial aggregates into final results. @@ -562,7 +561,7 @@ class streaming_groupby { * @throws cudf::logic_error if no data has been accumulated */ [[nodiscard]] std::pair, std::vector> finalize( - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()) const; /** @@ -578,10 +577,10 @@ class streaming_groupby { struct impl; std::unique_ptr _impl; - void do_aggregate(table_view const& data, rmm::cuda_stream_view stream); - void do_merge(streaming_groupby const& other, rmm::cuda_stream_view stream); + void do_aggregate(table_view const& data, cuda::stream_ref stream); + void do_merge(streaming_groupby const& other, cuda::stream_ref stream); [[nodiscard]] std::pair, std::vector> do_finalize( - rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr) const; + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const; }; /** diff --git a/cpp/include/cudf/join/conditional_join.hpp b/cpp/include/cudf/join/conditional_join.hpp index dff1504f0d98..a9d9a19ade5f 100644 --- a/cpp/include/cudf/join/conditional_join.hpp +++ b/cpp/include/cudf/join/conditional_join.hpp @@ -13,9 +13,10 @@ #include #include -#include #include +#include + #include #include @@ -73,7 +74,7 @@ conditional_inner_join(table_view const& left, table_view const& right, ast::expression const& binary_predicate, std::optional output_size = {}, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -120,7 +121,7 @@ conditional_left_join(table_view const& left, table_view const& right, ast::expression const& binary_predicate, std::optional output_size = {}, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -164,7 +165,7 @@ std::pair>, conditional_full_join(table_view const& left, table_view const& right, ast::expression const& binary_predicate, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -205,7 +206,7 @@ std::unique_ptr> conditional_left_semi_join( table_view const& right, ast::expression const& binary_predicate, std::optional output_size = {}, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -246,7 +247,7 @@ std::unique_ptr> conditional_left_anti_join( table_view const& right, ast::expression const& binary_predicate, std::optional output_size = {}, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -271,7 +272,7 @@ std::size_t conditional_inner_join_size( table_view const& left, table_view const& right, ast::expression const& binary_predicate, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -296,7 +297,7 @@ std::size_t conditional_left_join_size( table_view const& left, table_view const& right, ast::expression const& binary_predicate, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -321,7 +322,7 @@ std::size_t conditional_left_semi_join_size( table_view const& left, table_view const& right, ast::expression const& binary_predicate, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -346,7 +347,7 @@ std::size_t conditional_left_anti_join_size( table_view const& left, table_view const& right, ast::expression const& binary_predicate, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @} */ // end of group diff --git a/cpp/include/cudf/join/direct_join.hpp b/cpp/include/cudf/join/direct_join.hpp index 677b0210a24b..f82d368d9542 100644 --- a/cpp/include/cudf/join/direct_join.hpp +++ b/cpp/include/cudf/join/direct_join.hpp @@ -11,9 +11,10 @@ #include #include -#include #include +#include + #include #include @@ -58,7 +59,7 @@ namespace CUDF_EXPORT cudf { direct_inner_join(column_view const& left_keys, column_view const& right_keys, std::size_t capacity, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @} */ // end of group diff --git a/cpp/include/cudf/join/distinct_hash_join.hpp b/cpp/include/cudf/join/distinct_hash_join.hpp index 326d9cbb3626..c88f8de40742 100644 --- a/cpp/include/cudf/join/distinct_hash_join.hpp +++ b/cpp/include/cudf/join/distinct_hash_join.hpp @@ -12,9 +12,10 @@ #include #include -#include #include +#include + #include /** @@ -71,9 +72,9 @@ class distinct_hash_join { * @param mr Device memory resource used to allocate the internal hash table */ distinct_hash_join(cudf::table_view const& right, - null_equality compare_nulls = null_equality::EQUAL, - double load_factor = 0.5, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + null_equality compare_nulls = null_equality::EQUAL, + double load_factor = 0.5, + cuda::stream_ref stream = cudf::get_default_stream(), cuda::mr::any_resource mr = cudf::get_current_device_resource_ref()); @@ -92,7 +93,7 @@ class distinct_hash_join { [[nodiscard]] std::pair>, std::unique_ptr>> inner_join(cudf::table_view const& left, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()) const; /** @@ -114,7 +115,7 @@ class distinct_hash_join { */ [[nodiscard]] std::unique_ptr> left_join( cudf::table_view const& left, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()) const; private: diff --git a/cpp/include/cudf/join/filtered_join.hpp b/cpp/include/cudf/join/filtered_join.hpp index a8c23cf1397a..3c1738afd579 100644 --- a/cpp/include/cudf/join/filtered_join.hpp +++ b/cpp/include/cudf/join/filtered_join.hpp @@ -11,9 +11,10 @@ #include #include -#include #include +#include + /** * @file * @brief Class definition for filtered hash join, which builds a hash table from a filter table @@ -70,7 +71,7 @@ class filtered_join { */ filtered_join(cudf::table_view const& right, cudf::null_equality compare_nulls, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, cuda::mr::any_resource mr = cudf::get_current_device_resource_ref()); @@ -93,7 +94,7 @@ class filtered_join { filtered_join(cudf::table_view const& right, cudf::null_equality compare_nulls, double load_factor, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, cuda::mr::any_resource mr = cudf::get_current_device_resource_ref()); @@ -119,7 +120,7 @@ class filtered_join { */ [[nodiscard]] std::unique_ptr> semi_join( cudf::table_view const& left, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()) const; /** @@ -144,7 +145,7 @@ class filtered_join { */ [[nodiscard]] std::unique_ptr> anti_join( cudf::table_view const& left, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()) const; private: diff --git a/cpp/include/cudf/join/hash_join.hpp b/cpp/include/cudf/join/hash_join.hpp index 6f796546961d..e527a856039f 100644 --- a/cpp/include/cudf/join/hash_join.hpp +++ b/cpp/include/cudf/join/hash_join.hpp @@ -14,9 +14,10 @@ #include #include -#include #include +#include + #include #include @@ -94,7 +95,7 @@ class hash_join { */ hash_join(cudf::table_view const& right, null_equality compare_nulls, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), cuda::mr::any_resource mr = cudf::get_current_device_resource_ref()); @@ -120,7 +121,7 @@ class hash_join { nullable_join has_nulls, null_equality compare_nulls, double load_factor, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), cuda::mr::any_resource mr = cudf::get_current_device_resource_ref()); @@ -146,7 +147,7 @@ class hash_join { std::unique_ptr>> inner_join(cudf::table_view const& left, std::optional output_size = {}, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()) const; /** @@ -171,7 +172,7 @@ class hash_join { std::unique_ptr>> left_join(cudf::table_view const& left, std::optional output_size = {}, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()) const; /** @@ -196,7 +197,7 @@ class hash_join { std::unique_ptr>> full_join(cudf::table_view const& left, std::optional output_size = {}, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()) const; /** @@ -213,7 +214,7 @@ class hash_join { * `left` and `right` as the join keys . */ [[nodiscard]] std::size_t inner_join_size( - cudf::table_view const& left, rmm::cuda_stream_view stream = cudf::get_default_stream()) const; + cudf::table_view const& left, cuda::stream_ref stream = cudf::get_default_stream()) const; /** * Returns the exact number of matches (rows) when performing a left join with the specified left @@ -229,7 +230,7 @@ class hash_join { * and `right` as the join keys . */ [[nodiscard]] std::size_t left_join_size( - cudf::table_view const& left, rmm::cuda_stream_view stream = cudf::get_default_stream()) const; + cudf::table_view const& left, cuda::stream_ref stream = cudf::get_default_stream()) const; /** * Returns the exact number of matches (rows) when performing a full join with the specified left @@ -248,7 +249,7 @@ class hash_join { */ [[nodiscard]] std::size_t full_join_size( cudf::table_view const& left, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()) const; /** @@ -274,7 +275,7 @@ class hash_join { */ [[nodiscard]] cudf::join_match_context inner_join_match_context( cudf::table_view const& left, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()) const; /** @@ -299,7 +300,7 @@ class hash_join { */ [[nodiscard]] cudf::join_match_context left_join_match_context( cudf::table_view const& left, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()) const; /** @@ -324,7 +325,7 @@ class hash_join { */ [[nodiscard]] cudf::join_match_context full_join_match_context( cudf::table_view const& left, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()) const; /** @@ -351,7 +352,7 @@ class hash_join { std::unique_ptr>> partitioned_inner_join( cudf::join_partition_context const& context, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()) const; /** @@ -377,7 +378,7 @@ class hash_join { std::unique_ptr>> partitioned_left_join( cudf::join_partition_context const& context, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()) const; /** @@ -407,7 +408,7 @@ class hash_join { std::unique_ptr>> partitioned_full_join( cudf::join_partition_context const& context, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()) const; /** @@ -436,7 +437,7 @@ class hash_join { cudf::host_span const> right_partials, size_type left_table_num_rows, size_type right_table_num_rows, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); private: diff --git a/cpp/include/cudf/join/join.hpp b/cpp/include/cudf/join/join.hpp index a66697ef48fd..adc2358ca6fb 100644 --- a/cpp/include/cudf/join/join.hpp +++ b/cpp/include/cudf/join/join.hpp @@ -12,10 +12,10 @@ #include #include -#include #include #include +#include #include #include @@ -162,7 +162,7 @@ std::pair>, inner_join(cudf::table_view const& left_keys, cudf::table_view const& right_keys, null_equality compare_nulls = null_equality::EQUAL, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -203,7 +203,7 @@ std::pair>, left_join(cudf::table_view const& left_keys, cudf::table_view const& right_keys, null_equality compare_nulls = null_equality::EQUAL, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -244,7 +244,7 @@ std::pair>, full_join(cudf::table_view const& left_keys, cudf::table_view const& right_keys, null_equality compare_nulls = null_equality::EQUAL, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -278,7 +278,7 @@ full_join(cudf::table_view const& left_keys, std::unique_ptr cross_join( cudf::table_view const& left, cudf::table_view const& right, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -362,7 +362,7 @@ filter_join_indices(cudf::table_view const& left, cudf::ast::expression const& predicate, cudf::join_kind join_kind, std::optional output_size = std::nullopt, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -408,7 +408,7 @@ filter_join_indices_output_size( cudf::device_span right_indices, cudf::ast::expression const& predicate, cudf::join_kind join_kind, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -483,7 +483,7 @@ filter_join_indices_jit( std::string const& predicate_code, cudf::join_kind join_kind, bool is_ptx = false, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -511,7 +511,7 @@ filter_join_indices_jit( cudf::device_span right_indices, cudf::ast::expression const& predicate, cudf::join_kind join_kind, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @} */ // end of group diff --git a/cpp/include/cudf/join/key_remapping.hpp b/cpp/include/cudf/join/key_remapping.hpp index e2b949ab8a5f..5eef4139571a 100644 --- a/cpp/include/cudf/join/key_remapping.hpp +++ b/cpp/include/cudf/join/key_remapping.hpp @@ -12,7 +12,7 @@ #include #include -#include +#include #include @@ -101,7 +101,7 @@ class key_remapping { key_remapping(cudf::table_view const& right, null_equality compare_nulls = null_equality::EQUAL, cudf::compute_metrics metrics = cudf::compute_metrics::YES, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), cuda::mr::any_resource mr = cudf::get_current_device_resource_ref()); @@ -121,7 +121,7 @@ class key_remapping { * @return A column of INT32 values with the remapped key IDs */ [[nodiscard]] std::unique_ptr remap_right_keys( - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()) const; /** @@ -143,7 +143,7 @@ class key_remapping { */ [[nodiscard]] std::unique_ptr remap_left_keys( cudf::table_view const& keys, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()) const; /** diff --git a/cpp/include/cudf/join/mark_join.hpp b/cpp/include/cudf/join/mark_join.hpp index e24f7ed07625..e1d88219e1c8 100644 --- a/cpp/include/cudf/join/mark_join.hpp +++ b/cpp/include/cudf/join/mark_join.hpp @@ -12,9 +12,10 @@ #include #include -#include #include +#include + #include /** @@ -83,7 +84,7 @@ class mark_join { mark_join(cudf::table_view const& left, cudf::null_equality compare_nulls, cudf::join_prefilter prefilter, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), cuda::mr::any_resource mr = cudf::get_current_device_resource_ref()); @@ -104,7 +105,7 @@ class mark_join { double load_factor, cudf::null_equality compare_nulls = cudf::null_equality::EQUAL, cudf::join_prefilter prefilter = cudf::join_prefilter::NO, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), cuda::mr::any_resource mr = cudf::get_current_device_resource_ref()); @@ -118,7 +119,7 @@ class mark_join { */ [[nodiscard]] std::unique_ptr> semi_join( cudf::table_view const& right, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()) const; /** @@ -131,7 +132,7 @@ class mark_join { */ [[nodiscard]] std::unique_ptr> anti_join( cudf::table_view const& right, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()) const; private: diff --git a/cpp/include/cudf/join/mixed_join.hpp b/cpp/include/cudf/join/mixed_join.hpp index 48ee23b2037f..52d5f4d45818 100644 --- a/cpp/include/cudf/join/mixed_join.hpp +++ b/cpp/include/cudf/join/mixed_join.hpp @@ -13,9 +13,10 @@ #include #include -#include #include +#include + #include #include @@ -96,7 +97,7 @@ mixed_inner_join(table_view const& left_equality, ast::expression const& binary_predicate, null_equality compare_nulls = null_equality::EQUAL, output_size_data_type output_size_data = {}, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -157,7 +158,7 @@ mixed_left_join(table_view const& left_equality, ast::expression const& binary_predicate, null_equality compare_nulls = null_equality::EQUAL, output_size_data_type output_size_data = {}, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -218,7 +219,7 @@ mixed_full_join(table_view const& left_equality, ast::expression const& binary_predicate, null_equality compare_nulls = null_equality::EQUAL, output_size_data_type output_size_data = {}, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -265,7 +266,7 @@ std::unique_ptr> mixed_left_semi_join( table_view const& right_conditional, ast::expression const& binary_predicate, null_equality compare_nulls = null_equality::EQUAL, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -313,7 +314,7 @@ std::unique_ptr> mixed_left_anti_join( table_view const& right_conditional, ast::expression const& binary_predicate, null_equality compare_nulls = null_equality::EQUAL, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -355,7 +356,7 @@ std::pair>> mixed_in table_view const& right_conditional, ast::expression const& binary_predicate, null_equality compare_nulls = null_equality::EQUAL, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -397,7 +398,7 @@ std::pair>> mixed_le table_view const& right_conditional, ast::expression const& binary_predicate, null_equality compare_nulls = null_equality::EQUAL, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @} */ // end of group diff --git a/cpp/include/cudf/join/sort_merge_join.hpp b/cpp/include/cudf/join/sort_merge_join.hpp index a6f526ae069e..346369180e54 100644 --- a/cpp/include/cudf/join/sort_merge_join.hpp +++ b/cpp/include/cudf/join/sort_merge_join.hpp @@ -11,9 +11,10 @@ #include #include -#include #include +#include + #include /** @@ -65,8 +66,8 @@ class sort_merge_join { */ sort_merge_join(table_view const& right, sorted is_right_sorted, - null_equality compare_nulls = null_equality::EQUAL, - rmm::cuda_stream_view stream = cudf::get_default_stream()); + null_equality compare_nulls = null_equality::EQUAL, + cuda::stream_ref stream = cudf::get_default_stream()); /** * @brief Returns the row indices that can be used to construct the result of performing @@ -87,7 +88,7 @@ class sort_merge_join { std::pair>, std::unique_ptr>> inner_join(table_view const& left, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()) const; /** @@ -112,7 +113,7 @@ class sort_merge_join { std::unique_ptr>> inner_join(table_view const& left, sorted is_left_sorted, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()) const; /** @@ -133,7 +134,7 @@ class sort_merge_join { std::pair>, std::unique_ptr>> left_join(table_view const& left, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()) const; /** @@ -158,7 +159,7 @@ class sort_merge_join { std::unique_ptr>> left_join(table_view const& left, sorted is_left_sorted, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()) const; /** @@ -187,7 +188,7 @@ class sort_merge_join { */ std::unique_ptr inner_join_match_context( table_view const& left, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()) const; /** @@ -209,7 +210,7 @@ class sort_merge_join { inner_join_match_context( table_view const& left, sorted is_left_sorted, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()) const; /** @@ -268,7 +269,7 @@ class sort_merge_join { std::unique_ptr>> partitioned_inner_join( cudf::join_partition_context const& context, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()) const; private: diff --git a/cpp/include/cudf/reduction.hpp b/cpp/include/cudf/reduction.hpp index 66f46cc63798..0b2939618320 100644 --- a/cpp/include/cudf/reduction.hpp +++ b/cpp/include/cudf/reduction.hpp @@ -96,7 +96,7 @@ std::unique_ptr reduce( column_view const& col, reduce_aggregation const& agg, data_type output_type, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); // clang-format on @@ -108,7 +108,7 @@ std::unique_ptr reduce( * detection is performed throughout the entire computation. * * @see cudf::reduce(column_view const&,reduce_aggregation - * const&,data_type,rmm::cuda_stream_view,rmm::device_async_resource_ref) for more details + * const&,data_type,cuda::stream_ref,rmm::device_async_resource_ref) for more details * * @throw std::invalid_argument if reduction is not `sum`, `product`, `min`, `max`, `any`, `all`, * or `sum_overflow` and `init` is specified. @@ -126,7 +126,7 @@ std::unique_ptr reduce( reduce_aggregation const& agg, data_type output_type, std::optional> init, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -178,7 +178,7 @@ std::unique_ptr segmented_reduce( segmented_reduce_aggregation const& agg, data_type output_type, null_policy null_handling, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -205,7 +205,7 @@ std::unique_ptr segmented_reduce( data_type output_type, null_policy null_handling, std::optional> init, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -231,7 +231,7 @@ std::unique_ptr scan( scan_aggregation const& agg, scan_type inclusive, null_policy null_handling = null_policy::EXCLUDE, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -246,7 +246,7 @@ std::unique_ptr scan( */ std::pair, std::unique_ptr> minmax( column_view const& col, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** diff --git a/cpp/include/cudf/reduction/approx_distinct_count.hpp b/cpp/include/cudf/reduction/approx_distinct_count.hpp index 528f25ac5545..026dbc1784f8 100644 --- a/cpp/include/cudf/reduction/approx_distinct_count.hpp +++ b/cpp/include/cudf/reduction/approx_distinct_count.hpp @@ -11,9 +11,8 @@ #include #include -#include - #include +#include #include #include @@ -127,10 +126,10 @@ class approx_distinct_count { * @param mr Device memory resource used to allocate the sketch storage */ approx_distinct_count(table_view const& input, - std::int32_t precision = 12, - null_policy null_handling = null_policy::EXCLUDE, - nan_policy nan_handling = nan_policy::NAN_IS_NULL, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + std::int32_t precision = 12, + null_policy null_handling = null_policy::EXCLUDE, + nan_policy nan_handling = nan_policy::NAN_IS_NULL, + cuda::stream_ref stream = cudf::get_default_stream(), cuda::mr::any_resource mr = cudf::get_current_device_resource_ref()); @@ -157,9 +156,9 @@ class approx_distinct_count { */ approx_distinct_count(table_view const& input, desired_standard_error error, - null_policy null_handling = null_policy::EXCLUDE, - nan_policy nan_handling = nan_policy::NAN_IS_NULL, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + null_policy null_handling = null_policy::EXCLUDE, + nan_policy nan_handling = nan_policy::NAN_IS_NULL, + cuda::stream_ref stream = cudf::get_default_stream(), cuda::mr::any_resource mr = cudf::get_current_device_resource_ref()); @@ -201,7 +200,7 @@ class approx_distinct_count { * @param input Table whose rows will be added * @param stream CUDA stream used for device memory operations and kernel launches */ - void add(table_view const& input, rmm::cuda_stream_view stream = cudf::get_default_stream()); + void add(table_view const& input, cuda::stream_ref stream = cudf::get_default_stream()); /** * @brief Merges another sketch into this sketch @@ -216,7 +215,7 @@ class approx_distinct_count { * @param stream CUDA stream used for device memory operations and kernel launches */ void merge(approx_distinct_count const& other, - rmm::cuda_stream_view stream = cudf::get_default_stream()); + cuda::stream_ref stream = cudf::get_default_stream()); /** * @brief Merges a sketch from raw bytes into this sketch @@ -232,7 +231,7 @@ class approx_distinct_count { * @param stream CUDA stream used for device memory operations and kernel launches */ void merge(cuda::std::span sketch_span, - rmm::cuda_stream_view stream = cudf::get_default_stream()); + cuda::stream_ref stream = cudf::get_default_stream()); /** * @brief Estimates the approximate number of distinct rows in the sketch @@ -240,8 +239,7 @@ class approx_distinct_count { * @param stream CUDA stream used for device memory operations and kernel launches * @return Approximate number of distinct rows */ - [[nodiscard]] std::size_t estimate( - rmm::cuda_stream_view stream = cudf::get_default_stream()) const; + [[nodiscard]] std::size_t estimate(cuda::stream_ref stream = cudf::get_default_stream()) const; /** * @brief Gets the raw sketch bytes for serialization or external merging diff --git a/cpp/include/cudf/reduction/detail/approx_distinct_count.cuh b/cpp/include/cudf/reduction/detail/approx_distinct_count.cuh index d24933b7c5ad..fc1f9d79a426 100644 --- a/cpp/include/cudf/reduction/detail/approx_distinct_count.cuh +++ b/cpp/include/cudf/reduction/detail/approx_distinct_count.cuh @@ -11,12 +11,12 @@ #include #include -#include #include #include #include #include +#include #include #include @@ -85,7 +85,7 @@ class approx_distinct_count { std::int32_t precision, null_policy null_handling, nan_policy nan_handling, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, cuda::mr::any_resource mr); /** @@ -111,7 +111,7 @@ class approx_distinct_count { cudf::approx_distinct_count::desired_standard_error error, null_policy null_handling, nan_policy nan_handling, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, cuda::mr::any_resource mr); /** @@ -154,7 +154,7 @@ class approx_distinct_count { * @param input Table whose rows will be added * @param stream CUDA stream used for device memory operations and kernel launches */ - void add(table_view const& input, rmm::cuda_stream_view stream); + void add(table_view const& input, cuda::stream_ref stream); /** * @brief Merges another sketch into this sketch @@ -168,7 +168,7 @@ class approx_distinct_count { * @param other The sketch to merge into this sketch * @param stream CUDA stream used for device memory operations and kernel launches */ - void merge(approx_distinct_count const& other, rmm::cuda_stream_view stream); + void merge(approx_distinct_count const& other, cuda::stream_ref stream); /** * @brief Merges a sketch from raw bytes into this sketch @@ -183,7 +183,7 @@ class approx_distinct_count { * @param sketch_span The sketch bytes to merge into this sketch * @param stream CUDA stream used for device memory operations and kernel launches */ - void merge(cuda::std::span sketch_span, rmm::cuda_stream_view stream); + void merge(cuda::std::span sketch_span, cuda::stream_ref stream); /** * @brief Estimates the approximate number of distinct rows in the sketch @@ -191,7 +191,7 @@ class approx_distinct_count { * @param stream CUDA stream used for device memory operations and kernel launches * @return Approximate number of distinct rows */ - [[nodiscard]] std::size_t estimate(rmm::cuda_stream_view stream) const; + [[nodiscard]] std::size_t estimate(cuda::stream_ref stream) const; /** * @brief Gets the raw sketch bytes diff --git a/cpp/include/cudf/reduction/detail/distinct_count.hpp b/cpp/include/cudf/reduction/detail/distinct_count.hpp index f31398a2221b..4e1ba98ae24d 100644 --- a/cpp/include/cudf/reduction/detail/distinct_count.hpp +++ b/cpp/include/cudf/reduction/detail/distinct_count.hpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -10,25 +10,25 @@ #include #include -#include +#include namespace cudf { namespace detail { /** - * @copydoc cudf::distinct_count(column_view const&, null_policy, nan_policy, rmm::cuda_stream_view) + * @copydoc cudf::distinct_count(column_view const&, null_policy, nan_policy, cuda::stream_ref) */ cudf::size_type distinct_count(column_view const& input, null_policy null_handling, nan_policy nan_handling, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); /** - * @copydoc cudf::distinct_count(table_view const&, null_equality, rmm::cuda_stream_view) + * @copydoc cudf::distinct_count(table_view const&, null_equality, cuda::stream_ref) */ cudf::size_type distinct_count(table_view const& input, null_equality nulls_equal, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); } // namespace detail } // namespace cudf diff --git a/cpp/include/cudf/reduction/detail/histogram.hpp b/cpp/include/cudf/reduction/detail/histogram.hpp index 6f2f870cb829..cbf499913913 100644 --- a/cpp/include/cudf/reduction/detail/histogram.hpp +++ b/cpp/include/cudf/reduction/detail/histogram.hpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -11,9 +11,10 @@ #include #include -#include #include +#include + #include #include @@ -33,7 +34,7 @@ namespace reduction::detail { [[nodiscard]] std::pair>, std::unique_ptr> compute_row_frequencies(table_view const& input, std::optional const& partial_counts, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** diff --git a/cpp/include/cudf/reduction/detail/reduction.cuh b/cpp/include/cudf/reduction/detail/reduction.cuh index e4a0d0de0687..39175ff3ed05 100644 --- a/cpp/include/cudf/reduction/detail/reduction.cuh +++ b/cpp/include/cudf/reduction/detail/reduction.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -13,12 +13,12 @@ #include #include -#include #include #include #include #include +#include #include #include @@ -48,7 +48,7 @@ std::unique_ptr reduce(InputIterator d_in, cudf::size_type num_items, op::simple_op op, std::optional init, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) requires(is_fixed_width() && not cudf::is_fixed_point()) { @@ -67,7 +67,7 @@ std::unique_ptr reduce(InputIterator d_in, num_items, binary_op, initial_value, - stream.value()); + stream.get()); d_temp_storage = rmm::device_buffer{temp_storage_bytes, stream}; // Run reduction @@ -78,7 +78,7 @@ std::unique_ptr reduce(InputIterator d_in, num_items, binary_op, initial_value, - stream.value()); + stream.get()); return result; } @@ -89,7 +89,7 @@ std::unique_ptr reduce(InputIterator d_in, cudf::size_type num_items, op::simple_op op, std::optional init, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) requires(is_fixed_point()) { @@ -106,7 +106,7 @@ std::unique_ptr reduce(InputIterator d_in, cudf::size_type num_items, op::simple_op op, std::optional init, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) requires(std::is_same_v) { @@ -125,7 +125,7 @@ std::unique_ptr reduce(InputIterator d_in, num_items, binary_op, initial_value, - stream.value()); + stream.get()); d_temp_storage = rmm::device_buffer{temp_storage_bytes, stream, cudf::get_current_device_resource_ref()}; @@ -137,7 +137,7 @@ std::unique_ptr reduce(InputIterator d_in, num_items, binary_op, initial_value, - stream.value()); + stream.get()); return std::make_unique(dev_result, true, stream, mr); } @@ -171,7 +171,7 @@ std::unique_ptr reduce(InputIterator d_in, op::compound_op op, cudf::size_type valid_count, cudf::size_type ddof, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { auto const binary_op = cudf::detail::cast_functor(op.get_binary_op()); @@ -190,7 +190,7 @@ std::unique_ptr reduce(InputIterator d_in, num_items, binary_op, initial_value, - stream.value()); + stream.get()); d_temp_storage = rmm::device_buffer{temp_storage_bytes, stream, cudf::get_current_device_resource_ref()}; @@ -202,7 +202,7 @@ std::unique_ptr reduce(InputIterator d_in, num_items, binary_op, initial_value, - stream.value()); + stream.get()); // compute the result value from intermediate value in device using ScalarType = cudf::scalar_type_t; diff --git a/cpp/include/cudf/reduction/detail/reduction.hpp b/cpp/include/cudf/reduction/detail/reduction.hpp index 5acdf45ae3db..bf93be5369de 100644 --- a/cpp/include/cudf/reduction/detail/reduction.hpp +++ b/cpp/include/cudf/reduction/detail/reduction.hpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -25,7 +25,7 @@ std::unique_ptr reduce(column_view const& col, reduce_aggregation const& agg, data_type output_dtype, std::optional> init, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); } // namespace reduction::detail diff --git a/cpp/include/cudf/reduction/detail/reduction_functions.hpp b/cpp/include/cudf/reduction/detail/reduction_functions.hpp index 6eda5d39a003..23b906ca4882 100644 --- a/cpp/include/cudf/reduction/detail/reduction_functions.hpp +++ b/cpp/include/cudf/reduction/detail/reduction_functions.hpp @@ -12,7 +12,7 @@ #include #include -#include +#include #include @@ -36,7 +36,7 @@ namespace reduction::detail { std::unique_ptr sum(column_view const& col, data_type const output_dtype, std::optional> init, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -58,7 +58,7 @@ std::unique_ptr sum(column_view const& col, std::unique_ptr sum_overflow(column_view const& col, data_type const output_type, std::optional> init, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -78,7 +78,7 @@ std::unique_ptr sum_overflow(column_view const& col, std::unique_ptr min(column_view const& col, data_type const output_dtype, std::optional> init, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -98,7 +98,7 @@ std::unique_ptr min(column_view const& col, std::unique_ptr max(column_view const& col, data_type const output_dtype, std::optional> init, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -115,7 +115,7 @@ std::unique_ptr max(column_view const& col, */ std::unique_ptr argmin(column_view const& col, data_type dispatch_type, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -132,7 +132,7 @@ std::unique_ptr argmin(column_view const& col, */ std::unique_ptr argmax(column_view const& col, data_type dispatch_type, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -144,7 +144,7 @@ std::unique_ptr argmax(column_view const& col, * @return A pair consisting of the minimum value and the maximum value */ std::pair, std::unique_ptr> minmax( - cudf::column_view const& col, rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr); + cudf::column_view const& col, cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** * @brief Computes any of elements in input column is true when typecasted to bool @@ -164,7 +164,7 @@ std::pair, std::unique_ptr> minmax( std::unique_ptr any(column_view const& col, data_type const output_dtype, std::optional> init, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -185,7 +185,7 @@ std::unique_ptr any(column_view const& col, std::unique_ptr all(column_view const& col, data_type const output_dtype, std::optional> init, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -200,7 +200,7 @@ std::unique_ptr all(column_view const& col, * @return A list_scalar storing a structs column as the result histogram */ std::unique_ptr histogram(column_view const& input, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -212,7 +212,7 @@ std::unique_ptr histogram(column_view const& input, * @return A list_scalar storing the result histogram */ std::unique_ptr merge_histogram(column_view const& input, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -233,7 +233,7 @@ std::unique_ptr merge_histogram(column_view const& input, std::unique_ptr product(column_view const& col, data_type const output_dtype, std::optional> init, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -252,7 +252,7 @@ std::unique_ptr product(column_view const& col, */ std::unique_ptr sum_of_squares(column_view const& col, data_type const output_dtype, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -271,7 +271,7 @@ std::unique_ptr sum_of_squares(column_view const& col, */ std::unique_ptr mean(column_view const& col, data_type const output_dtype, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -293,7 +293,7 @@ std::unique_ptr mean(column_view const& col, std::unique_ptr variance(column_view const& col, data_type const output_dtype, size_type ddof, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -315,7 +315,7 @@ std::unique_ptr variance(column_view const& col, std::unique_ptr standard_deviation(column_view const& col, data_type const output_dtype, size_type ddof, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -345,7 +345,7 @@ std::unique_ptr standard_deviation(column_view const& col, std::unique_ptr nth_element(column_view const& col, size_type n, null_policy null_handling, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -359,7 +359,7 @@ std::unique_ptr nth_element(column_view const& col, */ std::unique_ptr collect_list(column_view const& col, null_policy null_handling, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -371,7 +371,7 @@ std::unique_ptr collect_list(column_view const& col, * @return merged list as scalar */ std::unique_ptr merge_lists(lists_column_view const& col, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -389,7 +389,7 @@ std::unique_ptr collect_set(column_view const& col, null_policy null_handling, null_equality nulls_equal, nan_equality nans_equal, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -405,7 +405,7 @@ std::unique_ptr collect_set(column_view const& col, std::unique_ptr merge_sets(lists_column_view const& col, null_equality nulls_equal, nan_equality nans_equal, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -419,7 +419,7 @@ std::unique_ptr merge_sets(lists_column_view const& col, */ std::unique_ptr bitwise_reduction(bitwise_op bit_op, column_view const& col, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -441,7 +441,7 @@ std::unique_ptr quantile(column_view const& col, double quantile_value, cudf::interpolation interpolation, cudf::data_type const output_type, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -458,7 +458,7 @@ std::unique_ptr quantile(column_view const& col, std::unique_ptr nunique(column_view const& col, null_policy null_handling, data_type const output_dtype, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -476,7 +476,7 @@ std::unique_ptr nunique(column_view const& col, std::unique_ptr count(column_view const& col, null_policy null_handling, data_type const output_type, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); } // namespace reduction::detail diff --git a/cpp/include/cudf/reduction/detail/segmented_reduction.cuh b/cpp/include/cudf/reduction/detail/segmented_reduction.cuh index 6f2226211797..4b56011542bc 100644 --- a/cpp/include/cudf/reduction/detail/segmented_reduction.cuh +++ b/cpp/include/cudf/reduction/detail/segmented_reduction.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -10,12 +10,12 @@ #include #include -#include #include #include #include #include +#include #include namespace cudf { @@ -52,7 +52,7 @@ void segmented_reduce(InputIterator d_in, OutputIterator d_out, BinaryOp op, OutputType initial_value, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) requires(is_fixed_width() && !cudf::is_fixed_point()) { auto const num_segments = static_cast(std::distance(d_offset_begin, d_offset_end)) - 1; @@ -68,7 +68,7 @@ void segmented_reduce(InputIterator d_in, d_offset_begin + 1, binary_op, initial_value, - stream.value()); + stream.get()); auto d_temp_storage = rmm::device_buffer{temp_storage_bytes, stream}; // Run reduction @@ -81,7 +81,7 @@ void segmented_reduce(InputIterator d_in, d_offset_begin + 1, binary_op, initial_value, - stream.value()); + stream.get()); } template () && !cudf::is_fixed_point())) { CUDF_FAIL( @@ -132,7 +132,7 @@ void segmented_reduce(InputIterator d_in, op::compound_op op, size_type ddof, size_type* d_valid_counts, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { using OutputType = cuda::std::iter_value_t; using IntermediateType = cuda::std::iter_value_t; @@ -154,7 +154,7 @@ void segmented_reduce(InputIterator d_in, d_offset_begin + 1, binary_op, initial_value, - stream.value()); + stream.get()); auto d_temp_storage = rmm::device_buffer{temp_storage_bytes, stream}; // Run reduction @@ -167,7 +167,7 @@ void segmented_reduce(InputIterator d_in, d_offset_begin + 1, binary_op, initial_value, - stream.value()); + stream.get()); // compute the result value from intermediate value in device thrust::transform( diff --git a/cpp/include/cudf/reduction/detail/segmented_reduction_functions.hpp b/cpp/include/cudf/reduction/detail/segmented_reduction_functions.hpp index cfbd0bc8043b..483f9c3578b2 100644 --- a/cpp/include/cudf/reduction/detail/segmented_reduction_functions.hpp +++ b/cpp/include/cudf/reduction/detail/segmented_reduction_functions.hpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -10,7 +10,7 @@ #include #include -#include +#include #include @@ -44,7 +44,7 @@ std::unique_ptr segmented_sum(column_view const& col, data_type const output_dtype, null_policy null_handling, std::optional> init, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -74,7 +74,7 @@ std::unique_ptr segmented_product(column_view const& col, data_type const output_dtype, null_policy null_handling, std::optional> init, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -103,7 +103,7 @@ std::unique_ptr segmented_min(column_view const& col, data_type const output_dtype, null_policy null_handling, std::optional> init, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -132,7 +132,7 @@ std::unique_ptr segmented_max(column_view const& col, data_type const output_dtype, null_policy null_handling, std::optional> init, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -162,7 +162,7 @@ std::unique_ptr segmented_any(column_view const& col, data_type const output_dtype, null_policy null_handling, std::optional> init, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -192,7 +192,7 @@ std::unique_ptr segmented_all(column_view const& col, data_type const output_dtype, null_policy null_handling, std::optional> init, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -220,7 +220,7 @@ std::unique_ptr segmented_mean(column_view const& col, device_span offsets, data_type const output_dtype, null_policy null_handling, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -248,7 +248,7 @@ std::unique_ptr segmented_sum_of_squares(column_view const& col, device_span offsets, data_type const output_dtype, null_policy null_handling, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -279,7 +279,7 @@ std::unique_ptr segmented_standard_deviation(column_view const& col, data_type const output_dtype, null_policy null_handling, size_type ddof, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -310,7 +310,7 @@ std::unique_ptr segmented_variance(column_view const& col, data_type const output_dtype, null_policy null_handling, size_type ddof, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -338,7 +338,7 @@ std::unique_ptr segmented_variance(column_view const& col, std::unique_ptr segmented_nunique(column_view const& col, device_span offsets, null_policy null_handling, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); } // namespace reduction::detail diff --git a/cpp/include/cudf/reduction/detail/unique_count.hpp b/cpp/include/cudf/reduction/detail/unique_count.hpp index 6c281a48d5a7..47bbb3f151f9 100644 --- a/cpp/include/cudf/reduction/detail/unique_count.hpp +++ b/cpp/include/cudf/reduction/detail/unique_count.hpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -10,25 +10,25 @@ #include #include -#include +#include namespace cudf { namespace detail { /** - * @copydoc cudf::unique_count(column_view const&, null_policy, nan_policy, rmm::cuda_stream_view) + * @copydoc cudf::unique_count(column_view const&, null_policy, nan_policy, cuda::stream_ref) */ cudf::size_type unique_count(column_view const& input, null_policy null_handling, nan_policy nan_handling, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); /** - * @copydoc cudf::unique_count(table_view const&, null_equality, rmm::cuda_stream_view) + * @copydoc cudf::unique_count(table_view const&, null_equality, cuda::stream_ref) */ cudf::size_type unique_count(table_view const& input, null_equality nulls_equal, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); } // namespace detail } // namespace cudf diff --git a/cpp/include/cudf/reduction/distinct_count.hpp b/cpp/include/cudf/reduction/distinct_count.hpp index 0f4a848a1700..88014857f13e 100644 --- a/cpp/include/cudf/reduction/distinct_count.hpp +++ b/cpp/include/cudf/reduction/distinct_count.hpp @@ -11,7 +11,7 @@ #include #include -#include +#include /** * @file @@ -47,7 +47,7 @@ namespace CUDF_EXPORT cudf { cudf::size_type distinct_count(column_view const& input, null_policy null_handling, nan_policy nan_handling, - rmm::cuda_stream_view stream = cudf::get_default_stream()); + cuda::stream_ref stream = cudf::get_default_stream()); /** * @brief Count the distinct rows in a table. @@ -60,8 +60,8 @@ cudf::size_type distinct_count(column_view const& input, * @return number of distinct rows in the table */ cudf::size_type distinct_count(table_view const& input, - null_equality nulls_equal = null_equality::EQUAL, - rmm::cuda_stream_view stream = cudf::get_default_stream()); + null_equality nulls_equal = null_equality::EQUAL, + cuda::stream_ref stream = cudf::get_default_stream()); /** @} */ diff --git a/cpp/include/cudf/reduction/unique_count.hpp b/cpp/include/cudf/reduction/unique_count.hpp index 48410720bcc3..241e85956c9b 100644 --- a/cpp/include/cudf/reduction/unique_count.hpp +++ b/cpp/include/cudf/reduction/unique_count.hpp @@ -11,7 +11,7 @@ #include #include -#include +#include /** * @file @@ -44,7 +44,7 @@ namespace CUDF_EXPORT cudf { cudf::size_type unique_count(column_view const& input, null_policy null_handling, nan_policy nan_handling, - rmm::cuda_stream_view stream = cudf::get_default_stream()); + cuda::stream_ref stream = cudf::get_default_stream()); /** * @brief Count the number of consecutive groups of equivalent rows in a table. @@ -57,8 +57,8 @@ cudf::size_type unique_count(column_view const& input, * @return number of consecutive groups of equivalent rows in the column */ cudf::size_type unique_count(table_view const& input, - null_equality nulls_equal = null_equality::EQUAL, - rmm::cuda_stream_view stream = cudf::get_default_stream()); + null_equality nulls_equal = null_equality::EQUAL, + cuda::stream_ref stream = cudf::get_default_stream()); /** @} */ diff --git a/cpp/include/cudf/rolling.hpp b/cpp/include/cudf/rolling.hpp index 84b0308b7f87..0cb19a9ea409 100644 --- a/cpp/include/cudf/rolling.hpp +++ b/cpp/include/cudf/rolling.hpp @@ -150,7 +150,7 @@ std::pair, std::unique_ptr> make_range_windows( null_order null_order, range_window_type preceding, range_window_type following, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -197,7 +197,7 @@ std::unique_ptr rolling_window( size_type following_window, size_type min_periods, rolling_aggregation const& agg, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -208,7 +208,7 @@ std::unique_ptr rolling_window( * size_type following_window, * size_type min_periods, * rolling_aggregation const& agg, - * rmm::cuda_stream_view stream, + * cuda::stream_ref stream, * rmm::device_async_resource_ref mr) * * @param default_outputs A column of per-row default values to be returned instead @@ -222,7 +222,7 @@ std::unique_ptr rolling_window( size_type following_window, size_type min_periods, rolling_aggregation const& agg, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -373,7 +373,7 @@ std::unique_ptr grouped_rolling_window( size_type following_window, size_type min_periods, rolling_aggregation const& aggr, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -385,7 +385,7 @@ std::unique_ptr grouped_rolling_window( * size_type following_window, * size_type min_periods, * rolling_aggregation const& aggr, - * rmm::cuda_stream_view stream, + * cuda::stream_ref stream, * rmm::device_async_resource_ref mr) */ std::unique_ptr grouped_rolling_window( @@ -395,7 +395,7 @@ std::unique_ptr grouped_rolling_window( window_bounds following_window, size_type min_periods, rolling_aggregation const& aggr, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -407,7 +407,7 @@ std::unique_ptr grouped_rolling_window( * size_type following_window, * size_type min_periods, * rolling_aggregation const& aggr, - * rmm::cuda_stream_view stream,, + * cuda::stream_ref stream,, * rmm::device_async_resource_ref mr) * * @param default_outputs A column of per-row default values to be returned instead @@ -422,7 +422,7 @@ std::unique_ptr grouped_rolling_window( size_type following_window, size_type min_periods, rolling_aggregation const& aggr, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -435,7 +435,7 @@ std::unique_ptr grouped_rolling_window( * size_type following_window, * size_type min_periods, * rolling_aggregation const& aggr, - * rmm::cuda_stream_view stream, + * cuda::stream_ref stream, * rmm::device_async_resource_ref mr) */ std::unique_ptr grouped_rolling_window( @@ -446,7 +446,7 @@ std::unique_ptr grouped_rolling_window( window_bounds following_window, size_type min_periods, rolling_aggregation const& aggr, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -569,7 +569,7 @@ std::unique_ptr grouped_range_rolling_window( range_window_bounds const& following, size_type min_periods, rolling_aggregation const& aggr, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -595,7 +595,7 @@ std::unique_ptr
grouped_range_rolling_window( range_window_type preceding, range_window_type following, std::span requests, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -628,7 +628,7 @@ std::unique_ptr
grouped_range_rolling_window( range_window_type preceding, range_window_type following, host_span requests, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -683,7 +683,7 @@ std::unique_ptr rolling_window( column_view const& following_window, size_type min_periods, rolling_aggregation const& agg, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** diff --git a/cpp/include/cudf/rolling/range_window_bounds.hpp b/cpp/include/cudf/rolling/range_window_bounds.hpp index 42ddbd91e079..1a748b942e59 100644 --- a/cpp/include/cudf/rolling/range_window_bounds.hpp +++ b/cpp/include/cudf/rolling/range_window_bounds.hpp @@ -54,7 +54,7 @@ struct range_window_bounds { * @return A bounded window boundary object */ static range_window_bounds get(scalar const& boundary, - rmm::cuda_stream_view stream = cudf::get_default_stream()); + cuda::stream_ref stream = cudf::get_default_stream()); /** * @brief Factory method to construct a window boundary @@ -65,7 +65,7 @@ struct range_window_bounds { * @return A "current row" window boundary object */ static range_window_bounds current_row(data_type type, - rmm::cuda_stream_view stream = cudf::get_default_stream()); + cuda::stream_ref stream = cudf::get_default_stream()); /** * @brief Whether or not the window is bounded to the current row @@ -83,7 +83,7 @@ struct range_window_bounds { * @return An unbounded window boundary object */ static range_window_bounds unbounded(data_type type, - rmm::cuda_stream_view stream = cudf::get_default_stream()); + cuda::stream_ref stream = cudf::get_default_stream()); /** * @brief Whether or not the window is unbounded @@ -109,7 +109,7 @@ struct range_window_bounds { range_window_bounds(extent_type extent_, std::unique_ptr range_scalar_, - rmm::cuda_stream_view = cudf::get_default_stream()); + cuda::stream_ref = cudf::get_default_stream()); }; /** @} */ // end of group diff --git a/cpp/include/cudf/sorting.hpp b/cpp/include/cudf/sorting.hpp index c3e994aefb73..77a80177f80a 100644 --- a/cpp/include/cudf/sorting.hpp +++ b/cpp/include/cudf/sorting.hpp @@ -45,7 +45,7 @@ std::unique_ptr sorted_order( table_view const& input, std::vector const& column_order = {}, std::vector const& null_precedence = {}, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -60,7 +60,7 @@ std::unique_ptr stable_sorted_order( table_view const& input, std::vector const& column_order = {}, std::vector const& null_precedence = {}, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -83,7 +83,7 @@ std::unique_ptr stable_sorted_order( bool is_sorted(cudf::table_view const& table, std::vector const& column_order, std::vector const& null_precedence, - rmm::cuda_stream_view stream = cudf::get_default_stream()); + cuda::stream_ref stream = cudf::get_default_stream()); /** * @brief Performs a lexicographic sort of the rows of a table @@ -104,7 +104,7 @@ std::unique_ptr
sort( table_view const& input, std::vector const& column_order = {}, std::vector const& null_precedence = {}, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -116,7 +116,7 @@ std::unique_ptr
stable_sort( table_view const& input, std::vector const& column_order = {}, std::vector const& null_precedence = {}, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -146,7 +146,7 @@ std::unique_ptr
sort_by_key( table_view const& keys, std::vector const& column_order = {}, std::vector const& null_precedence = {}, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -159,7 +159,7 @@ std::unique_ptr
stable_sort_by_key( table_view const& keys, std::vector const& column_order = {}, std::vector const& null_precedence = {}, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -226,7 +226,7 @@ std::unique_ptr rank( null_policy null_handling, null_order null_precedence, bool percentage, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -281,7 +281,7 @@ std::unique_ptr segmented_sorted_order( column_view const& segment_offsets, std::vector const& column_order = {}, std::vector const& null_precedence = {}, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -294,7 +294,7 @@ std::unique_ptr stable_segmented_sorted_order( column_view const& segment_offsets, std::vector const& column_order = {}, std::vector const& null_precedence = {}, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -350,7 +350,7 @@ std::unique_ptr
segmented_sort_by_key( column_view const& segment_offsets, std::vector const& column_order = {}, std::vector const& null_precedence = {}, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -364,7 +364,7 @@ std::unique_ptr
stable_segmented_sort_by_key( column_view const& segment_offsets, std::vector const& column_order = {}, std::vector const& null_precedence = {}, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -387,7 +387,7 @@ std::unique_ptr top_k( column_view const& col, size_type k, order topk_order = order::DESCENDING, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -410,7 +410,7 @@ std::unique_ptr top_k_order( column_view const& col, size_type k, order topk_order = order::DESCENDING, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -457,7 +457,7 @@ std::unique_ptr segmented_top_k( column_view const& segment_offsets, size_type k, order topk_order = order::DESCENDING, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -504,7 +504,7 @@ std::unique_ptr segmented_top_k_order( column_view const& segment_offsets, size_type k, order topk_order = order::DESCENDING, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @} */ // end of group diff --git a/cpp/include/cudf/transform.hpp b/cpp/include/cudf/transform.hpp index 2be1a88a9020..bfca4b171f00 100644 --- a/cpp/include/cudf/transform.hpp +++ b/cpp/include/cudf/transform.hpp @@ -74,7 +74,7 @@ struct transform_output { null_aware is_null_aware = null_aware::NO, std::optional row_size = std::nullopt, output_nullability null_policy = output_nullability::PRESERVE, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -127,7 +127,7 @@ std::unique_ptr
transform( std::span outputs, std::vector>&& string_offsets, std::optional row_size, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -157,7 +157,7 @@ std::unique_ptr
transform( std::span outputs, std::vector>&& string_offsets, std::optional row_size, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -215,7 +215,7 @@ std::unique_ptr
transform_lto( std::span outputs, std::vector>&& string_offsets, std::optional row_size, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -234,7 +234,7 @@ std::unique_ptr
transform_lto( */ [[deprecated]] std::pair, size_type> nans_to_nulls( column_view const& input, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -250,7 +250,7 @@ std::unique_ptr
transform_lto( */ std::unique_ptr column_nans_to_nulls( column_view const& input, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -274,7 +274,7 @@ std::unique_ptr column_nans_to_nulls( std::unique_ptr compute_column( table_view const& table, ast::expression const& expr, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -299,7 +299,7 @@ std::unique_ptr compute_column( std::unique_ptr compute_column_jit( table_view const& table, ast::expression const& expr, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -320,7 +320,7 @@ std::unique_ptr compute_column_jit( */ std::pair, cudf::size_type> bools_to_mask( column_view const& input, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -350,7 +350,7 @@ std::pair, cudf::size_type> bools_to_mask( */ std::pair, std::unique_ptr> encode( cudf::table_view const& input, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -384,7 +384,7 @@ std::pair, std::unique_ptr> encode( std::pair, table_view> one_hot_encode( column_view const& input, column_view const& categories, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -413,7 +413,7 @@ std::unique_ptr mask_to_bools( bitmask_type const* bitmask, size_type begin_bit, size_type end_bit, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -444,7 +444,7 @@ std::unique_ptr mask_to_bools( */ std::unique_ptr row_bit_count( table_view const& t, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -469,7 +469,7 @@ std::unique_ptr row_bit_count( std::unique_ptr segmented_row_bit_count( table_view const& t, size_type segment_length, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @} */ // end of group diff --git a/cpp/include/cudf/unary.hpp b/cpp/include/cudf/unary.hpp index 316e031a02d0..45337659544c 100644 --- a/cpp/include/cudf/unary.hpp +++ b/cpp/include/cudf/unary.hpp @@ -71,7 +71,7 @@ enum class unary_operator : int32_t { std::unique_ptr unary_operation( cudf::column_view const& input, cudf::unary_operator op, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -87,7 +87,7 @@ std::unique_ptr unary_operation( */ std::unique_ptr is_null( cudf::column_view const& input, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -103,7 +103,7 @@ std::unique_ptr is_null( */ std::unique_ptr is_valid( cudf::column_view const& input, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -122,7 +122,7 @@ std::unique_ptr is_valid( std::unique_ptr cast( column_view const& input, data_type out_type, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -150,7 +150,7 @@ bool is_supported_cast(data_type from, data_type to) noexcept; */ std::unique_ptr is_nan( cudf::column_view const& input, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @@ -169,7 +169,7 @@ std::unique_ptr is_nan( */ std::unique_ptr is_not_nan( cudf::column_view const& input, - rmm::cuda_stream_view stream = cudf::get_default_stream(), + cuda::stream_ref stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); /** @} */ // end of group diff --git a/cpp/src/binaryop/binaryop.cpp b/cpp/src/binaryop/binaryop.cpp index 7a28e61319fb..899bcf9d1f97 100644 --- a/cpp/src/binaryop/binaryop.cpp +++ b/cpp/src/binaryop/binaryop.cpp @@ -1,7 +1,7 @@ /* * SPDX-FileCopyrightText: Copyright 2018-2019 BlazingDB, Inc. * SPDX-FileCopyrightText: Copyright 2018 Christian Noboa Mardini - * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ /* @@ -39,9 +39,8 @@ #include #include -#include - #include +#include #include @@ -59,7 +58,7 @@ bool is_supported_operation(data_type out, data_type lhs, data_type rhs, binary_ std::pair scalar_col_valid_mask_and( column_view const& col, scalar const& s, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { if (col.is_empty()) return std::pair(rmm::device_buffer{0, stream, mr}, 0); @@ -141,7 +140,7 @@ void binary_operation(mutable_column_view& out, column_view const& lhs, column_view const& rhs, std::string const& ptx, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { std::string const output_type_name = cudf::type_to_name(out.type()); @@ -204,7 +203,7 @@ std::unique_ptr binary_operation(LhsType const& lhs, RhsType const& rhs, binary_operator op, data_type output_type, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { if constexpr (std::is_same_v and std::is_same_v) @@ -265,7 +264,7 @@ std::unique_ptr make_fixed_width_column_for_output(scalar const& lhs, column_view const& rhs, binary_operator op, data_type output_type, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { if (binops::is_null_dependent(op)) { @@ -292,7 +291,7 @@ std::unique_ptr make_fixed_width_column_for_output(column_view const& lh scalar const& rhs, binary_operator op, data_type output_type, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { if (binops::is_null_dependent(op)) { @@ -319,7 +318,7 @@ std::unique_ptr make_fixed_width_column_for_output(column_view const& lh column_view const& rhs, binary_operator op, data_type output_type, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { if (binops::is_null_dependent(op)) { @@ -335,7 +334,7 @@ std::unique_ptr binary_operation(scalar const& lhs, column_view const& rhs, binary_operator op, data_type output_type, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { return binops::compiled::binary_operation( @@ -345,7 +344,7 @@ std::unique_ptr binary_operation(column_view const& lhs, scalar const& rhs, binary_operator op, data_type output_type, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { return binops::compiled::binary_operation( @@ -355,7 +354,7 @@ std::unique_ptr binary_operation(column_view const& lhs, column_view const& rhs, binary_operator op, data_type output_type, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { return binops::compiled::binary_operation( @@ -366,7 +365,7 @@ std::unique_ptr binary_operation(column_view const& lhs, column_view const& rhs, std::string const& ptx, data_type output_type, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { // Check for datatype @@ -420,7 +419,7 @@ std::unique_ptr binary_operation(scalar const& lhs, column_view const& rhs, binary_operator op, data_type output_type, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); @@ -430,7 +429,7 @@ std::unique_ptr binary_operation(column_view const& lhs, scalar const& rhs, binary_operator op, data_type output_type, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); @@ -440,7 +439,7 @@ std::unique_ptr binary_operation(column_view const& lhs, column_view const& rhs, binary_operator op, data_type output_type, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); @@ -451,7 +450,7 @@ std::unique_ptr binary_operation(column_view const& lhs, column_view const& rhs, std::string const& ptx, data_type output_type, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); diff --git a/cpp/src/binaryop/compiled/ATan2.cu b/cpp/src/binaryop/compiled/ATan2.cu index db1ba380cd4f..22dce10d9938 100644 --- a/cpp/src/binaryop/compiled/ATan2.cu +++ b/cpp/src/binaryop/compiled/ATan2.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2022, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -11,5 +11,5 @@ template void apply_binary_op(mutable_column_view&, column_view const&, bool is_lhs_scalar, bool is_rhs_scalar, - rmm::cuda_stream_view); + cuda::stream_ref); } diff --git a/cpp/src/binaryop/compiled/Add.cu b/cpp/src/binaryop/compiled/Add.cu index 77d032a99407..64ecb7542542 100644 --- a/cpp/src/binaryop/compiled/Add.cu +++ b/cpp/src/binaryop/compiled/Add.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2022, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -11,5 +11,5 @@ template void apply_binary_op(mutable_column_view&, column_view const&, bool is_lhs_scalar, bool is_rhs_scalar, - rmm::cuda_stream_view); + cuda::stream_ref); } diff --git a/cpp/src/binaryop/compiled/BitwiseAnd.cu b/cpp/src/binaryop/compiled/BitwiseAnd.cu index a3a83ee90995..ca5c8799fcd8 100644 --- a/cpp/src/binaryop/compiled/BitwiseAnd.cu +++ b/cpp/src/binaryop/compiled/BitwiseAnd.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2022, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -11,5 +11,5 @@ template void apply_binary_op(mutable_column_view&, column_view const&, bool is_lhs_scalar, bool is_rhs_scalar, - rmm::cuda_stream_view); + cuda::stream_ref); } diff --git a/cpp/src/binaryop/compiled/BitwiseOr.cu b/cpp/src/binaryop/compiled/BitwiseOr.cu index e73ea66680e5..226c2d5d1ceb 100644 --- a/cpp/src/binaryop/compiled/BitwiseOr.cu +++ b/cpp/src/binaryop/compiled/BitwiseOr.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2022, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -11,5 +11,5 @@ template void apply_binary_op(mutable_column_view&, column_view const&, bool is_lhs_scalar, bool is_rhs_scalar, - rmm::cuda_stream_view); + cuda::stream_ref); } diff --git a/cpp/src/binaryop/compiled/BitwiseXor.cu b/cpp/src/binaryop/compiled/BitwiseXor.cu index 3c3a999c59ff..9505fca5ca12 100644 --- a/cpp/src/binaryop/compiled/BitwiseXor.cu +++ b/cpp/src/binaryop/compiled/BitwiseXor.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2022, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -11,5 +11,5 @@ template void apply_binary_op(mutable_column_view&, column_view const&, bool is_lhs_scalar, bool is_rhs_scalar, - rmm::cuda_stream_view); + cuda::stream_ref); } diff --git a/cpp/src/binaryop/compiled/Div.cu b/cpp/src/binaryop/compiled/Div.cu index 2440a2d676dd..725a71b980a4 100644 --- a/cpp/src/binaryop/compiled/Div.cu +++ b/cpp/src/binaryop/compiled/Div.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2022, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -11,5 +11,5 @@ template void apply_binary_op(mutable_column_view&, column_view const&, bool is_lhs_scalar, bool is_rhs_scalar, - rmm::cuda_stream_view); + cuda::stream_ref); } diff --git a/cpp/src/binaryop/compiled/FloorDiv.cu b/cpp/src/binaryop/compiled/FloorDiv.cu index 29fd2e9b3f24..966768faaa48 100644 --- a/cpp/src/binaryop/compiled/FloorDiv.cu +++ b/cpp/src/binaryop/compiled/FloorDiv.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2022, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -11,5 +11,5 @@ template void apply_binary_op(mutable_column_view&, column_view const&, bool is_lhs_scalar, bool is_rhs_scalar, - rmm::cuda_stream_view); + cuda::stream_ref); } diff --git a/cpp/src/binaryop/compiled/Greater.cu b/cpp/src/binaryop/compiled/Greater.cu index d0f51908663a..45a60fbd047c 100644 --- a/cpp/src/binaryop/compiled/Greater.cu +++ b/cpp/src/binaryop/compiled/Greater.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2022, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -11,5 +11,5 @@ template void apply_binary_op(mutable_column_view&, column_view const&, bool is_lhs_scalar, bool is_rhs_scalar, - rmm::cuda_stream_view); + cuda::stream_ref); } diff --git a/cpp/src/binaryop/compiled/GreaterEqual.cu b/cpp/src/binaryop/compiled/GreaterEqual.cu index dbfb24fce38e..2d566c789b08 100644 --- a/cpp/src/binaryop/compiled/GreaterEqual.cu +++ b/cpp/src/binaryop/compiled/GreaterEqual.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2022, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -11,5 +11,5 @@ template void apply_binary_op(mutable_column_view&, column_view const&, bool is_lhs_scalar, bool is_rhs_scalar, - rmm::cuda_stream_view); + cuda::stream_ref); } diff --git a/cpp/src/binaryop/compiled/IntPow.cu b/cpp/src/binaryop/compiled/IntPow.cu index d7deb8562436..5cc1037c9c3c 100644 --- a/cpp/src/binaryop/compiled/IntPow.cu +++ b/cpp/src/binaryop/compiled/IntPow.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -11,5 +11,5 @@ template void apply_binary_op(mutable_column_view&, column_view const&, bool is_lhs_scalar, bool is_rhs_scalar, - rmm::cuda_stream_view); + cuda::stream_ref); } diff --git a/cpp/src/binaryop/compiled/Less.cu b/cpp/src/binaryop/compiled/Less.cu index 65dd1e851187..769065ab148d 100644 --- a/cpp/src/binaryop/compiled/Less.cu +++ b/cpp/src/binaryop/compiled/Less.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2022, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -11,5 +11,5 @@ template void apply_binary_op(mutable_column_view&, column_view const&, bool is_lhs_scalar, bool is_rhs_scalar, - rmm::cuda_stream_view); + cuda::stream_ref); } diff --git a/cpp/src/binaryop/compiled/LessEqual.cu b/cpp/src/binaryop/compiled/LessEqual.cu index 37dcca8a8184..8c7bd02afe99 100644 --- a/cpp/src/binaryop/compiled/LessEqual.cu +++ b/cpp/src/binaryop/compiled/LessEqual.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2022, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -11,5 +11,5 @@ template void apply_binary_op(mutable_column_view&, column_view const&, bool is_lhs_scalar, bool is_rhs_scalar, - rmm::cuda_stream_view); + cuda::stream_ref); } diff --git a/cpp/src/binaryop/compiled/LogBase.cu b/cpp/src/binaryop/compiled/LogBase.cu index 38812fe19376..1ec774e4ae52 100644 --- a/cpp/src/binaryop/compiled/LogBase.cu +++ b/cpp/src/binaryop/compiled/LogBase.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2022, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -11,5 +11,5 @@ template void apply_binary_op(mutable_column_view&, column_view const&, bool is_lhs_scalar, bool is_rhs_scalar, - rmm::cuda_stream_view); + cuda::stream_ref); } diff --git a/cpp/src/binaryop/compiled/LogicalAnd.cu b/cpp/src/binaryop/compiled/LogicalAnd.cu index 6313ef4b3c08..a7b476c82cf0 100644 --- a/cpp/src/binaryop/compiled/LogicalAnd.cu +++ b/cpp/src/binaryop/compiled/LogicalAnd.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2022, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -11,5 +11,5 @@ template void apply_binary_op(mutable_column_view&, column_view const&, bool is_lhs_scalar, bool is_rhs_scalar, - rmm::cuda_stream_view); + cuda::stream_ref); } diff --git a/cpp/src/binaryop/compiled/LogicalOr.cu b/cpp/src/binaryop/compiled/LogicalOr.cu index fcb78f1034c1..fada9bd7f3bf 100644 --- a/cpp/src/binaryop/compiled/LogicalOr.cu +++ b/cpp/src/binaryop/compiled/LogicalOr.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2022, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -11,5 +11,5 @@ template void apply_binary_op(mutable_column_view&, column_view const&, bool is_lhs_scalar, bool is_rhs_scalar, - rmm::cuda_stream_view); + cuda::stream_ref); } diff --git a/cpp/src/binaryop/compiled/Mod.cu b/cpp/src/binaryop/compiled/Mod.cu index 973fe2ca0eb3..971c072a1f07 100644 --- a/cpp/src/binaryop/compiled/Mod.cu +++ b/cpp/src/binaryop/compiled/Mod.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2022, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -11,5 +11,5 @@ template void apply_binary_op(mutable_column_view&, column_view const&, bool is_lhs_scalar, bool is_rhs_scalar, - rmm::cuda_stream_view); + cuda::stream_ref); } diff --git a/cpp/src/binaryop/compiled/Mul.cu b/cpp/src/binaryop/compiled/Mul.cu index c97b98fd4b53..090d768fc98e 100644 --- a/cpp/src/binaryop/compiled/Mul.cu +++ b/cpp/src/binaryop/compiled/Mul.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2022, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -11,5 +11,5 @@ template void apply_binary_op(mutable_column_view&, column_view const&, bool is_lhs_scalar, bool is_rhs_scalar, - rmm::cuda_stream_view); + cuda::stream_ref); } diff --git a/cpp/src/binaryop/compiled/NullEquals.cu b/cpp/src/binaryop/compiled/NullEquals.cu index 4c6cba434a29..618804d12b12 100644 --- a/cpp/src/binaryop/compiled/NullEquals.cu +++ b/cpp/src/binaryop/compiled/NullEquals.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2022, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -11,5 +11,5 @@ template void apply_binary_op(mutable_column_view&, column_view const&, bool is_lhs_scalar, bool is_rhs_scalar, - rmm::cuda_stream_view); + cuda::stream_ref); } // namespace cudf::binops::compiled diff --git a/cpp/src/binaryop/compiled/NullLogicalAnd.cu b/cpp/src/binaryop/compiled/NullLogicalAnd.cu index f49281433833..25bd888435ab 100644 --- a/cpp/src/binaryop/compiled/NullLogicalAnd.cu +++ b/cpp/src/binaryop/compiled/NullLogicalAnd.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -11,5 +11,5 @@ template void apply_binary_op(mutable_column_view&, column_view const&, bool is_lhs_scalar, bool is_rhs_scalar, - rmm::cuda_stream_view); + cuda::stream_ref); } // namespace cudf::binops::compiled diff --git a/cpp/src/binaryop/compiled/NullLogicalOr.cu b/cpp/src/binaryop/compiled/NullLogicalOr.cu index aee94d3fd91c..cb79b3f6f713 100644 --- a/cpp/src/binaryop/compiled/NullLogicalOr.cu +++ b/cpp/src/binaryop/compiled/NullLogicalOr.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -11,5 +11,5 @@ template void apply_binary_op(mutable_column_view&, column_view const&, bool is_lhs_scalar, bool is_rhs_scalar, - rmm::cuda_stream_view); + cuda::stream_ref); } // namespace cudf::binops::compiled diff --git a/cpp/src/binaryop/compiled/NullMax.cu b/cpp/src/binaryop/compiled/NullMax.cu index 050147627750..8f4759b5dad6 100644 --- a/cpp/src/binaryop/compiled/NullMax.cu +++ b/cpp/src/binaryop/compiled/NullMax.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2022, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -11,5 +11,5 @@ template void apply_binary_op(mutable_column_view&, column_view const&, bool is_lhs_scalar, bool is_rhs_scalar, - rmm::cuda_stream_view); + cuda::stream_ref); } // namespace cudf::binops::compiled diff --git a/cpp/src/binaryop/compiled/NullMin.cu b/cpp/src/binaryop/compiled/NullMin.cu index f7be05f83906..b5d3832df93d 100644 --- a/cpp/src/binaryop/compiled/NullMin.cu +++ b/cpp/src/binaryop/compiled/NullMin.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2022, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -11,5 +11,5 @@ template void apply_binary_op(mutable_column_view&, column_view const&, bool is_lhs_scalar, bool is_rhs_scalar, - rmm::cuda_stream_view); + cuda::stream_ref); } // namespace cudf::binops::compiled diff --git a/cpp/src/binaryop/compiled/NullNotEquals.cu b/cpp/src/binaryop/compiled/NullNotEquals.cu index 3abc7224b0cf..53ff8fddceea 100644 --- a/cpp/src/binaryop/compiled/NullNotEquals.cu +++ b/cpp/src/binaryop/compiled/NullNotEquals.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -11,5 +11,5 @@ template void apply_binary_op(mutable_column_view&, column_view const&, bool is_lhs_scalar, bool is_rhs_scalar, - rmm::cuda_stream_view); + cuda::stream_ref); } // namespace cudf::binops::compiled diff --git a/cpp/src/binaryop/compiled/PMod.cu b/cpp/src/binaryop/compiled/PMod.cu index 05e55fb714ef..e70b21f5be7c 100644 --- a/cpp/src/binaryop/compiled/PMod.cu +++ b/cpp/src/binaryop/compiled/PMod.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2022, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -11,5 +11,5 @@ template void apply_binary_op(mutable_column_view&, column_view const&, bool is_lhs_scalar, bool is_rhs_scalar, - rmm::cuda_stream_view); + cuda::stream_ref); } diff --git a/cpp/src/binaryop/compiled/Pow.cu b/cpp/src/binaryop/compiled/Pow.cu index 828d726e1aee..ec1f6d1e5407 100644 --- a/cpp/src/binaryop/compiled/Pow.cu +++ b/cpp/src/binaryop/compiled/Pow.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2022, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -11,5 +11,5 @@ template void apply_binary_op(mutable_column_view&, column_view const&, bool is_lhs_scalar, bool is_rhs_scalar, - rmm::cuda_stream_view); + cuda::stream_ref); } diff --git a/cpp/src/binaryop/compiled/PyMod.cu b/cpp/src/binaryop/compiled/PyMod.cu index 5810944f19de..80c44b61ddde 100644 --- a/cpp/src/binaryop/compiled/PyMod.cu +++ b/cpp/src/binaryop/compiled/PyMod.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2022, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -11,5 +11,5 @@ template void apply_binary_op(mutable_column_view&, column_view const&, bool is_lhs_scalar, bool is_rhs_scalar, - rmm::cuda_stream_view); + cuda::stream_ref); } diff --git a/cpp/src/binaryop/compiled/ShiftLeft.cu b/cpp/src/binaryop/compiled/ShiftLeft.cu index 42ba8e26dae4..d4ce8884ac96 100644 --- a/cpp/src/binaryop/compiled/ShiftLeft.cu +++ b/cpp/src/binaryop/compiled/ShiftLeft.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2022, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -11,5 +11,5 @@ template void apply_binary_op(mutable_column_view&, column_view const&, bool is_lhs_scalar, bool is_rhs_scalar, - rmm::cuda_stream_view); + cuda::stream_ref); } diff --git a/cpp/src/binaryop/compiled/ShiftRight.cu b/cpp/src/binaryop/compiled/ShiftRight.cu index cb6bc70587e7..bfde32aa5afa 100644 --- a/cpp/src/binaryop/compiled/ShiftRight.cu +++ b/cpp/src/binaryop/compiled/ShiftRight.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2022, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -11,5 +11,5 @@ template void apply_binary_op(mutable_column_view&, column_view const&, bool is_lhs_scalar, bool is_rhs_scalar, - rmm::cuda_stream_view); + cuda::stream_ref); } diff --git a/cpp/src/binaryop/compiled/ShiftRightUnsigned.cu b/cpp/src/binaryop/compiled/ShiftRightUnsigned.cu index 650e240ed85e..d27b9a97afd8 100644 --- a/cpp/src/binaryop/compiled/ShiftRightUnsigned.cu +++ b/cpp/src/binaryop/compiled/ShiftRightUnsigned.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2022, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -11,5 +11,5 @@ template void apply_binary_op(mutable_column_view&, column_view const&, bool is_lhs_scalar, bool is_rhs_scalar, - rmm::cuda_stream_view); + cuda::stream_ref); } diff --git a/cpp/src/binaryop/compiled/Sub.cu b/cpp/src/binaryop/compiled/Sub.cu index 24bb8c6719e9..10f158ebfd18 100644 --- a/cpp/src/binaryop/compiled/Sub.cu +++ b/cpp/src/binaryop/compiled/Sub.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2022, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -11,5 +11,5 @@ template void apply_binary_op(mutable_column_view&, column_view const&, bool is_lhs_scalar, bool is_rhs_scalar, - rmm::cuda_stream_view); + cuda::stream_ref); } diff --git a/cpp/src/binaryop/compiled/TrueDiv.cu b/cpp/src/binaryop/compiled/TrueDiv.cu index 35be5f0ae82d..41f06a1f1ca0 100644 --- a/cpp/src/binaryop/compiled/TrueDiv.cu +++ b/cpp/src/binaryop/compiled/TrueDiv.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2022, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -11,5 +11,5 @@ template void apply_binary_op(mutable_column_view&, column_view const&, bool is_lhs_scalar, bool is_rhs_scalar, - rmm::cuda_stream_view); + cuda::stream_ref); } diff --git a/cpp/src/binaryop/compiled/binary_ops.cu b/cpp/src/binaryop/compiled/binary_ops.cu index b6a5d342585d..e3d06fe998c8 100644 --- a/cpp/src/binaryop/compiled/binary_ops.cu +++ b/cpp/src/binaryop/compiled/binary_ops.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -16,12 +16,12 @@ #include #include -#include #include #include #include #include +#include #include namespace cudf { @@ -39,7 +39,7 @@ struct scalar_as_column_view { using return_type = typename std::pair>; template ())> return_type operator()(scalar const& s, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { auto& h_scalar_type_view = static_cast&>(const_cast(s)); @@ -60,7 +60,7 @@ struct scalar_as_column_view { return std::pair{col_v, std::move(aux_col)}; } template ())> - return_type operator()(scalar const&, rmm::cuda_stream_view, rmm::device_async_resource_ref) + return_type operator()(scalar const&, cuda::stream_ref, rmm::device_async_resource_ref) { CUDF_FAIL("Unsupported type"); } @@ -68,7 +68,7 @@ struct scalar_as_column_view { // specialization for cudf::string_view template <> scalar_as_column_view::return_type scalar_as_column_view::operator()( - scalar const& s, rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr) + scalar const& s, cuda::stream_ref stream, rmm::device_async_resource_ref mr) { using T = cudf::string_view; auto& h_scalar_type_view = static_cast&>(const_cast(s)); @@ -106,7 +106,7 @@ scalar_as_column_view::return_type scalar_as_column_view::operator() scalar_as_column_view::return_type scalar_as_column_view::operator()( - scalar const& s, rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr) + scalar const& s, cuda::stream_ref stream, rmm::device_async_resource_ref mr) { auto col = make_column_from_scalar(s, 1, stream, mr); return std::pair{col->view(), std::move(col)}; @@ -123,7 +123,7 @@ scalar_as_column_view::return_type scalar_as_column_view::operator() string_null_min_max(scalar const& lhs, column_view const& rhs, binary_operator op, data_type output_type, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { // hard-coded to only work with cudf::string_view so we don't explode compile times @@ -286,7 +286,7 @@ std::unique_ptr string_null_min_max(column_view const& lhs, scalar const& rhs, binary_operator op, data_type output_type, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { // hard-coded to only work with cudf::string_view so we don't explode compile times @@ -303,7 +303,7 @@ std::unique_ptr string_null_min_max(column_view const& lhs, column_view const& rhs, binary_operator op, data_type output_type, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { // hard-coded to only work with cudf::string_view so we don't explode compile times @@ -325,7 +325,7 @@ void operator_dispatcher(mutable_column_view& out, bool is_lhs_scalar, bool is_rhs_scalar, binary_operator op, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { // clang-format off switch (op) { @@ -377,7 +377,7 @@ void binary_operation(mutable_column_view& out, column_view const& lhs, column_view const& rhs, binary_operator op, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { operator_dispatcher(out, lhs, rhs, false, false, op, stream); } @@ -386,7 +386,7 @@ void binary_operation(mutable_column_view& out, scalar const& lhs, column_view const& rhs, binary_operator op, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { auto [lhsv, aux] = scalar_to_column_view(lhs, stream); operator_dispatcher(out, lhsv, rhs, true, false, op, stream); @@ -396,7 +396,7 @@ void binary_operation(mutable_column_view& out, column_view const& lhs, scalar const& rhs, binary_operator op, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { auto [rhsv, aux] = scalar_to_column_view(rhs, stream); operator_dispatcher(out, lhs, rhsv, false, true, op, stream); @@ -409,7 +409,7 @@ void apply_sorting_struct_binary_op(mutable_column_view& out, bool is_lhs_scalar, bool is_rhs_scalar, binary_operator op, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { CUDF_EXPECTS(lhs.type().id() == type_id::STRUCT && rhs.type().id() == type_id::STRUCT, "Both columns must be struct columns"); diff --git a/cpp/src/binaryop/compiled/binary_ops.cuh b/cpp/src/binaryop/compiled/binary_ops.cuh index b6ae1122b4ce..37d6ae31b3d4 100644 --- a/cpp/src/binaryop/compiled/binary_ops.cuh +++ b/cpp/src/binaryop/compiled/binary_ops.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -14,11 +14,11 @@ #include #include -#include #include #include #include +#include namespace cudf { namespace binops { @@ -244,7 +244,7 @@ void apply_binary_op(mutable_column_view& out, column_view const& rhs, bool is_lhs_scalar, bool is_rhs_scalar, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { auto common_dtype = get_common_type(out.type(), lhs.type(), rhs.type()); diff --git a/cpp/src/binaryop/compiled/binary_ops.hpp b/cpp/src/binaryop/compiled/binary_ops.hpp index e1779cf5f967..76b24620d1a6 100644 --- a/cpp/src/binaryop/compiled/binary_ops.hpp +++ b/cpp/src/binaryop/compiled/binary_ops.hpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2018-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2018-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -10,7 +10,7 @@ #include #include -#include +#include #include @@ -26,21 +26,21 @@ std::unique_ptr string_null_min_max(scalar const& lhs, column_view const& rhs, binary_operator op, data_type output_type, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); std::unique_ptr string_null_min_max(column_view const& lhs, scalar const& rhs, binary_operator op, data_type output_type, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); std::unique_ptr string_null_min_max(column_view const& lhs, column_view const& rhs, binary_operator op, data_type output_type, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -66,7 +66,7 @@ std::unique_ptr binary_operation(scalar const& lhs, column_view const& rhs, binary_operator op, data_type output_type, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -92,7 +92,7 @@ std::unique_ptr binary_operation(column_view const& lhs, scalar const& rhs, binary_operator op, data_type output_type, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -117,24 +117,24 @@ std::unique_ptr binary_operation(column_view const& lhs, column_view const& rhs, binary_operator op, data_type output_type, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); void binary_operation(mutable_column_view& out, scalar const& lhs, column_view const& rhs, binary_operator op, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); void binary_operation(mutable_column_view& out, column_view const& lhs, scalar const& rhs, binary_operator op, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); void binary_operation(mutable_column_view& out, column_view const& lhs, column_view const& rhs, binary_operator op, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); // Defined in util.cpp /** @@ -178,7 +178,7 @@ void apply_binary_op(mutable_column_view& out, column_view const& rhs, bool is_lhs_scalar, bool is_rhs_scalar, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); /** * @brief Deploys single type or double type dispatcher that runs equality operation on each element * of @p lhs and @p rhs columns. @@ -202,7 +202,7 @@ void dispatch_equality_op(mutable_column_view& out, bool is_lhs_scalar, bool is_rhs_scalar, binary_operator op, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); } // namespace compiled } // namespace binops } // namespace cudf diff --git a/cpp/src/binaryop/compiled/equality_ops.cu b/cpp/src/binaryop/compiled/equality_ops.cu index a6b1a7901b50..8303fb43a657 100644 --- a/cpp/src/binaryop/compiled/equality_ops.cu +++ b/cpp/src/binaryop/compiled/equality_ops.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -14,7 +14,7 @@ void dispatch_equality_op(mutable_column_view& out, bool is_lhs_scalar, bool is_rhs_scalar, binary_operator op, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { CUDF_EXPECTS(op == binary_operator::EQUAL || op == binary_operator::NOT_EQUAL, "Unsupported operator for these types", diff --git a/cpp/src/binaryop/compiled/struct_binary_ops.cuh b/cpp/src/binaryop/compiled/struct_binary_ops.cuh index 18f4a193b4cd..f8e752b8e6eb 100644 --- a/cpp/src/binaryop/compiled/struct_binary_ops.cuh +++ b/cpp/src/binaryop/compiled/struct_binary_ops.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -15,10 +15,10 @@ #include #include -#include #include #include +#include #include namespace cudf::binops::compiled::detail { @@ -62,7 +62,7 @@ void apply_struct_binary_op(mutable_column_view& out, bool is_lhs_scalar, bool is_rhs_scalar, PhysicalElementComparator comparator, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { auto const compare_orders = std::vector( lhs.size(), @@ -137,7 +137,7 @@ void apply_struct_equality_op(mutable_column_view& out, bool is_rhs_scalar, binary_operator op, PhysicalEqualityComparator comparator, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { CUDF_EXPECTS(op == binary_operator::EQUAL || op == binary_operator::NOT_EQUAL || op == binary_operator::NULL_EQUALS || op == binary_operator::NULL_NOT_EQUALS, diff --git a/cpp/src/dictionary/replace.cu b/cpp/src/dictionary/replace.cu index 77a5b17a381d..24d007647087 100644 --- a/cpp/src/dictionary/replace.cu +++ b/cpp/src/dictionary/replace.cu @@ -66,7 +66,7 @@ std::unique_ptr replace_indices(column_view const& input, /** * @copydoc cudf::dictionary::detail::replace_nulls(cudf::column_view const&,cudf::column_view - * const& cuda::stream_ref, rmm::device_async_resource_ref) + * const&, cuda::stream_ref, rmm::device_async_resource_ref) */ std::unique_ptr replace_nulls(dictionary_column_view const& input, dictionary_column_view const& replacement, diff --git a/cpp/src/groupby/common/m2_var_std.cu b/cpp/src/groupby/common/m2_var_std.cu index 101965dbef79..596be8c49004 100644 --- a/cpp/src/groupby/common/m2_var_std.cu +++ b/cpp/src/groupby/common/m2_var_std.cu @@ -12,12 +12,12 @@ #include #include -#include #include #include #include #include +#include #include namespace cudf::groupby::detail { @@ -44,7 +44,7 @@ struct m2_functor { SumType const* sum, CountType const* count, size_type size, - rmm::cuda_stream_view stream) const noexcept + cuda::stream_ref stream) const noexcept { thrust::tabulate(rmm::exec_policy_nosync(stream, cudf::get_current_device_resource_ref()), target, @@ -64,7 +64,7 @@ struct m2_functor { column_view const& sum_sqr, column_view const& sum, column_view const& count, - rmm::cuda_stream_view stream) const noexcept // + cuda::stream_ref stream) const noexcept // requires(is_m2_supported()) { using Target = cudf::detail::target_type_t; @@ -89,7 +89,7 @@ std::unique_ptr compute_m2(data_type source_type, column_view const& sum_sqr, column_view const& sum, column_view const& count, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { auto output = make_numeric_column(cudf::detail::target_type(source_type, aggregation::M2), @@ -123,7 +123,7 @@ void check_input_types(column_view const& m2, column_view const& count) template std::unique_ptr compute_variance_std(TransformFunc&& transform_fn, size_type size, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { auto output = make_numeric_column( @@ -152,7 +152,7 @@ std::unique_ptr compute_variance_std(TransformFunc&& transform_fn, std::unique_ptr compute_variance(column_view const& m2, column_view const& count, size_type ddof, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { check_input_types(m2, count); @@ -171,7 +171,7 @@ std::unique_ptr compute_variance(column_view const& m2, std::unique_ptr compute_std(column_view const& m2, column_view const& count, size_type ddof, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { check_input_types(m2, count); diff --git a/cpp/src/groupby/common/m2_var_std.hpp b/cpp/src/groupby/common/m2_var_std.hpp index df00c3064d8b..704c2a23d057 100644 --- a/cpp/src/groupby/common/m2_var_std.hpp +++ b/cpp/src/groupby/common/m2_var_std.hpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -8,28 +8,29 @@ #include #include -#include #include +#include + namespace cudf::groupby::detail { std::unique_ptr compute_m2(data_type source_type, column_view const& sum_sqr, column_view const& sum, column_view const& count, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); std::unique_ptr compute_variance(column_view const& m2, column_view const& count, size_type ddof, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); std::unique_ptr compute_std(column_view const& m2, column_view const& count, size_type ddof, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); } // namespace cudf::groupby::detail diff --git a/cpp/src/groupby/common/utils.cpp b/cpp/src/groupby/common/utils.cpp index 93eb7029e28f..a1d91e78b93a 100644 --- a/cpp/src/groupby/common/utils.cpp +++ b/cpp/src/groupby/common/utils.cpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -12,7 +12,7 @@ namespace cudf::groupby::detail { std::pair compute_row_bitmask(table_view const& keys, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { auto const mr = cudf::get_current_device_resource_ref(); if (keys.num_columns() == 0 || !cudf::has_nulls(keys)) { diff --git a/cpp/src/groupby/common/utils.hpp b/cpp/src/groupby/common/utils.hpp index a9138ea8f6f2..1709ff535527 100644 --- a/cpp/src/groupby/common/utils.hpp +++ b/cpp/src/groupby/common/utils.hpp @@ -13,9 +13,10 @@ #include #include -#include #include +#include + #include #include #include @@ -26,7 +27,7 @@ namespace cudf::groupby::detail { template inline std::vector extract_results(std::span requests, cudf::detail::result_cache& cache, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { std::vector results(requests.size()); @@ -58,8 +59,8 @@ inline std::vector extract_results(std::span compute_row_bitmask( - table_view const& keys, rmm::cuda_stream_view stream); +std::pair compute_row_bitmask(table_view const& keys, + cuda::stream_ref stream); /// Whether the given aggregation kind is supported by hash-based groupby. constexpr bool is_hash_aggregation(aggregation::Kind k) diff --git a/cpp/src/groupby/groupby.cu b/cpp/src/groupby/groupby.cu index cf61064724f8..6daf81a403ba 100644 --- a/cpp/src/groupby/groupby.cu +++ b/cpp/src/groupby/groupby.cu @@ -27,9 +27,8 @@ #include #include -#include - #include +#include #include #include @@ -53,7 +52,7 @@ groupby::groupby(table_view const& keys, // Select hash vs. sort groupby implementation std::pair, std::vector> groupby::dispatch_aggregation( std::span requests, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { // If sort groupby has been called once on this groupby object, then @@ -88,7 +87,7 @@ namespace { struct empty_column_constructor { column_view values; aggregation const& agg; - rmm::cuda_stream_view stream; + cuda::stream_ref stream; rmm::device_async_resource_ref mr; template @@ -155,7 +154,7 @@ struct empty_column_constructor { /// Make an empty table with appropriate types for requested aggs template auto empty_results(std::span requests, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { std::vector empty_results; @@ -219,7 +218,7 @@ void verify_valid_requests(std::span requests) // Compute aggregation requests std::pair, std::vector> groupby::aggregate( std::span requests, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); @@ -239,7 +238,7 @@ std::pair, std::vector> groupby::aggr // Compute scan requests std::pair, std::vector> groupby::scan( std::span requests, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); @@ -259,7 +258,7 @@ std::pair, std::vector> groupby::scan } groupby::groups groupby::get_groups(table_view values, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); @@ -285,7 +284,7 @@ groupby::groups groupby::get_groups(table_view values, std::pair, std::unique_ptr
> groupby::replace_nulls( table_view const& values, std::span replace_policies, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); @@ -329,7 +328,7 @@ std::pair, std::unique_ptr
> groupby::shift( table_view const& values, std::span offsets, std::vector> const& fill_values, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); diff --git a/cpp/src/groupby/hash/compute_global_memory_aggs.cu b/cpp/src/groupby/hash/compute_global_memory_aggs.cu index 15852d98f005..bd979be593cc 100644 --- a/cpp/src/groupby/hash/compute_global_memory_aggs.cu +++ b/cpp/src/groupby/hash/compute_global_memory_aggs.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -16,7 +16,7 @@ compute_global_memory_aggs(bitmask_type const* row_bitmask, host_span h_agg_kinds, device_span d_agg_kinds, std::span is_agg_intermediate, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); } // namespace cudf::groupby::detail::hash diff --git a/cpp/src/groupby/hash/compute_global_memory_aggs.cuh b/cpp/src/groupby/hash/compute_global_memory_aggs.cuh index 8f9aebca532d..9a74369d35b7 100644 --- a/cpp/src/groupby/hash/compute_global_memory_aggs.cuh +++ b/cpp/src/groupby/hash/compute_global_memory_aggs.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -12,10 +12,10 @@ #include #include -#include #include #include +#include #include #include @@ -41,7 +41,7 @@ template rmm::device_uvector compute_matching_keys(bitmask_type const* row_bitmask, SetRef set_ref, size_type num_rows, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { // Mapping from each row in the input key/value into the indices of the key. rmm::device_uvector key_indices(num_rows, stream); @@ -78,7 +78,7 @@ std::pair, rmm::device_uvector> compute_aggs_d host_span h_agg_kinds, device_span d_agg_kinds, std::span is_agg_intermediate, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { auto const num_rows = values.num_rows(); @@ -127,7 +127,7 @@ std::pair, rmm::device_uvector> compute_aggs_s host_span h_agg_kinds, device_span d_agg_kinds, std::span is_agg_intermediate, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { auto const num_rows = values.num_rows(); @@ -164,7 +164,7 @@ std::pair, rmm::device_uvector> compute_global host_span h_agg_kinds, device_span d_agg_kinds, std::span is_agg_intermediate, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { return h_agg_kinds.size() > GROUPBY_DENSE_OUTPUT_THRESHOLD diff --git a/cpp/src/groupby/hash/compute_global_memory_aggs.hpp b/cpp/src/groupby/hash/compute_global_memory_aggs.hpp index ef9d730d7118..01a163d886c1 100644 --- a/cpp/src/groupby/hash/compute_global_memory_aggs.hpp +++ b/cpp/src/groupby/hash/compute_global_memory_aggs.hpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ #pragma once @@ -9,9 +9,10 @@ #include #include -#include #include +#include + #include #include #include @@ -26,6 +27,6 @@ std::pair, rmm::device_uvector> compute_global host_span h_agg_kinds, device_span d_agg_kinds, std::span is_agg_intermediate, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); } // namespace cudf::groupby::detail::hash diff --git a/cpp/src/groupby/hash/compute_global_memory_aggs_null.cu b/cpp/src/groupby/hash/compute_global_memory_aggs_null.cu index d50c7d302710..a2359fb5581e 100644 --- a/cpp/src/groupby/hash/compute_global_memory_aggs_null.cu +++ b/cpp/src/groupby/hash/compute_global_memory_aggs_null.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -16,7 +16,7 @@ compute_global_memory_aggs(bitmask_type const* row_bitmas host_span h_agg_kinds, device_span d_agg_kinds, std::span is_agg_intermediate, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); } // namespace cudf::groupby::detail::hash diff --git a/cpp/src/groupby/hash/compute_groupby.cu b/cpp/src/groupby/hash/compute_groupby.cu index 711b867161b2..32c575a407d8 100644 --- a/cpp/src/groupby/hash/compute_groupby.cu +++ b/cpp/src/groupby/hash/compute_groupby.cu @@ -17,13 +17,13 @@ #include #include -#include #include #include #include #include #include +#include #include namespace cudf::groupby::detail::hash { @@ -54,7 +54,7 @@ std::unique_ptr
compute_groupby(table_view const& keys, Equal const& d_row_equal, Hash const& d_row_hash, cudf::detail::result_cache* cache, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { auto const num_keys = keys.num_rows(); @@ -99,7 +99,7 @@ std::unique_ptr
compute_groupby(table_view const& keys, cuco::thread_scope_device, cuco::storage{}, rmm::mr::polymorphic_allocator{}, - stream.value()}; + stream.get()}; auto const gather_keys = [&](auto const& gather_map) { return cudf::detail::gather(keys, @@ -122,7 +122,7 @@ std::unique_ptr
compute_groupby(table_view const& keys, rmm::device_uvector unique_key_indices( num_keys, stream, cudf::get_current_device_resource_ref()); - auto const keys_end = set.retrieve_all(unique_key_indices.begin(), stream.value()); + auto const keys_end = set.retrieve_all(unique_key_indices.begin(), stream.get()); auto const key_gather_map = device_span{ unique_key_indices.data(), static_cast(cuda::std::distance(unique_key_indices.begin(), keys_end))}; @@ -161,7 +161,7 @@ template std::unique_ptr
compute_groupby( row_comparator_t const& d_row_equal, row_hash_t const& d_row_hash, cudf::detail::result_cache* cache, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); template std::unique_ptr
compute_groupby( @@ -171,6 +171,6 @@ template std::unique_ptr
compute_groupby #include -#include #include +#include + #include namespace cudf::groupby::detail::hash { @@ -47,6 +48,6 @@ std::unique_ptr compute_groupby(table_view const& keys, Equal const& d_row_equal, Hash const& d_row_hash, cudf::detail::result_cache* cache, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); } // namespace cudf::groupby::detail::hash diff --git a/cpp/src/groupby/hash/compute_mapping_indices.cu b/cpp/src/groupby/hash/compute_mapping_indices.cu index b83d0ced7a20..49b5085a39d2 100644 --- a/cpp/src/groupby/hash/compute_mapping_indices.cu +++ b/cpp/src/groupby/hash/compute_mapping_indices.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -18,5 +18,5 @@ template void compute_mapping_indices> size_type* global_mapping_index, size_type* block_cardinality, cuda::std::atomic_flag* needs_global_memory_fallback, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); } // namespace cudf::groupby::detail::hash diff --git a/cpp/src/groupby/hash/compute_mapping_indices.cuh b/cpp/src/groupby/hash/compute_mapping_indices.cuh index bdf42b1c72fa..f3d929e9a7c0 100644 --- a/cpp/src/groupby/hash/compute_mapping_indices.cuh +++ b/cpp/src/groupby/hash/compute_mapping_indices.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ #pragma once @@ -12,11 +12,10 @@ #include #include -#include - #include #include #include +#include #include @@ -169,9 +168,9 @@ void compute_mapping_indices(size_type grid_size, size_type* global_mapping_indices, size_type* block_cardinality, cuda::std::atomic_flag* needs_global_memory_fallback, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { - mapping_indices_kernel<<>>( + mapping_indices_kernel<<>>( num_rows, global_set, row_bitmask, diff --git a/cpp/src/groupby/hash/compute_mapping_indices.hpp b/cpp/src/groupby/hash/compute_mapping_indices.hpp index e6daacd101e7..fcda23b92fcb 100644 --- a/cpp/src/groupby/hash/compute_mapping_indices.hpp +++ b/cpp/src/groupby/hash/compute_mapping_indices.hpp @@ -1,14 +1,13 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ #pragma once #include -#include - #include +#include namespace cudf::groupby::detail::hash { @@ -28,5 +27,5 @@ void compute_mapping_indices(size_type grid_size, size_type* global_mapping_index, size_type* block_cardinality, cuda::std::atomic_flag* needs_global_memory_fallback, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); } // namespace cudf::groupby::detail::hash diff --git a/cpp/src/groupby/hash/compute_mapping_indices_null.cu b/cpp/src/groupby/hash/compute_mapping_indices_null.cu index 0756e160811f..38bd3647c420 100644 --- a/cpp/src/groupby/hash/compute_mapping_indices_null.cu +++ b/cpp/src/groupby/hash/compute_mapping_indices_null.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -19,5 +19,5 @@ template void compute_mapping_indices #include -#include - #include #include #include #include #include +#include #include #include @@ -384,7 +383,7 @@ void compute_shared_memory_aggs(cudf::size_type grid_size, cudf::table_device_view input_values, cudf::mutable_table_device_view output_values, cudf::aggregation::Kind const* d_agg_kinds, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { // For each aggregation, need one offset determining where the aggregation is // performed, another indicating the validity of the aggregation @@ -393,17 +392,19 @@ void compute_shared_memory_aggs(cudf::size_type grid_size, CUDF_EXPECTS(available_shmem_size > offsets_size * 2, "No enough space for shared memory aggregations"); auto const shmem_agg_size = available_shmem_size - offsets_size * 2; - single_pass_shmem_aggs_kernel<<>>( - num_input_rows, - row_bitmask, - local_mapping_index, - global_mapping_index, - block_cardinality, - input_values, - output_values, - d_agg_kinds, - shmem_agg_size, - offsets_size); + single_pass_shmem_aggs_kernel<<>>(num_input_rows, + row_bitmask, + local_mapping_index, + global_mapping_index, + block_cardinality, + input_values, + output_values, + d_agg_kinds, + shmem_agg_size, + offsets_size); CUDF_CUDA_TRY(cudaGetLastError()); } } // namespace cudf::groupby::detail::hash diff --git a/cpp/src/groupby/hash/compute_shared_memory_aggs.hpp b/cpp/src/groupby/hash/compute_shared_memory_aggs.hpp index 1d1dcc5cf623..b3ffaefe605d 100644 --- a/cpp/src/groupby/hash/compute_shared_memory_aggs.hpp +++ b/cpp/src/groupby/hash/compute_shared_memory_aggs.hpp @@ -8,7 +8,7 @@ #include #include -#include +#include #include @@ -37,5 +37,5 @@ void compute_shared_memory_aggs(size_type grid_size, table_device_view input_values, mutable_table_device_view output_values, aggregation::Kind const* d_agg_kinds, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); } // namespace cudf::groupby::detail::hash diff --git a/cpp/src/groupby/hash/compute_single_pass_aggs.cu b/cpp/src/groupby/hash/compute_single_pass_aggs.cu index 53b0b4fd99de..33c745739bab 100644 --- a/cpp/src/groupby/hash/compute_single_pass_aggs.cu +++ b/cpp/src/groupby/hash/compute_single_pass_aggs.cu @@ -42,7 +42,7 @@ template std::pair, bool> compute_single_pass_agg bitmask_type const* row_bitmask, std::span requests, cudf::detail::result_cache* cache, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); } // namespace cudf::groupby::detail::hash diff --git a/cpp/src/groupby/hash/compute_single_pass_aggs.cuh b/cpp/src/groupby/hash/compute_single_pass_aggs.cuh index 39fd7611e317..431043ace3b8 100644 --- a/cpp/src/groupby/hash/compute_single_pass_aggs.cuh +++ b/cpp/src/groupby/hash/compute_single_pass_aggs.cuh @@ -18,12 +18,12 @@ #include #include -#include #include #include #include #include +#include #include namespace cudf::groupby::detail::hash { @@ -34,7 +34,7 @@ std::pair, bool> compute_single_pass_aggs( bitmask_type const* row_bitmask, std::span requests, cudf::detail::result_cache* cache, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { // Collect the single-pass aggregations that can be processed in this function. @@ -95,7 +95,7 @@ std::pair, bool> compute_single_pass_aggs( // Flag indicating whether a global memory aggregation fallback is required or not. rmm::device_scalar needs_global_memory_fallback(stream); CUDF_CUDA_TRY(cudaMemsetAsync( - needs_global_memory_fallback.data(), 0, sizeof(cuda::std::atomic_flag), stream.value())); + needs_global_memory_fallback.data(), 0, sizeof(cuda::std::atomic_flag), stream.get())); auto set_ref_insert = global_set.ref(cuco::op::insert_and_find); compute_mapping_indices(grid_size, @@ -116,7 +116,7 @@ std::pair, bool> compute_single_pass_aggs( needs_global_memory_fallback.data(), sizeof(cuda::std::atomic_flag), stream)); - stream.synchronize(); + stream.sync(); return h_needs_fallback.test(cuda::std::memory_order_relaxed); }(); if (needs_fallback) { return run_aggs_by_global_mem_kernel(); } diff --git a/cpp/src/groupby/hash/compute_single_pass_aggs.hpp b/cpp/src/groupby/hash/compute_single_pass_aggs.hpp index 26e6e182ab7c..51ff564e90d2 100644 --- a/cpp/src/groupby/hash/compute_single_pass_aggs.hpp +++ b/cpp/src/groupby/hash/compute_single_pass_aggs.hpp @@ -9,9 +9,10 @@ #include #include -#include #include +#include + namespace cudf::groupby::detail::hash { /** @@ -40,7 +41,7 @@ std::pair, bool> compute_single_pass_aggs( bitmask_type const* row_bitmask, std::span requests, cudf::detail::result_cache* cache, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); } // namespace cudf::groupby::detail::hash diff --git a/cpp/src/groupby/hash/compute_single_pass_aggs_null.cu b/cpp/src/groupby/hash/compute_single_pass_aggs_null.cu index 05d21df2b77e..0181c2576678 100644 --- a/cpp/src/groupby/hash/compute_single_pass_aggs_null.cu +++ b/cpp/src/groupby/hash/compute_single_pass_aggs_null.cu @@ -12,6 +12,6 @@ compute_single_pass_aggs(nullable_global_set_t& global_se bitmask_type const* row_bitmask, std::span requests, cudf::detail::result_cache* cache, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); } // namespace cudf::groupby::detail::hash diff --git a/cpp/src/groupby/hash/extract_single_pass_aggs.cpp b/cpp/src/groupby/hash/extract_single_pass_aggs.cpp index cd20826bcbe8..871943967e36 100644 --- a/cpp/src/groupby/hash/extract_single_pass_aggs.cpp +++ b/cpp/src/groupby/hash/extract_single_pass_aggs.cpp @@ -113,8 +113,7 @@ std::tuple>, std::vector, bool> -extract_single_pass_aggs(std::span requests, - rmm::cuda_stream_view stream) +extract_single_pass_aggs(std::span requests, cuda::stream_ref stream) { auto agg_kinds = cudf::detail::make_empty_host_vector(requests.size(), stream); std::vector columns; diff --git a/cpp/src/groupby/hash/extract_single_pass_aggs.hpp b/cpp/src/groupby/hash/extract_single_pass_aggs.hpp index b50531c489d7..1d000d97b59d 100644 --- a/cpp/src/groupby/hash/extract_single_pass_aggs.hpp +++ b/cpp/src/groupby/hash/extract_single_pass_aggs.hpp @@ -42,8 +42,7 @@ std::tuple>, std::vector, bool> -extract_single_pass_aggs(std::span requests, - rmm::cuda_stream_view stream); +extract_single_pass_aggs(std::span requests, cuda::stream_ref stream); /** * @brief Get simple aggregations from groupby aggregation diff --git a/cpp/src/groupby/hash/groupby.cu b/cpp/src/groupby/hash/groupby.cu index 161b0384537b..207b8a7b7225 100644 --- a/cpp/src/groupby/hash/groupby.cu +++ b/cpp/src/groupby/hash/groupby.cu @@ -21,7 +21,7 @@ #include #include -#include +#include #include #include @@ -35,7 +35,7 @@ std::unique_ptr
dispatch_groupby(table_view const& keys, cudf::detail::result_cache* cache, bool const keys_have_nulls, null_policy const include_null_keys, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { auto const null_keys_are_equal = null_equality::EQUAL; @@ -134,7 +134,7 @@ std::pair, std::vector> groupby( table_view const& keys, std::span requests, null_policy include_null_keys, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { cudf::detail::result_cache cache(requests.size()); diff --git a/cpp/src/groupby/hash/hash_compound_agg_finalizer.cu b/cpp/src/groupby/hash/hash_compound_agg_finalizer.cu index 5766bb3b5b6a..3ed04e31068b 100644 --- a/cpp/src/groupby/hash/hash_compound_agg_finalizer.cu +++ b/cpp/src/groupby/hash/hash_compound_agg_finalizer.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -17,14 +17,14 @@ #include #include -#include +#include namespace cudf::groupby::detail::hash { hash_compound_agg_finalizer::hash_compound_agg_finalizer(column_view const& col, cudf::detail::result_cache* cache, bitmask_type const* d_row_bitmask, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) : col{col}, input_type{is_dictionary(col.type()) ? dictionary_column_view(col).keys().type() : col.type()}, diff --git a/cpp/src/groupby/hash/hash_compound_agg_finalizer.hpp b/cpp/src/groupby/hash/hash_compound_agg_finalizer.hpp index 5ebad95a1ce7..c98f93e5994d 100644 --- a/cpp/src/groupby/hash/hash_compound_agg_finalizer.hpp +++ b/cpp/src/groupby/hash/hash_compound_agg_finalizer.hpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ #pragma once @@ -19,13 +19,13 @@ struct hash_compound_agg_finalizer { data_type const input_type; cudf::detail::result_cache* const cache; bitmask_type const* const d_row_bitmask; - rmm::cuda_stream_view const stream; + cuda::stream_ref const stream; rmm::device_async_resource_ref const mr; hash_compound_agg_finalizer(column_view const& col, cudf::detail::result_cache* cache, bitmask_type const* d_row_bitmask, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); // Default case: no-op diff --git a/cpp/src/groupby/hash/output_utils.cu b/cpp/src/groupby/hash/output_utils.cu index 2e5d1ec97b41..613961b51bf2 100644 --- a/cpp/src/groupby/hash/output_utils.cu +++ b/cpp/src/groupby/hash/output_utils.cu @@ -17,12 +17,12 @@ #include #include -#include #include #include #include #include +#include #include #include @@ -48,11 +48,11 @@ namespace { */ struct result_column_creator { size_type output_size; - rmm::cuda_stream_view stream; + cuda::stream_ref stream; rmm::device_async_resource_ref mr; explicit result_column_creator(size_type output_size_, - rmm::cuda_stream_view stream_, + cuda::stream_ref stream_, rmm::device_async_resource_ref mr_) : output_size{output_size_}, stream{stream_}, mr{mr_} { @@ -116,7 +116,7 @@ std::unique_ptr
create_results_table(size_type output_size, table_view const& values, host_span agg_kinds, std::span is_agg_intermediate, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { CUDF_EXPECTS(values.num_columns() == static_cast(agg_kinds.size()), @@ -139,11 +139,11 @@ std::unique_ptr
create_results_table(size_type output_size, template rmm::device_uvector extract_populated_keys(SetType const& key_set, size_type num_total_keys, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { rmm::device_uvector unique_key_indices(num_total_keys, stream, mr); - auto const keys_end = key_set.retrieve_all(unique_key_indices.begin(), stream.value()); + auto const keys_end = key_set.retrieve_all(unique_key_indices.begin(), stream.get()); unique_key_indices.resize(std::distance(unique_key_indices.begin(), keys_end), stream); return unique_key_indices; } @@ -151,19 +151,19 @@ rmm::device_uvector extract_populated_keys(SetType const& key_set, template rmm::device_uvector extract_populated_keys( global_set_t const& key_set, size_type num_total_keys, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); template rmm::device_uvector extract_populated_keys( nullable_global_set_t const& key_set, size_type num_total_keys, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); rmm::device_uvector compute_key_transform_map( size_type num_total_keys, device_span unique_key_indices, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { // Map from old key indices (index of the keys in the original input keys table) to new key @@ -181,7 +181,7 @@ rmm::device_uvector compute_key_transform_map( rmm::device_uvector compute_target_indices(device_span input, device_span transform_map, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { rmm::device_uvector target_indices(input.size(), stream, mr); @@ -199,7 +199,7 @@ void finalize_output(table_view const& values, std::vector> const& aggregations, std::unique_ptr
& agg_results, cudf::detail::result_cache* cache, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { auto result_cols = agg_results->release(); auto const null_counts = [&]() -> std::vector { diff --git a/cpp/src/groupby/hash/output_utils.hpp b/cpp/src/groupby/hash/output_utils.hpp index 27ba8dbc5b6b..e4607e181ba1 100644 --- a/cpp/src/groupby/hash/output_utils.hpp +++ b/cpp/src/groupby/hash/output_utils.hpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -12,9 +12,10 @@ #include #include -#include #include +#include + #include #include #include @@ -42,7 +43,7 @@ std::unique_ptr
create_results_table(size_type output_size, table_view const& values, host_span agg_kinds, std::span is_agg_intermediate, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -59,7 +60,7 @@ std::unique_ptr
create_results_table(size_type output_size, template rmm::device_uvector extract_populated_keys(SetType const& key_set, size_type num_total_keys, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -78,7 +79,7 @@ rmm::device_uvector extract_populated_keys(SetType const& key_set, rmm::device_uvector compute_key_transform_map( size_type num_total_keys, device_span unique_key_indices, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -96,7 +97,7 @@ rmm::device_uvector compute_key_transform_map( */ rmm::device_uvector compute_target_indices(device_span input, device_span transform_map, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -113,6 +114,6 @@ void finalize_output(table_view const& values, std::vector> const& aggregations, std::unique_ptr
& agg_results, cudf::detail::result_cache* cache, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); } // namespace cudf::groupby::detail::hash diff --git a/cpp/src/groupby/sort/aggregate.cpp b/cpp/src/groupby/sort/aggregate.cpp index e23fa0be179e..a10c73206eff 100644 --- a/cpp/src/groupby/sort/aggregate.cpp +++ b/cpp/src/groupby/sort/aggregate.cpp @@ -26,7 +26,7 @@ #include #include -#include +#include #include #include @@ -47,7 +47,7 @@ namespace { */ auto column_view_with_common_nulls(column_view const& column_0, column_view const& column_1, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { auto [new_nullmask, null_count] = cudf::bitmask_and( table_view{{column_0, column_1}}, stream, cudf::get_current_device_resource_ref()); @@ -878,7 +878,7 @@ void aggregate_result_functor::operator()(aggregation con // Sort-based groupby std::pair, std::vector> groupby::sort_aggregate( std::span requests, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { // We're going to start by creating a cache of results so that aggs that diff --git a/cpp/src/groupby/sort/functors.hpp b/cpp/src/groupby/sort/functors.hpp index 25588626bc2a..6d1d79815bde 100644 --- a/cpp/src/groupby/sort/functors.hpp +++ b/cpp/src/groupby/sort/functors.hpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ #pragma once @@ -11,7 +11,7 @@ #include #include -#include +#include #include @@ -31,7 +31,7 @@ struct store_result_functor { store_result_functor(column_view const& values, sort::sort_groupby_helper& helper, cudf::detail::result_cache& cache, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr, sorted keys_are_sorted = sorted::NO) : helper(helper), @@ -88,7 +88,7 @@ struct store_result_functor { cudf::detail::result_cache& cache; ///< cache of results to store into column_view const& values; ///< Column of values to group and aggregate - rmm::cuda_stream_view stream; ///< CUDA stream on which to execute kernels + cuda::stream_ref stream; ///< CUDA stream on which to execute kernels rmm::device_async_resource_ref mr; ///< Memory resource to allocate space for results sorted keys_are_sorted; ///< Whether the keys are sorted diff --git a/cpp/src/groupby/sort/group_argmax.cu b/cpp/src/groupby/sort/group_argmax.cu index fccae54c659c..9d8b3f43a7ff 100644 --- a/cpp/src/groupby/sort/group_argmax.cu +++ b/cpp/src/groupby/sort/group_argmax.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2020-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2020-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -9,8 +9,7 @@ #include #include -#include - +#include #include namespace cudf { @@ -20,7 +19,7 @@ std::unique_ptr group_argmax(column_view const& values, size_type num_groups, cudf::device_span group_labels, column_view const& key_sort_order, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { auto dispatch_type = cudf::is_dictionary(values.type()) diff --git a/cpp/src/groupby/sort/group_argmin.cu b/cpp/src/groupby/sort/group_argmin.cu index 4aa56f8fd9be..171f78043a56 100644 --- a/cpp/src/groupby/sort/group_argmin.cu +++ b/cpp/src/groupby/sort/group_argmin.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2020-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2020-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -9,9 +9,9 @@ #include #include -#include #include +#include #include namespace cudf { @@ -21,7 +21,7 @@ std::unique_ptr group_argmin(column_view const& values, size_type num_groups, cudf::device_span group_labels, column_view const& key_sort_order, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { auto dispatch_type = cudf::is_dictionary(values.type()) diff --git a/cpp/src/groupby/sort/group_bitwise.cu b/cpp/src/groupby/sort/group_bitwise.cu index b833580fbc08..860328a31599 100644 --- a/cpp/src/groupby/sort/group_bitwise.cu +++ b/cpp/src/groupby/sort/group_bitwise.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -14,11 +14,11 @@ #include #include -#include #include #include #include +#include namespace cudf::groupby::detail { @@ -30,7 +30,7 @@ struct bitwise_group_reduction_functor { column_view const& values, device_span group_labels, size_type num_groups, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const { @@ -93,7 +93,7 @@ std::unique_ptr group_bitwise(bitwise_op bit_op, column_view const& values, device_span group_labels, size_type num_groups, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { return cudf::type_dispatcher(values.type(), diff --git a/cpp/src/groupby/sort/group_collect.cu b/cpp/src/groupby/sort/group_collect.cu index 992cca53a456..d4dc1dce7d36 100644 --- a/cpp/src/groupby/sort/group_collect.cu +++ b/cpp/src/groupby/sort/group_collect.cu @@ -12,9 +12,8 @@ #include #include -#include - #include +#include #include #include #include @@ -39,7 +38,7 @@ std::pair, std::unique_ptr> purge_null_entries( column_view const& values, column_view const& offsets, size_type num_groups, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { auto values_device_view = column_device_view::create(values, stream); @@ -80,7 +79,7 @@ std::unique_ptr group_collect(column_view const& values, cudf::device_span group_offsets, size_type num_groups, null_policy null_handling, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { auto [child_column, diff --git a/cpp/src/groupby/sort/group_correlation.cu b/cpp/src/groupby/sort/group_correlation.cu index 18140d363230..1799c1179fcf 100644 --- a/cpp/src/groupby/sort/group_correlation.cu +++ b/cpp/src/groupby/sort/group_correlation.cu @@ -16,11 +16,11 @@ #include #include -#include #include #include #include +#include #include #include @@ -107,7 +107,7 @@ std::unique_ptr group_covariance(column_view const& values_0, column_view const& mean_1, size_type min_periods, size_type ddof, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { using result_type = id_to_type; @@ -169,7 +169,7 @@ std::unique_ptr group_covariance(column_view const& values_0, std::unique_ptr group_correlation(column_view const& covariance, column_view const& stddev_0, column_view const& stddev_1, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { using result_type = id_to_type; diff --git a/cpp/src/groupby/sort/group_count.cu b/cpp/src/groupby/sort/group_count.cu index 822ebca0909b..f9e7a11f52c0 100644 --- a/cpp/src/groupby/sort/group_count.cu +++ b/cpp/src/groupby/sort/group_count.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -11,11 +11,11 @@ #include #include -#include #include #include #include +#include #include #include @@ -25,7 +25,7 @@ namespace detail { std::unique_ptr group_count_valid(column_view const& values, cudf::device_span group_labels, size_type num_groups, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { CUDF_EXPECTS(num_groups >= 0, "number of groups cannot be negative"); @@ -70,7 +70,7 @@ std::unique_ptr group_count_valid(column_view const& values, std::unique_ptr group_count_all(cudf::device_span group_offsets, size_type num_groups, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { CUDF_EXPECTS(num_groups >= 0, "number of groups cannot be negative"); diff --git a/cpp/src/groupby/sort/group_count_scan.cu b/cpp/src/groupby/sort/group_count_scan.cu index 1fc60b9583a8..be4eab3c7ef5 100644 --- a/cpp/src/groupby/sort/group_count_scan.cu +++ b/cpp/src/groupby/sort/group_count_scan.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -12,10 +12,10 @@ #include #include -#include #include #include +#include #include namespace cudf { @@ -24,7 +24,7 @@ namespace detail { std::unique_ptr count_scan(column_view const& values, null_policy nulls, cudf::device_span group_labels, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { std::unique_ptr result = make_fixed_width_column( diff --git a/cpp/src/groupby/sort/group_histogram.cu b/cpp/src/groupby/sort/group_histogram.cu index 29f204481557..4cc4274f1169 100644 --- a/cpp/src/groupby/sort/group_histogram.cu +++ b/cpp/src/groupby/sort/group_histogram.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -27,7 +27,7 @@ std::unique_ptr build_histogram(column_view const& values, cudf::device_span group_labels, std::optional const& partial_counts, size_type num_groups, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { CUDF_EXPECTS(static_cast(values.size()) == group_labels.size(), @@ -77,7 +77,7 @@ std::unique_ptr build_histogram(column_view const& values, std::unique_ptr group_histogram(column_view const& values, cudf::device_span group_labels, size_type num_groups, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { // Empty group should be handled before reaching here. @@ -89,7 +89,7 @@ std::unique_ptr group_histogram(column_view const& values, std::unique_ptr group_merge_histogram(column_view const& values, cudf::device_span group_offsets, size_type num_groups, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { // Empty group should be handled before reaching here. diff --git a/cpp/src/groupby/sort/group_m2.cu b/cpp/src/groupby/sort/group_m2.cu index 44e6c1d294ab..b4743be597d9 100644 --- a/cpp/src/groupby/sort/group_m2.cu +++ b/cpp/src/groupby/sort/group_m2.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -15,11 +15,11 @@ #include #include -#include #include #include #include +#include #include namespace cudf { @@ -52,7 +52,7 @@ void compute_m2_fn(column_device_view const& values, cudf::device_span group_labels, ResultType const* d_means, ResultType* d_result, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { auto m2_fn = m2_transform{ values, values_iter, d_means, group_labels.data()}; @@ -81,7 +81,7 @@ struct m2_functor { std::unique_ptr operator()(column_view const& values, column_view const& group_means, cudf::device_span group_labels, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) requires(std::is_arithmetic_v) { @@ -122,7 +122,7 @@ struct m2_functor { std::unique_ptr group_m2(column_view const& values, column_view const& group_means, cudf::device_span group_labels, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { auto values_type = cudf::is_dictionary(values.type()) diff --git a/cpp/src/groupby/sort/group_max.cu b/cpp/src/groupby/sort/group_max.cu index 872167b573e3..6a2b3edfec95 100644 --- a/cpp/src/groupby/sort/group_max.cu +++ b/cpp/src/groupby/sort/group_max.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -7,7 +7,7 @@ #include -#include +#include namespace cudf { namespace groupby { @@ -15,7 +15,7 @@ namespace detail { std::unique_ptr group_max(column_view const& values, size_type num_groups, cudf::device_span group_labels, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { auto values_type = cudf::is_dictionary(values.type()) diff --git a/cpp/src/groupby/sort/group_max_scan.cu b/cpp/src/groupby/sort/group_max_scan.cu index 6ff927e796fc..8f58f4f514c8 100644 --- a/cpp/src/groupby/sort/group_max_scan.cu +++ b/cpp/src/groupby/sort/group_max_scan.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -7,7 +7,7 @@ #include -#include +#include namespace cudf { namespace groupby { @@ -15,7 +15,7 @@ namespace detail { std::unique_ptr max_scan(column_view const& values, size_type num_groups, cudf::device_span group_labels, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { return type_dispatcher(values.type(), diff --git a/cpp/src/groupby/sort/group_merge_lists.cu b/cpp/src/groupby/sort/group_merge_lists.cu index 7dd04732f22d..8fc75c9f2fe3 100644 --- a/cpp/src/groupby/sort/group_merge_lists.cu +++ b/cpp/src/groupby/sort/group_merge_lists.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -8,9 +8,9 @@ #include #include -#include #include +#include #include namespace cudf { @@ -19,7 +19,7 @@ namespace detail { std::unique_ptr group_merge_lists(column_view const& values, cudf::device_span group_offsets, size_type num_groups, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { CUDF_EXPECTS(values.type().id() == type_id::LIST, diff --git a/cpp/src/groupby/sort/group_merge_m2.cu b/cpp/src/groupby/sort/group_merge_m2.cu index 798ed5b61b91..aba53e492080 100644 --- a/cpp/src/groupby/sort/group_merge_m2.cu +++ b/cpp/src/groupby/sort/group_merge_m2.cu @@ -8,11 +8,11 @@ #include #include -#include #include #include #include +#include #include namespace cudf { @@ -75,7 +75,7 @@ template std::unique_ptr merge_m2(column_view const& values, device_span group_offsets, size_type num_groups, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { auto result_counts = make_numeric_column( @@ -119,7 +119,7 @@ std::unique_ptr merge_m2(column_view const& values, std::unique_ptr group_merge_m2(column_view const& values, device_span group_offsets, size_type num_groups, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { CUDF_EXPECTS(values.type().id() == type_id::STRUCT, diff --git a/cpp/src/groupby/sort/group_min.cu b/cpp/src/groupby/sort/group_min.cu index ccb0130d9b46..fd423967018a 100644 --- a/cpp/src/groupby/sort/group_min.cu +++ b/cpp/src/groupby/sort/group_min.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -7,7 +7,7 @@ #include -#include +#include namespace cudf { namespace groupby { @@ -15,7 +15,7 @@ namespace detail { std::unique_ptr group_min(column_view const& values, size_type num_groups, cudf::device_span group_labels, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { auto values_type = cudf::is_dictionary(values.type()) diff --git a/cpp/src/groupby/sort/group_min_scan.cu b/cpp/src/groupby/sort/group_min_scan.cu index 7b5123a688fd..e7cffe59014a 100644 --- a/cpp/src/groupby/sort/group_min_scan.cu +++ b/cpp/src/groupby/sort/group_min_scan.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -7,7 +7,7 @@ #include -#include +#include namespace cudf { namespace groupby { @@ -15,7 +15,7 @@ namespace detail { std::unique_ptr min_scan(column_view const& values, size_type num_groups, cudf::device_span group_labels, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { return type_dispatcher(values.type(), diff --git a/cpp/src/groupby/sort/group_nth_element.cu b/cpp/src/groupby/sort/group_nth_element.cu index a959572e3215..0fbe013f91a4 100644 --- a/cpp/src/groupby/sort/group_nth_element.cu +++ b/cpp/src/groupby/sort/group_nth_element.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2020-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2020-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -15,11 +15,11 @@ #include #include -#include #include #include #include +#include #include #include #include @@ -36,7 +36,7 @@ std::unique_ptr group_nth_element(column_view const& values, size_type num_groups, size_type n, null_policy null_handling, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { CUDF_EXPECTS(static_cast(values.size()) == group_labels.size(), diff --git a/cpp/src/groupby/sort/group_nunique.cu b/cpp/src/groupby/sort/group_nunique.cu index 96aaa4cace1c..160755cb3018 100644 --- a/cpp/src/groupby/sort/group_nunique.cu +++ b/cpp/src/groupby/sort/group_nunique.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2020-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2020-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -11,10 +11,10 @@ #include #include -#include #include #include +#include #include namespace cudf { @@ -66,7 +66,7 @@ std::unique_ptr group_nunique(column_view const& values, size_type const num_groups, cudf::device_span group_offsets, null_policy null_handling, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { CUDF_EXPECTS(num_groups >= 0, "number of groups cannot be negative"); diff --git a/cpp/src/groupby/sort/group_product.cu b/cpp/src/groupby/sort/group_product.cu index 3d3538651450..ebee7f4e49e0 100644 --- a/cpp/src/groupby/sort/group_product.cu +++ b/cpp/src/groupby/sort/group_product.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -9,7 +9,7 @@ #include #include -#include +#include namespace cudf { namespace groupby { @@ -17,7 +17,7 @@ namespace detail { std::unique_ptr group_product(column_view const& values, size_type num_groups, cudf::device_span group_labels, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { auto values_type = cudf::is_dictionary(values.type()) diff --git a/cpp/src/groupby/sort/group_product_scan.cu b/cpp/src/groupby/sort/group_product_scan.cu index 0f6980397522..a2e28d543939 100644 --- a/cpp/src/groupby/sort/group_product_scan.cu +++ b/cpp/src/groupby/sort/group_product_scan.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -7,7 +7,7 @@ #include -#include +#include namespace cudf { namespace groupby { @@ -15,7 +15,7 @@ namespace detail { std::unique_ptr product_scan(column_view const& values, size_type num_groups, cudf::device_span group_labels, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { return type_dispatcher(values.type(), diff --git a/cpp/src/groupby/sort/group_quantiles.cu b/cpp/src/groupby/sort/group_quantiles.cu index ff3ec6dd38a1..f0044dec93b7 100644 --- a/cpp/src/groupby/sort/group_quantiles.cu +++ b/cpp/src/groupby/sort/group_quantiles.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -17,11 +17,11 @@ #include #include -#include #include #include #include +#include #include #include #include @@ -79,7 +79,7 @@ struct quantiles_functor { size_type const num_groups, device_span quantile, interpolation interpolation, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) requires(std::is_arithmetic_v) { @@ -152,7 +152,7 @@ std::unique_ptr group_quantiles(column_view const& values, size_type const num_groups, std::vector const& quantiles, interpolation interp, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { auto dv_quantiles = cudf::detail::make_device_uvector_async( diff --git a/cpp/src/groupby/sort/group_rank_scan.cu b/cpp/src/groupby/sort/group_rank_scan.cu index 31ed09ff8cd7..f4661a0baa1c 100644 --- a/cpp/src/groupby/sort/group_rank_scan.cu +++ b/cpp/src/groupby/sort/group_rank_scan.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -15,7 +15,6 @@ #include #include -#include #include #include @@ -23,6 +22,7 @@ #include #include #include +#include #include #include @@ -90,7 +90,7 @@ std::unique_ptr rank_generator(column_view const& grouped_values, value_resolver resolver, scan_operator scan_op, bool has_nulls, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { auto const grouped_values_view = table_view{{grouped_values}}; @@ -146,7 +146,7 @@ std::unique_ptr min_rank_scan(column_view const& grouped_values, column_view const& value_order, device_span group_labels, device_span group_offsets, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { return rank_generator( @@ -167,7 +167,7 @@ std::unique_ptr max_rank_scan(column_view const& grouped_values, column_view const& value_order, device_span group_labels, device_span group_offsets, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { return rank_generator( @@ -188,7 +188,7 @@ std::unique_ptr first_rank_scan(column_view const& grouped_values, column_view const&, device_span group_labels, device_span group_offsets, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { auto ranks = make_fixed_width_column( @@ -210,7 +210,7 @@ std::unique_ptr average_rank_scan(column_view const& grouped_values, column_view const& value_order, device_span group_labels, device_span group_offsets, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { auto max_rank = max_rank_scan(grouped_values, @@ -243,7 +243,7 @@ std::unique_ptr dense_rank_scan(column_view const& grouped_values, column_view const& value_order, device_span group_labels, device_span group_offsets, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { return rank_generator( @@ -264,7 +264,7 @@ std::unique_ptr group_rank_to_percentage(rank_method const method, column_view const& count, device_span group_labels, device_span group_offsets, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { CUDF_EXPECTS(percentage != rank_percentage::NONE, "Percentage cannot be NONE"); diff --git a/cpp/src/groupby/sort/group_reductions.hpp b/cpp/src/groupby/sort/group_reductions.hpp index 389a5d7fb535..94c7312b65b0 100644 --- a/cpp/src/groupby/sort/group_reductions.hpp +++ b/cpp/src/groupby/sort/group_reductions.hpp @@ -10,7 +10,7 @@ #include #include -#include +#include #include @@ -41,7 +41,7 @@ namespace detail { std::unique_ptr group_sum(column_view const& values, size_type num_groups, cudf::device_span group_labels, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -61,7 +61,7 @@ std::unique_ptr group_sum(column_view const& values, column_view const& values, size_type num_groups, cudf::device_span group_labels, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -84,7 +84,7 @@ std::unique_ptr group_sum(column_view const& values, std::unique_ptr group_product(column_view const& values, size_type num_groups, cudf::device_span group_labels, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -107,7 +107,7 @@ std::unique_ptr group_product(column_view const& values, std::unique_ptr group_min(column_view const& values, size_type num_groups, cudf::device_span group_labels, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -130,7 +130,7 @@ std::unique_ptr group_min(column_view const& values, std::unique_ptr group_max(column_view const& values, size_type num_groups, cudf::device_span group_labels, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -155,7 +155,7 @@ std::unique_ptr group_argmax(column_view const& values, size_type num_groups, cudf::device_span group_labels, column_view const& key_sort_order, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -180,7 +180,7 @@ std::unique_ptr group_argmin(column_view const& values, size_type num_groups, cudf::device_span group_labels, column_view const& key_sort_order, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -204,7 +204,7 @@ std::unique_ptr group_argmin(column_view const& values, std::unique_ptr group_count_valid(column_view const& values, cudf::device_span group_labels, size_type num_groups, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -224,7 +224,7 @@ std::unique_ptr group_count_valid(column_view const& values, */ std::unique_ptr group_count_all(cudf::device_span group_offsets, size_type num_groups, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** * @brief Internal API to compute histogram for each group in @p values. @@ -251,7 +251,7 @@ std::unique_ptr group_count_all(cudf::device_span group std::unique_ptr group_histogram(column_view const& values, cudf::device_span group_labels, size_type num_groups, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -275,7 +275,7 @@ std::unique_ptr group_histogram(column_view const& values, std::unique_ptr group_m2(column_view const& values, column_view const& group_means, cudf::device_span group_labels, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -305,7 +305,7 @@ std::unique_ptr group_var(column_view const& values, column_view const& group_sizes, cudf::device_span group_labels, size_type ddof, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -336,7 +336,7 @@ std::unique_ptr group_quantiles(column_view const& values, size_type const num_groups, std::vector const& quantiles, interpolation interp, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -368,7 +368,7 @@ std::unique_ptr group_nunique(column_view const& values, size_type const num_groups, cudf::device_span group_offsets, null_policy null_handling, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -403,7 +403,7 @@ std::unique_ptr group_nth_element(column_view const& values, size_type num_groups, size_type n, null_policy null_handling, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** * @brief Internal API to collect grouped values into a lists column @@ -428,7 +428,7 @@ std::unique_ptr group_collect(column_view const& values, cudf::device_span group_offsets, size_type num_groups, null_policy null_handling, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -451,7 +451,7 @@ std::unique_ptr group_collect(column_view const& values, std::unique_ptr group_merge_lists(column_view const& values, cudf::device_span group_offsets, size_type num_groups, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -477,7 +477,7 @@ std::unique_ptr group_merge_lists(column_view const& values, std::unique_ptr group_merge_m2(column_view const& values, cudf::device_span group_offsets, size_type num_groups, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -504,7 +504,7 @@ std::unique_ptr group_merge_m2(column_view const& values, std::unique_ptr group_merge_histogram(column_view const& values, cudf::device_span group_offsets, size_type num_groups, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -531,7 +531,7 @@ std::unique_ptr group_covariance(column_view const& values_0, column_view const& mean_1, size_type min_periods, size_type ddof, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -546,7 +546,7 @@ std::unique_ptr group_covariance(column_view const& values_0, std::unique_ptr group_correlation(column_view const& covariance, column_view const& stddev_0, column_view const& stddev_1, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -563,7 +563,7 @@ std::unique_ptr group_bitwise(bitwise_op bit_op, column_view const& grouped_values, device_span group_labels, size_type num_groups, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -580,7 +580,7 @@ std::unique_ptr group_top_k(size_type k, order topk_order, column_view const& values, device_span group_offsets, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); } // namespace detail } // namespace groupby diff --git a/cpp/src/groupby/sort/group_replace_nulls.cu b/cpp/src/groupby/sort/group_replace_nulls.cu index 1cabe5dd813c..9d54a565534f 100644 --- a/cpp/src/groupby/sort/group_replace_nulls.cu +++ b/cpp/src/groupby/sort/group_replace_nulls.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ #include @@ -26,7 +26,7 @@ namespace detail { std::unique_ptr group_replace_nulls(cudf::column_view const& grouped_value, device_span group_labels, cudf::replace_policy replace_policy, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { cudf::size_type size = grouped_value.size(); diff --git a/cpp/src/groupby/sort/group_scan.hpp b/cpp/src/groupby/sort/group_scan.hpp index d354242e6f5a..53000b9c8aac 100644 --- a/cpp/src/groupby/sort/group_scan.hpp +++ b/cpp/src/groupby/sort/group_scan.hpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -10,7 +10,7 @@ #include #include -#include +#include #include @@ -29,7 +29,7 @@ namespace detail { std::unique_ptr sum_scan(column_view const& values, size_type num_groups, device_span group_labels, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -46,7 +46,7 @@ std::unique_ptr sum_scan(column_view const& values, std::unique_ptr product_scan(column_view const& values, size_type num_groups, device_span group_labels, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -61,7 +61,7 @@ std::unique_ptr product_scan(column_view const& values, std::unique_ptr min_scan(column_view const& values, size_type num_groups, device_span group_labels, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -76,7 +76,7 @@ std::unique_ptr min_scan(column_view const& values, std::unique_ptr max_scan(column_view const& values, size_type num_groups, device_span group_labels, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -92,7 +92,7 @@ std::unique_ptr max_scan(column_view const& values, std::unique_ptr count_scan(column_view const& values, null_policy nulls, device_span group_labels, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -111,7 +111,7 @@ std::unique_ptr min_rank_scan(column_view const& grouped_values, column_view const& value_order, device_span group_labels, device_span group_offsets, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -121,14 +121,14 @@ std::unique_ptr min_rank_scan(column_view const& grouped_values, * column_view const& value_order, * device_span group_labels, * device_span group_offsets, - * rmm::cuda_stream_view stream, + * cuda::stream_ref stream, * rmm::device_async_resource_ref mr) */ std::unique_ptr max_rank_scan(column_view const& grouped_values, column_view const& value_order, device_span group_labels, device_span group_offsets, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -138,14 +138,14 @@ std::unique_ptr max_rank_scan(column_view const& grouped_values, * column_view const& value_order, * device_span group_labels, * device_span group_offsets, - * rmm::cuda_stream_view stream, + * cuda::stream_ref stream, * rmm::device_async_resource_ref mr) */ std::unique_ptr first_rank_scan(column_view const& grouped_values, column_view const& value_order, device_span group_labels, device_span group_offsets, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -155,14 +155,14 @@ std::unique_ptr first_rank_scan(column_view const& grouped_values, * column_view const& value_order, * device_span group_labels, * device_span group_offsets, - * rmm::cuda_stream_view stream, + * cuda::stream_ref stream, * rmm::device_async_resource_ref mr) */ std::unique_ptr average_rank_scan(column_view const& grouped_values, column_view const& value_order, device_span group_labels, device_span group_offsets, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -180,7 +180,7 @@ std::unique_ptr dense_rank_scan(column_view const& grouped_values, column_view const& value_order, device_span group_labels, device_span group_offsets, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -203,7 +203,7 @@ std::unique_ptr group_rank_to_percentage(rank_method const method, column_view const& count, device_span group_labels, device_span group_offsets, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); } // namespace detail diff --git a/cpp/src/groupby/sort/group_scan_util.cuh b/cpp/src/groupby/sort/group_scan_util.cuh index 922a7f939432..ab92b7b6fbde 100644 --- a/cpp/src/groupby/sort/group_scan_util.cuh +++ b/cpp/src/groupby/sort/group_scan_util.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -22,12 +22,12 @@ #include #include -#include #include #include #include #include +#include #include #include @@ -50,7 +50,7 @@ struct group_scan_dispatcher { std::unique_ptr operator()(column_view const& values, size_type num_groups, cudf::device_span group_labels, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { return group_scan_functor::invoke(values, num_groups, group_labels, stream, mr); @@ -79,7 +79,7 @@ struct group_scan_functor() static std::unique_ptr invoke(column_view const& values, size_type num_groups, cudf::device_span group_labels, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { using DeviceType = device_storage_type_t; @@ -139,7 +139,7 @@ struct group_scan_functor invoke(column_view const& values, size_type num_groups, cudf::device_span group_labels, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { using OpType = cudf::detail::corresponding_operator_t; @@ -186,7 +186,7 @@ struct group_scan_functor invoke(column_view const& values, size_type num_groups, cudf::device_span group_labels, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { if (values.is_empty()) { return cudf::empty_like(values); } diff --git a/cpp/src/groupby/sort/group_single_pass_reduction_util.cuh b/cpp/src/groupby/sort/group_single_pass_reduction_util.cuh index 9dd8535bd709..fd297a2d78e3 100644 --- a/cpp/src/groupby/sort/group_single_pass_reduction_util.cuh +++ b/cpp/src/groupby/sort/group_single_pass_reduction_util.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -19,11 +19,11 @@ #include #include -#include #include #include #include +#include #include namespace cudf { @@ -105,7 +105,7 @@ struct group_reduction_dispatcher { std::unique_ptr operator()(column_view const& values, size_type num_groups, cudf::device_span group_labels, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { return group_reduction_functor::invoke(values, num_groups, group_labels, stream, mr); @@ -138,7 +138,7 @@ struct group_reduction_functor< static std::unique_ptr invoke(column_view const& values, size_type num_groups, cudf::device_span group_labels, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { using SourceDType = device_storage_type_t; @@ -207,7 +207,7 @@ struct group_reduction_functor< static std::unique_ptr invoke(column_view const& values, size_type num_groups, cudf::device_span group_labels, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { // This is be expected to be size_type. diff --git a/cpp/src/groupby/sort/group_std.cu b/cpp/src/groupby/sort/group_std.cu index 287b2306b084..a055cfb33581 100644 --- a/cpp/src/groupby/sort/group_std.cu +++ b/cpp/src/groupby/sort/group_std.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -17,11 +17,11 @@ #include #include -#include #include #include #include +#include #include #include #include @@ -65,7 +65,7 @@ void reduce_by_key_fn(column_device_view const& values, size_type const* d_group_sizes, size_type ddof, ResultType* d_result, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { auto var_fn = var_transform{ values, values_iter, d_means, d_group_sizes, group_labels.data(), ddof}; @@ -96,7 +96,7 @@ struct var_functor { column_view const& group_sizes, cudf::device_span group_labels, size_type ddof, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) requires(std::is_arithmetic_v) { @@ -169,7 +169,7 @@ std::unique_ptr group_var(column_view const& values, column_view const& group_sizes, cudf::device_span group_labels, size_type ddof, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { auto values_type = cudf::is_dictionary(values.type()) diff --git a/cpp/src/groupby/sort/group_sum.cu b/cpp/src/groupby/sort/group_sum.cu index 5f0b5ab912da..9787cbf1b24a 100644 --- a/cpp/src/groupby/sort/group_sum.cu +++ b/cpp/src/groupby/sort/group_sum.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -9,7 +9,7 @@ #include #include -#include +#include namespace cudf { namespace groupby { @@ -17,7 +17,7 @@ namespace detail { std::unique_ptr group_sum(column_view const& values, size_type num_groups, cudf::device_span group_labels, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { auto values_type = cudf::is_dictionary(values.type()) diff --git a/cpp/src/groupby/sort/group_sum_overflow.cu b/cpp/src/groupby/sort/group_sum_overflow.cu index a58aa3e2b37f..cc7e2c94d5c2 100644 --- a/cpp/src/groupby/sort/group_sum_overflow.cu +++ b/cpp/src/groupby/sort/group_sum_overflow.cu @@ -17,13 +17,13 @@ #include #include -#include #include #include #include #include #include +#include #include #include @@ -49,7 +49,7 @@ struct group_sum_overflow_fn { std::unique_ptr operator()(column_view const& values, size_type num_groups, cudf::device_span group_labels, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const { using DeviceType = cudf::device_storage_type_t; @@ -117,7 +117,7 @@ struct group_sum_overflow_fn { std::unique_ptr group_sum_overflow(column_view const& values, size_type num_groups, cudf::device_span group_labels, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { return cudf::type_dispatcher( diff --git a/cpp/src/groupby/sort/group_sum_scan.cu b/cpp/src/groupby/sort/group_sum_scan.cu index fa9147f562f5..14870bdd07a0 100644 --- a/cpp/src/groupby/sort/group_sum_scan.cu +++ b/cpp/src/groupby/sort/group_sum_scan.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -7,7 +7,7 @@ #include -#include +#include namespace cudf { namespace groupby { @@ -15,7 +15,7 @@ namespace detail { std::unique_ptr sum_scan(column_view const& values, size_type num_groups, cudf::device_span group_labels, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { return type_dispatcher(values.type(), diff --git a/cpp/src/groupby/sort/group_topk.cu b/cpp/src/groupby/sort/group_topk.cu index 2ad892b462de..f89144d7411c 100644 --- a/cpp/src/groupby/sort/group_topk.cu +++ b/cpp/src/groupby/sort/group_topk.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -9,7 +9,7 @@ #include #include -#include +#include #include @@ -21,7 +21,7 @@ std::unique_ptr group_top_k(size_type k, order topk_order, column_view const& values, cudf::device_span group_offsets, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { return cudf::detail::segmented_top_k(values, group_offsets, k, topk_order, stream, mr); diff --git a/cpp/src/groupby/sort/scan.cpp b/cpp/src/groupby/sort/scan.cpp index e1982e02cda3..340365fa7a28 100644 --- a/cpp/src/groupby/sort/scan.cpp +++ b/cpp/src/groupby/sort/scan.cpp @@ -24,7 +24,7 @@ #include #include -#include +#include #include @@ -213,7 +213,7 @@ void scan_result_functor::operator()(aggregation const& agg) // Sort-based groupby std::pair, std::vector> groupby::sort_scan( std::span requests, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { // We're going to start by creating a cache of results so that aggs that diff --git a/cpp/src/groupby/sort/sort_helper.cu b/cpp/src/groupby/sort/sort_helper.cu index 2fbfe18b4282..f5aeeffdb026 100644 --- a/cpp/src/groupby/sort/sort_helper.cu +++ b/cpp/src/groupby/sort/sort_helper.cu @@ -20,10 +20,10 @@ #include #include -#include #include #include +#include #include #include @@ -54,7 +54,7 @@ sort_groupby_helper::sort_groupby_helper(table_view const& keys, } }; -size_type sort_groupby_helper::num_keys(rmm::cuda_stream_view stream) +size_type sort_groupby_helper::num_keys(cuda::stream_ref stream) { if (_num_keys > -1) return _num_keys; @@ -70,7 +70,7 @@ size_type sort_groupby_helper::num_keys(rmm::cuda_stream_view stream) return _num_keys; } -column_view sort_groupby_helper::key_sort_order(rmm::cuda_stream_view stream) +column_view sort_groupby_helper::key_sort_order(cuda::stream_ref stream) { auto sliced_key_sorted_order = [stream, this]() { return cudf::detail::slice(this->_key_sorted_order->view(), 0, this->num_keys(stream), stream); @@ -117,8 +117,7 @@ column_view sort_groupby_helper::key_sort_order(rmm::cuda_stream_view stream) return sliced_key_sorted_order(); } -sort_groupby_helper::index_vector const& sort_groupby_helper::group_offsets( - rmm::cuda_stream_view stream) +sort_groupby_helper::index_vector const& sort_groupby_helper::group_offsets(cuda::stream_ref stream) { if (_group_offsets) return *_group_offsets; @@ -142,8 +141,7 @@ sort_groupby_helper::index_vector const& sort_groupby_helper::group_offsets( return *_group_offsets; } -sort_groupby_helper::index_vector const& sort_groupby_helper::group_labels( - rmm::cuda_stream_view stream) +sort_groupby_helper::index_vector const& sort_groupby_helper::group_labels(cuda::stream_ref stream) { if (_group_labels) return *_group_labels; @@ -161,7 +159,7 @@ sort_groupby_helper::index_vector const& sort_groupby_helper::group_labels( return *_group_labels; } -column_view sort_groupby_helper::unsorted_keys_labels(rmm::cuda_stream_view stream) +column_view sort_groupby_helper::unsorted_keys_labels(cuda::stream_ref stream) { if (_unsorted_keys_labels) return _unsorted_keys_labels->view(); @@ -191,7 +189,7 @@ column_view sort_groupby_helper::unsorted_keys_labels(rmm::cuda_stream_view stre return _unsorted_keys_labels->view(); } -column_view sort_groupby_helper::keys_bitmask_column(rmm::cuda_stream_view stream) +column_view sort_groupby_helper::keys_bitmask_column(cuda::stream_ref stream) { if (_keys_bitmask_column) return _keys_bitmask_column->view(); @@ -211,7 +209,7 @@ column_view sort_groupby_helper::keys_bitmask_column(rmm::cuda_stream_view strea } sort_groupby_helper::column_ptr sort_groupby_helper::sorted_values( - column_view const& values, rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr) + column_view const& values, cuda::stream_ref stream, rmm::device_async_resource_ref mr) { column_ptr values_sort_order = cudf::detail::stable_sorted_order(table_view({unsorted_keys_labels(stream), values}), @@ -235,7 +233,7 @@ sort_groupby_helper::column_ptr sort_groupby_helper::sorted_values( } sort_groupby_helper::column_ptr sort_groupby_helper::grouped_values( - column_view const& values, rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr) + column_view const& values, cuda::stream_ref stream, rmm::device_async_resource_ref mr) { auto gather_map = key_sort_order(stream); @@ -249,7 +247,7 @@ sort_groupby_helper::column_ptr sort_groupby_helper::grouped_values( return std::move(grouped_values_table->release()[0]); } -std::unique_ptr
sort_groupby_helper::unique_keys(rmm::cuda_stream_view stream, +std::unique_ptr
sort_groupby_helper::unique_keys(cuda::stream_ref stream, rmm::device_async_resource_ref mr) { auto const num_unique_keys = num_groups(stream); @@ -269,7 +267,7 @@ std::unique_ptr
sort_groupby_helper::unique_keys(rmm::cuda_stream_view st mr); } -std::unique_ptr
sort_groupby_helper::sorted_keys(rmm::cuda_stream_view stream, +std::unique_ptr
sort_groupby_helper::sorted_keys(cuda::stream_ref stream, rmm::device_async_resource_ref mr) { return cudf::detail::gather(_keys, diff --git a/cpp/src/groupby/sort/sort_helper_group_offsets.cuh b/cpp/src/groupby/sort/sort_helper_group_offsets.cuh index 958d424e2bf4..4310d9114cb5 100644 --- a/cpp/src/groupby/sort/sort_helper_group_offsets.cuh +++ b/cpp/src/groupby/sort/sort_helper_group_offsets.cuh @@ -14,13 +14,13 @@ #include #include -#include #include #include #include #include #include +#include #include namespace cudf::groupby::detail::sort { @@ -29,14 +29,14 @@ size_type compute_nested_group_offsets(table_view const& keys, size_type const* sorted_order, size_type size, rmm::device_uvector& group_offsets, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); template size_type compute_group_offsets(table_view const& keys, size_type const* sorted_order, size_type size, rmm::device_uvector& group_offsets, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { auto const comparator = cudf::detail::row::equality::self_comparator{keys, stream}; auto const d_key_equal = comparator.equal_to( diff --git a/cpp/src/groupby/sort/sort_helper_nested.cu b/cpp/src/groupby/sort/sort_helper_nested.cu index a8a2b06e124f..ab70009606ed 100644 --- a/cpp/src/groupby/sort/sort_helper_nested.cu +++ b/cpp/src/groupby/sort/sort_helper_nested.cu @@ -11,7 +11,7 @@ size_type compute_nested_group_offsets(table_view const& keys, size_type const* sorted_order, size_type size, rmm::device_uvector& group_offsets, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { return compute_group_offsets(keys, sorted_order, size, group_offsets, stream); } diff --git a/cpp/src/groupby/streaming_groupby.cpp b/cpp/src/groupby/streaming_groupby.cpp index 0aea2baf1a25..a3667395f000 100644 --- a/cpp/src/groupby/streaming_groupby.cpp +++ b/cpp/src/groupby/streaming_groupby.cpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -10,7 +10,7 @@ #include #include -#include +#include #include #include @@ -18,20 +18,20 @@ namespace cudf::groupby { -void streaming_groupby::aggregate(table_view const& data, rmm::cuda_stream_view stream) +void streaming_groupby::aggregate(table_view const& data, cuda::stream_ref stream) { CUDF_FUNC_RANGE(); do_aggregate(data, stream); } -void streaming_groupby::merge(streaming_groupby const& other, rmm::cuda_stream_view stream) +void streaming_groupby::merge(streaming_groupby const& other, cuda::stream_ref stream) { CUDF_FUNC_RANGE(); do_merge(other, stream); } std::pair, std::vector> streaming_groupby::finalize( - rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr) const + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const { CUDF_FUNC_RANGE(); return do_finalize(stream, mr); diff --git a/cpp/src/groupby/streaming_groupby/aggregate.cu b/cpp/src/groupby/streaming_groupby/aggregate.cu index a8568bbff4f5..702be6d794e0 100644 --- a/cpp/src/groupby/streaming_groupby/aggregate.cu +++ b/cpp/src/groupby/streaming_groupby/aggregate.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -10,10 +10,10 @@ #include #include -#include #include #include +#include #include #include @@ -21,7 +21,7 @@ namespace cudf::groupby { -void streaming_groupby::impl::do_aggregate(table_view const& data, rmm::cuda_stream_view stream) +void streaming_groupby::impl::do_aggregate(table_view const& data, cuda::stream_ref stream) { CUDF_EXPECTS(!_invalidated, "streaming_groupby is in an invalidated state from a prior failure; " diff --git a/cpp/src/groupby/streaming_groupby/common.cuh b/cpp/src/groupby/streaming_groupby/common.cuh index f1fe3eeb3d56..251ce33f0b70 100644 --- a/cpp/src/groupby/streaming_groupby/common.cuh +++ b/cpp/src/groupby/streaming_groupby/common.cuh @@ -19,12 +19,12 @@ #include #include -#include #include #include #include #include +#include #include #include @@ -220,7 +220,7 @@ auto build_cross_comparators( std::vector> const& preprocessed_batches, cudf::nullate::DYNAMIC has_null, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { using eq_t = cudf::detail::row::equality::device_row_comparator< has_nested_columns, @@ -309,8 +309,8 @@ struct streaming_groupby::impl { null_policy null_handling, cuda::mr::any_resource mr); - void initialize(table_view const& data, rmm::cuda_stream_view stream); - void create_key_set(rmm::cuda_stream_view stream); + void initialize(table_view const& data, cuda::stream_ref stream); + void create_key_set(cuda::stream_ref stream); void update_nullable_state(table_view const& batch_keys); struct batch_insert_result { @@ -319,15 +319,14 @@ struct streaming_groupby::impl { rmm::device_buffer bitmask_buffer; }; - batch_insert_result probe_and_insert(table_view const& batch_keys, rmm::cuda_stream_view stream); + batch_insert_result probe_and_insert(table_view const& batch_keys, cuda::stream_ref stream); /* * Template implementation of probe_and_insert, split by has_nested. * Defined in insert.cuh, instantiated in insert.cu and insert_nested.cu. */ template - batch_insert_result probe_and_insert_impl(table_view const& batch_keys, - rmm::cuda_stream_view stream); + batch_insert_result probe_and_insert_impl(table_view const& batch_keys, cuda::stream_ref stream); /* * Two helpers split off probe_and_insert_impl for compile-time parallelism. @@ -348,7 +347,7 @@ struct streaming_groupby::impl { size_type* target_indices, size_type* slot_offsets, size_type* batch_local_indices, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); template size_type probe_and_insert_subsequent( @@ -360,19 +359,19 @@ struct streaming_groupby::impl { size_type* target_indices, size_type* slot_offsets, size_type* batch_local_indices, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); - void do_aggregate(table_view const& data, rmm::cuda_stream_view stream); + void do_aggregate(table_view const& data, cuda::stream_ref stream); - [[nodiscard]] std::unique_ptr
gather_agg_results(rmm::cuda_stream_view stream, + [[nodiscard]] std::unique_ptr
gather_agg_results(cuda::stream_ref stream, rmm::device_async_resource_ref mr) const; [[nodiscard]] std::unique_ptr
gather_distinct_keys( - rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr) const; + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const; [[nodiscard]] std::pair, std::vector> do_finalize( - rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr) const; + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const; - void do_merge(impl const& other, rmm::cuda_stream_view stream); + void do_merge(impl const& other, cuda::stream_ref stream); }; } // namespace cudf::groupby diff --git a/cpp/src/groupby/streaming_groupby/impl.cu b/cpp/src/groupby/streaming_groupby/impl.cu index 3608ed29f045..49e2207955f7 100644 --- a/cpp/src/groupby/streaming_groupby/impl.cu +++ b/cpp/src/groupby/streaming_groupby/impl.cu @@ -23,9 +23,10 @@ #include #include -#include #include +#include + #include #include #include @@ -104,7 +105,7 @@ streaming_groupby::impl::impl(host_span key_indices, } } -void streaming_groupby::impl::initialize(table_view const& data, rmm::cuda_stream_view stream) +void streaming_groupby::impl::initialize(table_view const& data, cuda::stream_ref stream) { auto const mr = cudf::get_current_device_resource_ref(); @@ -211,7 +212,7 @@ void streaming_groupby::impl::initialize(table_view const& data, rmm::cuda_strea _initialized = true; } -void streaming_groupby::impl::create_key_set(rmm::cuda_stream_view stream) +void streaming_groupby::impl::create_key_set(cuda::stream_ref stream) { _key_set = std::make_unique( cuco::extent{static_cast(_max_distinct_keys)}, @@ -222,7 +223,7 @@ void streaming_groupby::impl::create_key_set(rmm::cuda_stream_view stream) cuco::thread_scope_device, cuco::storage{}, rmm::mr::polymorphic_allocator{_mr}, - stream.value()); + stream.get()); } void streaming_groupby::impl::update_nullable_state(table_view const& batch_keys) @@ -237,7 +238,7 @@ void streaming_groupby::impl::update_nullable_state(table_view const& batch_keys } std::unique_ptr
streaming_groupby::impl::gather_agg_results( - rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr) const + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const { // The results we care about are dense in `[0, _distinct_keys)` and can be extracted by // slice+copy. @@ -247,7 +248,7 @@ std::unique_ptr
streaming_groupby::impl::gather_agg_results( } std::unique_ptr
streaming_groupby::impl::gather_distinct_keys( - rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr) const + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const { if (_compacted_batches.empty()) { return std::make_unique
(_empty_key_schema->view(), stream, mr); @@ -264,7 +265,7 @@ std::unique_ptr
streaming_groupby::impl::gather_distinct_keys( } std::pair, std::vector> -streaming_groupby::impl::do_finalize(rmm::cuda_stream_view stream, +streaming_groupby::impl::do_finalize(cuda::stream_ref stream, rmm::device_async_resource_ref mr) const { CUDF_EXPECTS(_initialized, "Cannot finalize streaming_groupby with no accumulated data."); @@ -333,7 +334,7 @@ streaming_groupby::impl::do_finalize(rmm::cuda_stream_view stream, } streaming_groupby::impl::batch_insert_result streaming_groupby::impl::probe_and_insert( - table_view const& batch_keys, rmm::cuda_stream_view stream) + table_view const& batch_keys, cuda::stream_ref stream) { if (_has_nested_keys) { return probe_and_insert_impl(batch_keys, stream); @@ -361,18 +362,18 @@ streaming_groupby& streaming_groupby::operator=(streaming_groupby&&) noexcept = // Private member functions defined here (requires full impl definition). // The public API wrappers in streaming_groupby.cpp call these. -void streaming_groupby::do_aggregate(table_view const& data, rmm::cuda_stream_view stream) +void streaming_groupby::do_aggregate(table_view const& data, cuda::stream_ref stream) { _impl->do_aggregate(data, stream); } -void streaming_groupby::do_merge(streaming_groupby const& other, rmm::cuda_stream_view stream) +void streaming_groupby::do_merge(streaming_groupby const& other, cuda::stream_ref stream) { _impl->do_merge(*other._impl, stream); } std::pair, std::vector> streaming_groupby::do_finalize( - rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr) const + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const { return _impl->do_finalize(stream, mr); } diff --git a/cpp/src/groupby/streaming_groupby/insert.cu b/cpp/src/groupby/streaming_groupby/insert.cu index 621b42e69917..5e14a69159f1 100644 --- a/cpp/src/groupby/streaming_groupby/insert.cu +++ b/cpp/src/groupby/streaming_groupby/insert.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -9,6 +9,6 @@ namespace cudf::groupby { template streaming_groupby::impl::batch_insert_result streaming_groupby::impl::probe_and_insert_impl(table_view const& batch_keys, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); } // namespace cudf::groupby diff --git a/cpp/src/groupby/streaming_groupby/insert.cuh b/cpp/src/groupby/streaming_groupby/insert.cuh index 39be36b4af7e..d5e7de800453 100644 --- a/cpp/src/groupby/streaming_groupby/insert.cuh +++ b/cpp/src/groupby/streaming_groupby/insert.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -13,11 +13,11 @@ #include #include -#include #include #include #include +#include #include #include @@ -27,7 +27,7 @@ namespace cudf::groupby { template streaming_groupby::impl::batch_insert_result streaming_groupby::impl::probe_and_insert_impl( - table_view const& batch_keys, rmm::cuda_stream_view stream) + table_view const& batch_keys, cuda::stream_ref stream) { auto const batch_size = batch_keys.num_rows(); auto const temp_mr = cudf::get_current_device_resource_ref(); diff --git a/cpp/src/groupby/streaming_groupby/insert_first.cu b/cpp/src/groupby/streaming_groupby/insert_first.cu index baf7b48dfb51..91de70e13748 100644 --- a/cpp/src/groupby/streaming_groupby/insert_first.cu +++ b/cpp/src/groupby/streaming_groupby/insert_first.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -16,6 +16,6 @@ template size_type streaming_groupby::impl::probe_and_insert_first_batch( size_type* target_indices, size_type* slot_offsets, size_type* batch_local_indices, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); } // namespace cudf::groupby diff --git a/cpp/src/groupby/streaming_groupby/insert_first.cuh b/cpp/src/groupby/streaming_groupby/insert_first.cuh index efac4241cd32..a9e8e9f3af49 100644 --- a/cpp/src/groupby/streaming_groupby/insert_first.cuh +++ b/cpp/src/groupby/streaming_groupby/insert_first.cuh @@ -11,11 +11,11 @@ #include #include -#include #include #include #include +#include #include #include @@ -50,7 +50,7 @@ size_type streaming_groupby::impl::probe_and_insert_first_batch( size_type* target_indices, size_type* slot_offsets, size_type* batch_local_indices, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { auto const temp_mr = cudf::get_current_device_resource_ref(); auto const batch_self_cmp = cudf::detail::row::equality::self_comparator{preprocessed_batch}; diff --git a/cpp/src/groupby/streaming_groupby/insert_first_nested.cu b/cpp/src/groupby/streaming_groupby/insert_first_nested.cu index 98225875f76d..7c27e0fe377c 100644 --- a/cpp/src/groupby/streaming_groupby/insert_first_nested.cu +++ b/cpp/src/groupby/streaming_groupby/insert_first_nested.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -16,6 +16,6 @@ template size_type streaming_groupby::impl::probe_and_insert_first_batch( size_type* target_indices, size_type* slot_offsets, size_type* batch_local_indices, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); } // namespace cudf::groupby diff --git a/cpp/src/groupby/streaming_groupby/insert_nested.cu b/cpp/src/groupby/streaming_groupby/insert_nested.cu index 33117248ee8c..a23759acd1b4 100644 --- a/cpp/src/groupby/streaming_groupby/insert_nested.cu +++ b/cpp/src/groupby/streaming_groupby/insert_nested.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -9,6 +9,6 @@ namespace cudf::groupby { template streaming_groupby::impl::batch_insert_result streaming_groupby::impl::probe_and_insert_impl(table_view const& batch_keys, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); } // namespace cudf::groupby diff --git a/cpp/src/groupby/streaming_groupby/insert_subsequent.cu b/cpp/src/groupby/streaming_groupby/insert_subsequent.cu index a5ea95b7572a..fb4dcba1f1a4 100644 --- a/cpp/src/groupby/streaming_groupby/insert_subsequent.cu +++ b/cpp/src/groupby/streaming_groupby/insert_subsequent.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -16,6 +16,6 @@ template size_type streaming_groupby::impl::probe_and_insert_subsequent( size_type* target_indices, size_type* slot_offsets, size_type* batch_local_indices, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); } // namespace cudf::groupby diff --git a/cpp/src/groupby/streaming_groupby/insert_subsequent.cuh b/cpp/src/groupby/streaming_groupby/insert_subsequent.cuh index 4f14691d3f9d..eae56e4549ef 100644 --- a/cpp/src/groupby/streaming_groupby/insert_subsequent.cuh +++ b/cpp/src/groupby/streaming_groupby/insert_subsequent.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -9,10 +9,10 @@ #include -#include #include #include +#include #include namespace cudf::groupby { @@ -27,7 +27,7 @@ size_type streaming_groupby::impl::probe_and_insert_subsequent( size_type* target_indices, size_type* slot_offsets, size_type* batch_local_indices, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { auto const temp_mr = cudf::get_current_device_resource_ref(); auto const batch_self_cmp = cudf::detail::row::equality::self_comparator{preprocessed_batch}; diff --git a/cpp/src/groupby/streaming_groupby/insert_subsequent_nested.cu b/cpp/src/groupby/streaming_groupby/insert_subsequent_nested.cu index 8c0a6faab895..1edcbac2150c 100644 --- a/cpp/src/groupby/streaming_groupby/insert_subsequent_nested.cu +++ b/cpp/src/groupby/streaming_groupby/insert_subsequent_nested.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -16,6 +16,6 @@ template size_type streaming_groupby::impl::probe_and_insert_subsequent( size_type* target_indices, size_type* slot_offsets, size_type* batch_local_indices, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); } // namespace cudf::groupby diff --git a/cpp/src/groupby/streaming_groupby/merge.cu b/cpp/src/groupby/streaming_groupby/merge.cu index 34cd7abe39a6..67c05fc176ce 100644 --- a/cpp/src/groupby/streaming_groupby/merge.cu +++ b/cpp/src/groupby/streaming_groupby/merge.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -12,10 +12,10 @@ #include #include -#include #include #include +#include #include #include @@ -88,7 +88,7 @@ struct merge_single_pass_aggs_fn { } // namespace -void streaming_groupby::impl::do_merge(impl const& other, rmm::cuda_stream_view stream) +void streaming_groupby::impl::do_merge(impl const& other, cuda::stream_ref stream) { CUDF_EXPECTS(!_invalidated, "streaming_groupby is in an invalidated state from a prior failure; " diff --git a/cpp/src/join/conditional_join.cu b/cpp/src/join/conditional_join.cu index 8e2688b99f3b..0019ae67bde1 100644 --- a/cpp/src/join/conditional_join.cu +++ b/cpp/src/join/conditional_join.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include @@ -37,7 +37,7 @@ std::unique_ptr> conditional_join_anti_semi( ast::expression const& binary_predicate, join_kind join_type, std::optional output_size, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { if (right.num_rows() == 0) { @@ -79,12 +79,12 @@ std::unique_ptr> conditional_join_anti_semi( cudf::detail::device_scalar size(0, stream, mr); if (has_nulls) { compute_conditional_join_output_size - <<>>( + <<>>( *left_table, *right_table, join_type, parser.device_expression_data, false, size.data()); CUDF_CUDA_TRY(cudaGetLastError()); } else { compute_conditional_join_output_size - <<>>( + <<>>( *left_table, *right_table, join_type, parser.device_expression_data, false, size.data()); CUDF_CUDA_TRY(cudaGetLastError()); } @@ -100,7 +100,7 @@ std::unique_ptr> conditional_join_anti_semi( if (has_nulls) { conditional_join_anti_semi - <<>>( + <<>>( *left_table, *right_table, join_type, @@ -111,7 +111,7 @@ std::unique_ptr> conditional_join_anti_semi( CUDF_CUDA_TRY(cudaGetLastError()); } else { conditional_join_anti_semi - <<>>( + <<>>( *left_table, *right_table, join_type, @@ -131,7 +131,7 @@ conditional_join(table_view const& left, ast::expression const& binary_predicate, join_kind join_type, std::optional output_size, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { // We can immediately filter out cases where the right table is empty. In @@ -201,7 +201,7 @@ conditional_join(table_view const& left, cudf::detail::device_scalar size(0, stream, mr); if (has_nulls) { compute_conditional_join_output_size - <<>>( + <<>>( *left_table, *right_table, kernel_join_type, @@ -211,7 +211,7 @@ conditional_join(table_view const& left, CUDF_CUDA_TRY(cudaGetLastError()); } else { compute_conditional_join_output_size - <<>>( + <<>>( *left_table, *right_table, kernel_join_type, @@ -245,7 +245,7 @@ conditional_join(table_view const& left, if (has_nulls) { conditional_join - <<>>( + <<>>( *left_table, *right_table, kernel_join_type, @@ -258,7 +258,7 @@ conditional_join(table_view const& left, CUDF_CUDA_TRY(cudaGetLastError()); } else { conditional_join - <<>>( + <<>>( *left_table, *right_table, kernel_join_type, @@ -286,7 +286,7 @@ std::size_t compute_conditional_join_output_size(table_view const& left, table_view const& right, ast::expression const& binary_predicate, join_kind join_type, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { // Until we add logic to handle the number of non-matches in the right table, @@ -354,7 +354,7 @@ std::size_t compute_conditional_join_output_size(table_view const& left, // find what the size of the output will be. if (has_nulls) { compute_conditional_join_output_size - <<>>( + <<>>( *left_table, *right_table, join_type, @@ -364,7 +364,7 @@ std::size_t compute_conditional_join_output_size(table_view const& left, CUDF_CUDA_TRY(cudaGetLastError()); } else { compute_conditional_join_output_size - <<>>( + <<>>( *left_table, *right_table, join_type, @@ -384,7 +384,7 @@ conditional_inner_join(table_view const& left, table_view const& right, ast::expression const& binary_predicate, std::optional output_size, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); @@ -398,7 +398,7 @@ conditional_left_join(table_view const& left, table_view const& right, ast::expression const& binary_predicate, std::optional output_size, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); @@ -411,7 +411,7 @@ std::pair>, conditional_full_join(table_view const& left, table_view const& right, ast::expression const& binary_predicate, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); @@ -424,7 +424,7 @@ std::unique_ptr> conditional_left_semi_join( table_view const& right, ast::expression const& binary_predicate, std::optional output_size, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); @@ -437,7 +437,7 @@ std::unique_ptr> conditional_left_anti_join( table_view const& right, ast::expression const& binary_predicate, std::optional output_size, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); @@ -448,7 +448,7 @@ std::unique_ptr> conditional_left_anti_join( std::size_t conditional_inner_join_size(table_view const& left, table_view const& right, ast::expression const& binary_predicate, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); @@ -459,7 +459,7 @@ std::size_t conditional_inner_join_size(table_view const& left, std::size_t conditional_left_join_size(table_view const& left, table_view const& right, ast::expression const& binary_predicate, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); @@ -470,7 +470,7 @@ std::size_t conditional_left_join_size(table_view const& left, std::size_t conditional_left_semi_join_size(table_view const& left, table_view const& right, ast::expression const& binary_predicate, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); @@ -481,7 +481,7 @@ std::size_t conditional_left_semi_join_size(table_view const& left, std::size_t conditional_left_anti_join_size(table_view const& left, table_view const& right, ast::expression const& binary_predicate, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); diff --git a/cpp/src/join/conditional_join.hpp b/cpp/src/join/conditional_join.hpp index 159cef26129e..7d66e340ade0 100644 --- a/cpp/src/join/conditional_join.hpp +++ b/cpp/src/join/conditional_join.hpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ #pragma once @@ -11,7 +11,7 @@ #include #include -#include +#include #include @@ -40,7 +40,7 @@ conditional_join(table_view const& left, ast::expression const& binary_predicate, join_kind JoinKind, std::optional output_size, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -61,7 +61,7 @@ std::size_t compute_conditional_join_output_size(table_view const& left, table_view const& right, ast::expression const& binary_predicate, join_kind JoinKind, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); } // namespace detail diff --git a/cpp/src/join/cross_join.cu b/cpp/src/join/cross_join.cu index 0545465c7e6d..c0b85a533fc3 100644 --- a/cpp/src/join/cross_join.cu +++ b/cpp/src/join/cross_join.cu @@ -17,7 +17,7 @@ #include #include -#include +#include #include #include @@ -33,7 +33,7 @@ namespace detail { */ std::unique_ptr cross_join(cudf::table_view const& left, cudf::table_view const& right, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { // If left or right table has no rows, return an empty table with all columns @@ -72,7 +72,7 @@ std::unique_ptr cross_join(cudf::table_view const& left, std::unique_ptr cross_join(cudf::table_view const& left, cudf::table_view const& right, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); diff --git a/cpp/src/join/direct_join.cu b/cpp/src/join/direct_join.cu index a0802f8a3f3c..5750e6f5fdd7 100644 --- a/cpp/src/join/direct_join.cu +++ b/cpp/src/join/direct_join.cu @@ -12,13 +12,13 @@ #include #include -#include #include #include #include #include #include +#include #include #include @@ -71,7 +71,7 @@ std::pair>, direct_inner_join(column_view const& left_keys, column_view const& right_keys, std::size_t capacity, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { CUDF_EXPECTS( @@ -94,11 +94,11 @@ direct_inner_join(column_view const& left_keys, auto lookup = rmm::device_uvector(capacity, stream, cudf::get_current_device_resource_ref()); CUDF_CUDA_TRY( - cub::DeviceTransform::Fill(lookup.begin(), lookup.size(), JoinNoMatch, stream.value())); + cub::DeviceTransform::Fill(lookup.begin(), lookup.size(), JoinNoMatch, stream.get())); CUDF_CUDA_TRY( cub::DeviceFor::Bulk(right_keys.size(), scatter_right_index{lookup.data(), right_keys.begin()}, - stream.value())); + stream.get())); // Probe: a single pass emitting the (left index, matched right index) pairs auto left_indices = @@ -130,7 +130,7 @@ std::pair>, direct_inner_join(column_view const& left_keys, column_view const& right_keys, std::size_t capacity, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); diff --git a/cpp/src/join/distinct_hash_join.cu b/cpp/src/join/distinct_hash_join.cu index 8a5cf7b2a279..ba2647af0506 100644 --- a/cpp/src/join/distinct_hash_join.cu +++ b/cpp/src/join/distinct_hash_join.cu @@ -18,7 +18,6 @@ #include #include -#include #include #include #include @@ -29,6 +28,7 @@ #include #include #include +#include #include #include @@ -119,14 +119,14 @@ void find_matches_in_hash_table(HashTableType const& hash_table, Hasher hasher, cudf::null_equality nulls_equal, FoundIterator found_begin, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { auto const left_table_num_rows = left.num_rows(); // If `idx` is within the range `[0, left_table_num_rows)` and `found_indices[idx]` is not // equal to `cudf::JoinNoMatch`, then `idx` has a match in the hash set. if (nulls_equal == cudf::null_equality::EQUAL or (not cudf::nullable(left))) { hash_table.find_async( - iter, iter + left_table_num_rows, d_equal, hasher, found_begin, stream.value()); + iter, iter + left_table_num_rows, d_equal, hasher, found_begin, stream.get()); } else { auto stencil = cuda::counting_iterator{0}; auto const row_bitmask = @@ -134,14 +134,8 @@ void find_matches_in_hash_table(HashTableType const& hash_table, auto const pred = cudf::detail::row_is_valid{reinterpret_cast(row_bitmask.data())}; - hash_table.find_if_async(iter, - iter + left_table_num_rows, - stencil, - pred, - d_equal, - hasher, - found_begin, - stream.value()); + hash_table.find_if_async( + iter, iter + left_table_num_rows, stencil, pred, d_equal, hasher, found_begin, stream.get()); } } @@ -149,7 +143,7 @@ void find_matches_in_hash_table(HashTableType const& hash_table, distinct_hash_join::distinct_hash_join(cudf::table_view const& right, cudf::null_equality compare_nulls, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, cuda::mr::any_resource mr) : distinct_hash_join{right, compare_nulls, CUCO_DESIRED_LOAD_FACTOR, stream, std::move(mr)} { @@ -158,7 +152,7 @@ distinct_hash_join::distinct_hash_join(cudf::table_view const& right, distinct_hash_join::distinct_hash_join(cudf::table_view const& right, cudf::null_equality compare_nulls, double load_factor, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, cuda::mr::any_resource mr) : _has_nested_columns{cudf::has_nested_columns(right)}, _nulls_equal{compare_nulls}, @@ -173,7 +167,7 @@ distinct_hash_join::distinct_hash_join(cudf::table_view const& right, cuco::thread_scope_device, cuco_storage_type{}, rmm::mr::polymorphic_allocator{std::move(mr)}, - stream.value()} + stream.get()} { CUDF_FUNC_RANGE(); CUDF_EXPECTS(0 != this->_right.num_columns(), "Hash join right table is empty"); @@ -183,7 +177,7 @@ distinct_hash_join::distinct_hash_join(cudf::table_view const& right, auto const build_hash_table = [&](auto iter) { if (this->_nulls_equal == cudf::null_equality::EQUAL or (not cudf::nullable(right))) { - this->_hash_table.insert_async(iter, iter + right_table_num_rows, stream.value()); + this->_hash_table.insert_async(iter, iter + right_table_num_rows, stream.get()); } else { auto stencil = cuda::counting_iterator{0}; auto const row_bitmask = @@ -193,7 +187,7 @@ distinct_hash_join::distinct_hash_join(cudf::table_view const& right, // insert valid rows this->_hash_table.insert_if_async( - iter, iter + right_table_num_rows, stencil, pred, stream.value()); + iter, iter + right_table_num_rows, stencil, pred, stream.get()); } }; @@ -219,7 +213,7 @@ distinct_hash_join::distinct_hash_join(cudf::table_view const& right, std::pair>, std::unique_ptr>> distinct_hash_join::inner_join(cudf::table_view const& left, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const { cudf::scoped_range range{"distinct_hash_join::inner_join"}; @@ -315,9 +309,7 @@ distinct_hash_join::inner_join(cudf::table_view const& left, } std::unique_ptr> distinct_hash_join::left_join( - cudf::table_view const& left, - rmm::cuda_stream_view stream, - rmm::device_async_resource_ref mr) const + cudf::table_view const& left, cuda::stream_ref stream, rmm::device_async_resource_ref mr) const { cudf::scoped_range range{"distinct_hash_join::left_join"}; @@ -402,7 +394,7 @@ distinct_hash_join::~distinct_hash_join() = default; distinct_hash_join::distinct_hash_join(cudf::table_view const& right, null_equality compare_nulls, double load_factor, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, cuda::mr::any_resource mr) : _impl{std::make_unique(right, compare_nulls, load_factor, stream, std::move(mr))} { @@ -411,16 +403,14 @@ distinct_hash_join::distinct_hash_join(cudf::table_view const& right, std::pair>, std::unique_ptr>> distinct_hash_join::inner_join(cudf::table_view const& left, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const { return _impl->inner_join(left, stream, mr); } std::unique_ptr> distinct_hash_join::left_join( - cudf::table_view const& left, - rmm::cuda_stream_view stream, - rmm::device_async_resource_ref mr) const + cudf::table_view const& left, cuda::stream_ref stream, rmm::device_async_resource_ref mr) const { return _impl->left_join(left, stream, mr); } diff --git a/cpp/src/join/filter_join_indices/filter_join_indices.cu b/cpp/src/join/filter_join_indices/filter_join_indices.cu index ea29e290722f..f500425f8098 100644 --- a/cpp/src/join/filter_join_indices/filter_join_indices.cu +++ b/cpp/src/join/filter_join_indices/filter_join_indices.cu @@ -28,7 +28,6 @@ #include #include -#include #include #include #include @@ -39,6 +38,7 @@ #include #include #include +#include #include #include @@ -58,7 +58,7 @@ filter_join_indices(cudf::table_view const& left, ast::expression const& predicate, join_kind join_kind, std::optional output_size, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { // Validate inputs @@ -218,7 +218,7 @@ filter_join_indices(cudf::table_view const& left, {}, {}, {}, - stream.value()}; + stream.get()}; auto predicate_func = [predicate_results_ptr] __device__(std::size_t idx) -> bool { return static_cast(predicate_results_ptr[idx]); @@ -228,7 +228,7 @@ filter_join_indices(cudf::table_view const& left, left_ptr + left_indices.size(), cuda::counting_iterator{0}, predicate_func, - stream.value()); + stream.get()); auto const num_invalid = left.num_rows() - num_filter_passing; @@ -248,14 +248,14 @@ filter_join_indices(cudf::table_view const& left, predicate_it, d_num_valid.data(), left_indices.size(), - stream.value()); + stream.get()); rmm::device_buffer temp_storage(temp_storage_bytes, stream); cub::DeviceReduce::Sum(temp_storage.data(), temp_storage_bytes, predicate_it, d_num_valid.data(), left_indices.size(), - stream.value()); + stream.get()); return d_num_valid.value(stream); }(); auto const result_size = num_valid + num_invalid; @@ -299,7 +299,7 @@ filter_join_indices(cudf::table_view const& left, stream); } cub::DeviceTransform::Fill( - filtered_right_indices->begin() + num_valid, num_invalid, JoinNoMatch, stream.value()); + filtered_right_indices->begin() + num_valid, num_invalid, JoinNoMatch, stream.get()); } return std::pair{std::move(filtered_left_indices), std::move(filtered_right_indices)}; @@ -379,7 +379,7 @@ filter_join_indices_output_size(cudf::table_view const& left, cudf::device_span right_indices, ast::expression const& predicate, join_kind join_kind, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { // Validate inputs (same constraints as filter_join_indices) @@ -471,7 +471,7 @@ filter_join_indices(cudf::table_view const& left, ast::expression const& predicate, cudf::join_kind join_kind, std::optional output_size, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); @@ -486,7 +486,7 @@ filter_join_indices_output_size(cudf::table_view const& left, cudf::device_span right_indices, ast::expression const& predicate, cudf::join_kind join_kind, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); diff --git a/cpp/src/join/filter_join_indices/filter_join_indices_jit.cu b/cpp/src/join/filter_join_indices/filter_join_indices_jit.cu index ff3a7c1470c6..7268e3696fb4 100644 --- a/cpp/src/join/filter_join_indices/filter_join_indices_jit.cu +++ b/cpp/src/join/filter_join_indices/filter_join_indices_jit.cu @@ -22,7 +22,6 @@ #include #include -#include #include #include #include @@ -31,6 +30,7 @@ #include #include #include +#include #include #include @@ -92,7 +92,7 @@ kernel build_join_filter_kernel(std::string const& predicate_code, bool is_ptx, bool has_user_data, bool is_null_aware, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); @@ -134,7 +134,7 @@ void launch_join_filter_kernel(kernel const& kernel, std::span inputs, bool* predicate_results, std::optional user_data, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); @@ -181,7 +181,7 @@ apply_join_semantics(cudf::table_view const& left, cudf::device_span right_indices, rmm::device_uvector const& predicate_results, join_kind join_kind, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { auto make_empty_result = [&]() { @@ -246,7 +246,7 @@ apply_join_semantics(cudf::table_view const& left, {}, {}, {}, - stream.value()}; + stream.get()}; auto predicate_func = [predicate_results_ptr] __device__(std::size_t idx) -> bool { return static_cast(predicate_results_ptr[idx]); @@ -256,7 +256,7 @@ apply_join_semantics(cudf::table_view const& left, left_ptr + left_indices.size(), cuda::counting_iterator{0}, predicate_func, - stream.value()); + stream.get()); auto const num_invalid = left.num_rows() - num_filter_passing; @@ -298,7 +298,7 @@ apply_join_semantics(cudf::table_view const& left, stream); cub::DeviceTransform::Fill( - filtered_right_indices->begin() + num_valid, num_invalid, JoinNoMatch, stream.value()); + filtered_right_indices->begin() + num_valid, num_invalid, JoinNoMatch, stream.get()); } return std::pair{std::move(filtered_left_indices), std::move(filtered_right_indices)}; @@ -380,7 +380,7 @@ filter_join_indices_jit(cudf::table_view const& left, std::string const& predicate_code, join_kind join_kind, bool is_ptx, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); @@ -452,7 +452,7 @@ filter_join_indices_jit(cudf::table_view const& left, cudf::device_span right_indices, ast::expression const& predicate, join_kind join_kind, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); @@ -518,7 +518,7 @@ filter_join_indices_jit(cudf::table_view const& left, std::string const& predicate_code, cudf::join_kind join_kind, bool is_ptx, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); @@ -534,7 +534,7 @@ filter_join_indices_jit(cudf::table_view const& left, cudf::device_span right_indices, cudf::ast::expression const& predicate, cudf::join_kind join_kind, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); diff --git a/cpp/src/join/filter_join_indices/filter_join_indices_jit_kernel.cuh b/cpp/src/join/filter_join_indices/filter_join_indices_jit_kernel.cuh index 9fe033ae72de..1bfeab3e05d1 100644 --- a/cpp/src/join/filter_join_indices/filter_join_indices_jit_kernel.cuh +++ b/cpp/src/join/filter_join_indices/filter_join_indices_jit_kernel.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -10,9 +10,10 @@ #include #include -#include #include +#include + #include #include #include @@ -47,13 +48,13 @@ filter_join_indices_jit(cudf::table_view const& left, std::string const& predicate_code, join_kind join_kind, bool is_ptx, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** * @copydoc cudf::filter_join_indices_jit(table_view const&, table_view const&, * device_span, device_span, - * ast::expression const&, join_kind, rmm::cuda_stream_view, + * ast::expression const&, join_kind, cuda::stream_ref, * rmm::device_async_resource_ref) */ std::pair>, @@ -64,7 +65,7 @@ filter_join_indices_jit(cudf::table_view const& left, cudf::device_span right_indices, ast::expression const& predicate, join_kind join_kind, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); } // namespace detail diff --git a/cpp/src/join/filter_join_indices/filter_join_indices_kernel.cuh b/cpp/src/join/filter_join_indices/filter_join_indices_kernel.cuh index 86ecaa20fb93..299ec4f3738e 100644 --- a/cpp/src/join/filter_join_indices/filter_join_indices_kernel.cuh +++ b/cpp/src/join/filter_join_indices/filter_join_indices_kernel.cuh @@ -15,7 +15,7 @@ #include #include -#include +#include namespace cudf::detail { @@ -91,10 +91,10 @@ void launch_filter_gather_map_kernel( cudf::detail::grid_1d const& config, std::size_t shmem_per_block, bool* predicate_results, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { filter_join_indices_kernel - <<>>( + <<>>( left_table, right_table, left_indices, diff --git a/cpp/src/join/filter_join_indices/filter_join_indices_kernel.hpp b/cpp/src/join/filter_join_indices/filter_join_indices_kernel.hpp index aeb41f99f69f..31662c8b22e6 100644 --- a/cpp/src/join/filter_join_indices/filter_join_indices_kernel.hpp +++ b/cpp/src/join/filter_join_indices/filter_join_indices_kernel.hpp @@ -10,7 +10,7 @@ #include #include -#include +#include #include @@ -50,6 +50,6 @@ void launch_filter_gather_map_kernel( cudf::detail::grid_1d const& config, std::size_t shmem_per_block, bool* output_flags, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); } // namespace cudf::detail diff --git a/cpp/src/join/filter_join_indices/filter_join_indices_kernel_complex.cu b/cpp/src/join/filter_join_indices/filter_join_indices_kernel_complex.cu index e12ea20a0651..4eee3a6883f6 100644 --- a/cpp/src/join/filter_join_indices/filter_join_indices_kernel_complex.cu +++ b/cpp/src/join/filter_join_indices/filter_join_indices_kernel_complex.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -16,5 +16,5 @@ template void launch_filter_gather_map_kernel( cudf::detail::grid_1d const& config, std::size_t shmem_per_block, bool* output_flags, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); } // namespace cudf::detail diff --git a/cpp/src/join/filter_join_indices/filter_join_indices_kernel_null_complex.cu b/cpp/src/join/filter_join_indices/filter_join_indices_kernel_null_complex.cu index 531c2ac282ee..9b4a7403b610 100644 --- a/cpp/src/join/filter_join_indices/filter_join_indices_kernel_null_complex.cu +++ b/cpp/src/join/filter_join_indices/filter_join_indices_kernel_null_complex.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -16,5 +16,5 @@ template void launch_filter_gather_map_kernel( cudf::detail::grid_1d const& config, std::size_t shmem_per_block, bool* output_flags, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); } // namespace cudf::detail diff --git a/cpp/src/join/filter_join_indices/filter_join_indices_kernel_null_primitive.cu b/cpp/src/join/filter_join_indices/filter_join_indices_kernel_null_primitive.cu index 0b36ad324b56..c8b54ae98e3a 100644 --- a/cpp/src/join/filter_join_indices/filter_join_indices_kernel_null_primitive.cu +++ b/cpp/src/join/filter_join_indices/filter_join_indices_kernel_null_primitive.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -16,5 +16,5 @@ template void launch_filter_gather_map_kernel( cudf::detail::grid_1d const& config, std::size_t shmem_per_block, bool* output_flags, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); } // namespace cudf::detail diff --git a/cpp/src/join/filter_join_indices/filter_join_indices_kernel_primitive.cu b/cpp/src/join/filter_join_indices/filter_join_indices_kernel_primitive.cu index ab9252f243ac..f73478fa565f 100644 --- a/cpp/src/join/filter_join_indices/filter_join_indices_kernel_primitive.cu +++ b/cpp/src/join/filter_join_indices/filter_join_indices_kernel_primitive.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -16,5 +16,5 @@ template void launch_filter_gather_map_kernel( cudf::detail::grid_1d const& config, std::size_t shmem_per_block, bool* output_flags, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); } // namespace cudf::detail diff --git a/cpp/src/join/filter_join_indices/filter_join_indices_output_size_kernel.cuh b/cpp/src/join/filter_join_indices/filter_join_indices_output_size_kernel.cuh index f835add8b016..70399f8287b7 100644 --- a/cpp/src/join/filter_join_indices/filter_join_indices_output_size_kernel.cuh +++ b/cpp/src/join/filter_join_indices/filter_join_indices_output_size_kernel.cuh @@ -16,9 +16,8 @@ #include #include -#include - #include +#include namespace cudf::detail { @@ -108,10 +107,10 @@ void launch_filter_output_size_kernel( std::size_t shmem_per_block, cudf::join_kind join_kind, cudf::size_type* output_counts, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { filter_join_indices_output_size_kernel - <<>>( + <<>>( left_table, right_table, left_indices, diff --git a/cpp/src/join/filter_join_indices/filter_join_indices_output_size_kernel.hpp b/cpp/src/join/filter_join_indices/filter_join_indices_output_size_kernel.hpp index b343694e88af..2d24fd8fdbf7 100644 --- a/cpp/src/join/filter_join_indices/filter_join_indices_output_size_kernel.hpp +++ b/cpp/src/join/filter_join_indices/filter_join_indices_output_size_kernel.hpp @@ -13,7 +13,7 @@ #include #include -#include +#include #include @@ -57,6 +57,6 @@ void launch_filter_output_size_kernel( std::size_t shmem_per_block, cudf::join_kind join_kind, cudf::size_type* output_counts, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); } // namespace cudf::detail diff --git a/cpp/src/join/filter_join_indices/filter_join_indices_output_size_kernel_complex.cu b/cpp/src/join/filter_join_indices/filter_join_indices_output_size_kernel_complex.cu index b55a7e33d152..b588f0c3c84a 100644 --- a/cpp/src/join/filter_join_indices/filter_join_indices_output_size_kernel_complex.cu +++ b/cpp/src/join/filter_join_indices/filter_join_indices_output_size_kernel_complex.cu @@ -17,5 +17,5 @@ template void launch_filter_output_size_kernel( std::size_t shmem_per_block, cudf::join_kind join_kind, cudf::size_type* output_counts, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); } // namespace cudf::detail diff --git a/cpp/src/join/filter_join_indices/filter_join_indices_output_size_kernel_null_complex.cu b/cpp/src/join/filter_join_indices/filter_join_indices_output_size_kernel_null_complex.cu index 794b6ae55b48..f97c22b537fb 100644 --- a/cpp/src/join/filter_join_indices/filter_join_indices_output_size_kernel_null_complex.cu +++ b/cpp/src/join/filter_join_indices/filter_join_indices_output_size_kernel_null_complex.cu @@ -17,5 +17,5 @@ template void launch_filter_output_size_kernel( std::size_t shmem_per_block, cudf::join_kind join_kind, cudf::size_type* output_counts, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); } // namespace cudf::detail diff --git a/cpp/src/join/filter_join_indices/filter_join_indices_output_size_kernel_null_primitive.cu b/cpp/src/join/filter_join_indices/filter_join_indices_output_size_kernel_null_primitive.cu index 84358e6fe9d7..d9fe12361056 100644 --- a/cpp/src/join/filter_join_indices/filter_join_indices_output_size_kernel_null_primitive.cu +++ b/cpp/src/join/filter_join_indices/filter_join_indices_output_size_kernel_null_primitive.cu @@ -17,5 +17,5 @@ template void launch_filter_output_size_kernel( std::size_t shmem_per_block, cudf::join_kind join_kind, cudf::size_type* output_counts, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); } // namespace cudf::detail diff --git a/cpp/src/join/filter_join_indices/filter_join_indices_output_size_kernel_primitive.cu b/cpp/src/join/filter_join_indices/filter_join_indices_output_size_kernel_primitive.cu index f2de1322e301..f3c6eba5bd58 100644 --- a/cpp/src/join/filter_join_indices/filter_join_indices_output_size_kernel_primitive.cu +++ b/cpp/src/join/filter_join_indices/filter_join_indices_output_size_kernel_primitive.cu @@ -17,5 +17,5 @@ template void launch_filter_output_size_kernel( std::size_t shmem_per_block, cudf::join_kind join_kind, cudf::size_type* output_counts, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); } // namespace cudf::detail diff --git a/cpp/src/join/filtered_join/filtered_join.cu b/cpp/src/join/filtered_join/filtered_join.cu index d1766f0ffab3..046f78a07478 100644 --- a/cpp/src/join/filtered_join/filtered_join.cu +++ b/cpp/src/join/filtered_join/filtered_join.cu @@ -17,7 +17,6 @@ #include #include -#include #include #include #include @@ -26,6 +25,7 @@ #include #include +#include #include #include @@ -40,7 +40,7 @@ namespace detail { * @brief Returns a validity mask for rows without nulls at any nested level, or null when unused. */ std::pair make_filtered_join_row_bitmask( - table_view const& input, null_equality nulls_equal, rmm::cuda_stream_view stream) + table_view const& input, null_equality nulls_equal, cuda::stream_ref stream) { if (nulls_equal == null_equality::EQUAL || !has_nested_nulls(input)) { return std::pair(rmm::device_buffer{0, stream}, nullptr); @@ -98,13 +98,13 @@ std::size_t filtered_join::compute_bucket_storage_size(cudf::size_type num_rows, filtered_join::filtered_join(cudf::table_view const& right, cudf::null_equality compare_nulls, double load_factor, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, cuda::mr::any_resource mr) : _right_mode{select_row_operator_mode(right)}, _bucket_storage{cuco::extent{compute_bucket_storage_size( right.num_rows(), checked_load_factor(load_factor), _right_mode)}, rmm::mr::polymorphic_allocator{std::move(mr)}, - stream.value()}, + stream.get()}, _right{right}, _nulls_equal{compare_nulls}, _preprocessed_right{cudf::detail::row::equality::preprocessed_table::create(_right, stream)} @@ -124,7 +124,7 @@ filtered_join::filtered_join(cudf::table_view const& right, std::unique_ptr> filtered_join::semi_anti_join( cudf::table_view const& left, join_kind kind, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { cudf::scoped_range range{"filtered_join::semi_anti_join"}; @@ -156,7 +156,7 @@ std::unique_ptr> filtered_join::semi_anti_j } std::unique_ptr> filtered_join::semi_join( - cudf::table_view const& left, rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr) + cudf::table_view const& left, cuda::stream_ref stream, rmm::device_async_resource_ref mr) { // Early return for empty right or left table if (_right.num_rows() == 0 || left.num_rows() == 0) { @@ -167,7 +167,7 @@ std::unique_ptr> filtered_join::semi_join( } std::unique_ptr> filtered_join::anti_join( - cudf::table_view const& left, rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr) + cudf::table_view const& left, cuda::stream_ref stream, rmm::device_async_resource_ref mr) { // Early return for empty left table if (left.num_rows() == 0) { @@ -192,7 +192,7 @@ filtered_join::~filtered_join() = default; filtered_join::filtered_join(cudf::table_view const& build, null_equality compare_nulls, double load_factor, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, cuda::mr::any_resource mr) : _impl{std::make_unique( build, compare_nulls, load_factor, stream, std::move(mr))} @@ -201,7 +201,7 @@ filtered_join::filtered_join(cudf::table_view const& build, filtered_join::filtered_join(cudf::table_view const& build, null_equality compare_nulls, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, cuda::mr::any_resource mr) : filtered_join( build, compare_nulls, cudf::detail::CUCO_DESIRED_LOAD_FACTOR, stream, std::move(mr)) @@ -209,17 +209,13 @@ filtered_join::filtered_join(cudf::table_view const& build, } std::unique_ptr> filtered_join::semi_join( - cudf::table_view const& probe, - rmm::cuda_stream_view stream, - rmm::device_async_resource_ref mr) const + cudf::table_view const& probe, cuda::stream_ref stream, rmm::device_async_resource_ref mr) const { return _impl->semi_join(probe, stream, mr); } std::unique_ptr> filtered_join::anti_join( - cudf::table_view const& probe, - rmm::cuda_stream_view stream, - rmm::device_async_resource_ref mr) const + cudf::table_view const& probe, cuda::stream_ref stream, rmm::device_async_resource_ref mr) const { return _impl->anti_join(probe, stream, mr); } diff --git a/cpp/src/join/filtered_join/filtered_join_common.cuh b/cpp/src/join/filtered_join/filtered_join_common.cuh index aa2fb3c4e2cf..f2bac5350d87 100644 --- a/cpp/src/join/filtered_join/filtered_join_common.cuh +++ b/cpp/src/join/filtered_join/filtered_join_common.cuh @@ -13,11 +13,11 @@ #include #include -#include #include #include #include +#include #include #include @@ -38,7 +38,7 @@ struct precomputed_hash { }; std::pair make_filtered_join_row_bitmask( - table_view const& input, null_equality nulls_equal, rmm::cuda_stream_view stream); + table_view const& input, null_equality nulls_equal, cuda::stream_ref stream); class filtered_join_row_is_valid { public: @@ -56,7 +56,7 @@ class filtered_join_row_is_valid { template void filtered_join::insert_right_table(Iterator right_iter, Ref const& insert_ref, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { cudf::scoped_range range{"filtered_join::insert_right_table"}; // Insert valid rows from the right table into the hash table. @@ -64,7 +64,7 @@ void filtered_join::insert_right_table(Iterator right_iter, auto const bitmask_buffer_and_ptr = make_filtered_join_row_bitmask(_right, _nulls_equal, stream); if (bitmask_buffer_and_ptr.second != nullptr) { cuco::detail::open_addressing_ns::insert_if_n - <<>>( + <<>>( right_iter, _right.num_rows(), cuda::counting_iterator{0}, @@ -72,7 +72,7 @@ void filtered_join::insert_right_table(Iterator right_iter, insert_ref); } else { cuco::detail::open_addressing_ns::insert_if_n - <<>>( + <<>>( right_iter, _right.num_rows(), cuda::constant_iterator{true}, @@ -87,14 +87,14 @@ void filtered_join::query_right_table(cudf::table_view const& left, Iterator left_iter, Ref query_ref, cudf::device_span contains_map, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { cudf::scoped_range range{"filtered_join::query_right_table"}; auto const grid_size = cuco::detail::grid_size(left.num_rows(), CGSize); auto const bitmask_buffer_and_ptr = make_filtered_join_row_bitmask(left, _nulls_equal, stream); if (bitmask_buffer_and_ptr.second != nullptr) { cuco::detail::open_addressing_ns::contains_if_n - <<>>( + <<>>( left_iter, left.num_rows(), cuda::counting_iterator{0}, @@ -103,7 +103,7 @@ void filtered_join::query_right_table(cudf::table_view const& left, query_ref); } else { cuco::detail::open_addressing_ns::contains_if_n - <<>>( + <<>>( left_iter, left.num_rows(), cuda::constant_iterator{true}, diff --git a/cpp/src/join/filtered_join/filtered_join_flat.cu b/cpp/src/join/filtered_join/filtered_join_flat.cu index 5837c5aafe73..2550d5f47d2e 100644 --- a/cpp/src/join/filtered_join/filtered_join_flat.cu +++ b/cpp/src/join/filtered_join/filtered_join_flat.cu @@ -15,17 +15,16 @@ #include #include -#include - #include #include #include +#include #include namespace cudf::detail { -void filtered_join::insert_right_table_flat(rmm::cuda_stream_view stream) +void filtered_join::insert_right_table_flat(cuda::stream_ref stream) { auto const comparator = cudf::detail::row::equality::self_comparator{_preprocessed_right}.equal_to( @@ -49,7 +48,7 @@ void filtered_join::query_right_table_flat( cudf::table_view const& left, std::shared_ptr const& preprocessed_left, cudf::device_span contains_map, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { auto const comparator = cudf::detail::row::equality::two_table_comparator{_preprocessed_right, preprocessed_left} diff --git a/cpp/src/join/filtered_join/filtered_join_nested.cu b/cpp/src/join/filtered_join/filtered_join_nested.cu index cb4abb8ad8b8..a119f15d11c6 100644 --- a/cpp/src/join/filtered_join/filtered_join_nested.cu +++ b/cpp/src/join/filtered_join/filtered_join_nested.cu @@ -13,15 +13,14 @@ #include #include -#include - #include #include #include +#include namespace cudf::detail { -void filtered_join::insert_right_table_nested(rmm::cuda_stream_view stream) +void filtered_join::insert_right_table_nested(cuda::stream_ref stream) { auto const comparator = cudf::detail::row::equality::self_comparator{_preprocessed_right}.equal_to( diff --git a/cpp/src/join/filtered_join/filtered_join_nested_query.cu b/cpp/src/join/filtered_join/filtered_join_nested_query.cu index c4c27dfccae1..ce3d1f888af0 100644 --- a/cpp/src/join/filtered_join/filtered_join_nested_query.cu +++ b/cpp/src/join/filtered_join/filtered_join_nested_query.cu @@ -16,11 +16,10 @@ #include #include -#include - #include #include #include +#include #include @@ -30,7 +29,7 @@ void filtered_join::query_right_table_nested( cudf::table_view const& left, std::shared_ptr const& preprocessed_left, cudf::device_span contains_map, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { auto const comparator = cudf::detail::row::equality::two_table_comparator{_preprocessed_right, preprocessed_left} diff --git a/cpp/src/join/filtered_join/filtered_join_primitive.cu b/cpp/src/join/filtered_join/filtered_join_primitive.cu index 2c3026b6d893..22c4113ca67d 100644 --- a/cpp/src/join/filtered_join/filtered_join_primitive.cu +++ b/cpp/src/join/filtered_join/filtered_join_primitive.cu @@ -15,11 +15,10 @@ #include #include -#include - #include #include #include +#include #include @@ -33,7 +32,7 @@ using primitive_row_hasher = } // namespace -void filtered_join::insert_right_table_primitive(rmm::cuda_stream_view stream) +void filtered_join::insert_right_table_primitive(cuda::stream_ref stream) { auto const comparator = primitive_row_comparator{ nullate::DYNAMIC{true}, _preprocessed_right, _preprocessed_right, _nulls_equal}; @@ -53,7 +52,7 @@ void filtered_join::query_right_table_primitive( cudf::table_view const& left, std::shared_ptr const& preprocessed_left, cudf::device_span contains_map, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { auto const comparator = primitive_row_comparator{ nullate::DYNAMIC{true}, _preprocessed_right, preprocessed_left, _nulls_equal}; diff --git a/cpp/src/join/hash_join/common.cuh b/cpp/src/join/hash_join/common.cuh index d80f981099ef..517573412e65 100644 --- a/cpp/src/join/hash_join/common.cuh +++ b/cpp/src/join/hash_join/common.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ #pragma once @@ -11,10 +11,11 @@ #include #include -#include #include #include +#include + #include namespace cudf::detail { @@ -35,7 +36,7 @@ std::unique_ptr> make_join_match_counts( null_equality compare_nulls, join_kind join, table_view const& left, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); } // namespace cudf::detail diff --git a/cpp/src/join/hash_join/finalize_partitioned_full_join.cpp b/cpp/src/join/hash_join/finalize_partitioned_full_join.cpp index c5e36c5be74a..385f3bff56c1 100644 --- a/cpp/src/join/hash_join/finalize_partitioned_full_join.cpp +++ b/cpp/src/join/hash_join/finalize_partitioned_full_join.cpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -12,9 +12,10 @@ #include #include -#include #include +#include + namespace cudf { std::pair>, @@ -24,7 +25,7 @@ hash_join::finalize_partitioned_full_join( cudf::host_span const> right_partials, size_type left_table_num_rows, size_type right_table_num_rows, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); diff --git a/cpp/src/join/hash_join/full_join_match_context.cpp b/cpp/src/join/hash_join/full_join_match_context.cpp index f065064e7f6a..7eee7127782f 100644 --- a/cpp/src/join/hash_join/full_join_match_context.cpp +++ b/cpp/src/join/hash_join/full_join_match_context.cpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -12,17 +12,13 @@ namespace cudf::detail { template cudf::join_match_context hash_join::full_join_match_context( - cudf::table_view const& left, - rmm::cuda_stream_view stream, - rmm::device_async_resource_ref mr) const + cudf::table_view const& left, cuda::stream_ref stream, rmm::device_async_resource_ref mr) const { cudf::scoped_range range{"hash_join::full_join_match_context"}; return cudf::join_match_context{left, make_match_counts(join_kind::FULL_JOIN, left, stream, mr)}; } template cudf::join_match_context cudf::hash_join::impl_type::full_join_match_context( - cudf::table_view const& left, - rmm::cuda_stream_view stream, - rmm::device_async_resource_ref mr) const; + cudf::table_view const& left, cuda::stream_ref stream, rmm::device_async_resource_ref mr) const; } // namespace cudf::detail diff --git a/cpp/src/join/hash_join/full_join_retrieve.cu b/cpp/src/join/hash_join/full_join_retrieve.cu index 7830b6aea6d9..0c5689fb199d 100644 --- a/cpp/src/join/hash_join/full_join_retrieve.cu +++ b/cpp/src/join/hash_join/full_join_retrieve.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -12,7 +12,7 @@ std::pair>, std::unique_ptr>> hash_join::full_join(cudf::table_view const& left, std::optional output_size, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const { return this->template join_retrieve(left, output_size, stream, mr); @@ -22,7 +22,7 @@ template std::pair>, std::unique_ptr>> hash_join::full_join(cudf::table_view const& left, std::optional output_size, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const; } // namespace cudf::detail diff --git a/cpp/src/join/hash_join/full_join_size.cu b/cpp/src/join/hash_join/full_join_size.cu index b73f19b42408..dbc8ba27dc59 100644 --- a/cpp/src/join/hash_join/full_join_size.cu +++ b/cpp/src/join/hash_join/full_join_size.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -9,15 +9,13 @@ namespace cudf::detail { template std::size_t hash_join::full_join_size(cudf::table_view const& left, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const { return this->template join_size(left, stream, mr); } template std::size_t hash_join::full_join_size( - cudf::table_view const& left, - rmm::cuda_stream_view stream, - rmm::device_async_resource_ref mr) const; + cudf::table_view const& left, cuda::stream_ref stream, rmm::device_async_resource_ref mr) const; } // namespace cudf::detail diff --git a/cpp/src/join/hash_join/full_join_size_impl.cu b/cpp/src/join/hash_join/full_join_size_impl.cu index 0e9afcde668d..5c9403a020c6 100644 --- a/cpp/src/join/hash_join/full_join_size_impl.cu +++ b/cpp/src/join/hash_join/full_join_size_impl.cu @@ -24,7 +24,7 @@ namespace { std::size_t compute_left_join_complement_size(cudf::device_span right_indices, size_type left_table_row_count, size_type right_table_row_count, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { if (left_table_row_count == 0) { return right_table_row_count; } @@ -59,7 +59,7 @@ std::size_t get_full_join_size( cudf::detail::hash_table_t const& hash_table, bool has_nulls, null_equality compare_nulls, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { std::size_t join_size = compute_join_output_size(right_table, diff --git a/cpp/src/join/hash_join/hash_join.cu b/cpp/src/join/hash_join/hash_join.cu index b699e04fff42..89d990bec73b 100644 --- a/cpp/src/join/hash_join/hash_join.cu +++ b/cpp/src/join/hash_join/hash_join.cu @@ -66,7 +66,7 @@ void build_hash_join( bool has_nested_nulls, null_equality nulls_equal, [[maybe_unused]] bitmask_type const* bitmask, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { CUDF_EXPECTS(0 != right.num_columns(), "Selected right dataset is empty", std::invalid_argument); CUDF_EXPECTS(0 != right.num_rows(), "Right side table has no rows", std::invalid_argument); @@ -75,12 +75,12 @@ void build_hash_join( auto const iter = cudf::detail::make_counting_transform_iterator(0, pair_fn{d_hasher}); if (nulls_equal == cudf::null_equality::EQUAL or not nullable(right)) { - hash_table.insert(iter, iter + right.num_rows(), stream.value()); + hash_table.insert(iter, iter + right.num_rows(), stream.get()); } else { auto const stencil = cuda::counting_iterator{0}; auto const pred = row_is_valid{bitmask}; - hash_table.insert_if(iter, iter + right.num_rows(), stencil, pred, stream.value()); + hash_table.insert_if(iter, iter + right.num_rows(), stencil, pred, stream.get()); } }; @@ -103,7 +103,7 @@ template hash_join::hash_join(cudf::table_view const& right, bool has_nulls, cudf::null_equality compare_nulls, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, cuda::mr::any_resource mr) : hash_join{right, has_nulls, compare_nulls, CUCO_DESIRED_LOAD_FACTOR, stream, std::move(mr)} { @@ -114,7 +114,7 @@ hash_join::hash_join(cudf::table_view const& right, bool has_nulls, cudf::null_equality compare_nulls, double load_factor, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, cuda::mr::any_resource mr) : _has_nulls(has_nulls), _is_empty{right.num_rows() == 0}, @@ -128,7 +128,7 @@ hash_join::hash_join(cudf::table_view const& right, {}, {}, rmm::mr::polymorphic_allocator{std::move(mr)}, - stream.value()}})}, + stream.get()}})}, _right{right}, _preprocessed_right{cudf::detail::row::equality::preprocessed_table::create(_right, stream)} { @@ -151,7 +151,7 @@ template hash_join::hash_join( cudf::table_view const& right, bool has_nulls, cudf::null_equality compare_nulls, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, cuda::mr::any_resource mr); template hash_join::hash_join( @@ -159,7 +159,7 @@ template hash_join::hash_join( bool has_nulls, cudf::null_equality compare_nulls, double load_factor, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, cuda::mr::any_resource mr); template @@ -175,7 +175,7 @@ hash_join::~hash_join() = default; hash_join::hash_join(cudf::table_view const& right, null_equality compare_nulls, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, cuda::mr::any_resource mr) : hash_join(right, nullable_join::YES, @@ -190,7 +190,7 @@ hash_join::hash_join(cudf::table_view const& right, nullable_join has_nulls, null_equality compare_nulls, double load_factor, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, cuda::mr::any_resource mr) : _impl{std::make_unique( right, has_nulls == nullable_join::YES, compare_nulls, load_factor, stream, std::move(mr))} @@ -201,7 +201,7 @@ std::pair>, std::unique_ptr>> hash_join::inner_join(cudf::table_view const& left, std::optional output_size, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const { return _impl->inner_join(left, output_size, stream, mr); @@ -211,7 +211,7 @@ std::pair>, std::unique_ptr>> hash_join::left_join(cudf::table_view const& left, std::optional output_size, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const { return _impl->left_join(left, output_size, stream, mr); @@ -221,48 +221,44 @@ std::pair>, std::unique_ptr>> hash_join::full_join(cudf::table_view const& left, std::optional output_size, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const { return _impl->full_join(left, output_size, stream, mr); } -std::size_t hash_join::inner_join_size(cudf::table_view const& left, - rmm::cuda_stream_view stream) const +std::size_t hash_join::inner_join_size(cudf::table_view const& left, cuda::stream_ref stream) const { return _impl->inner_join_size(left, stream); } -std::size_t hash_join::left_join_size(cudf::table_view const& left, - rmm::cuda_stream_view stream) const +std::size_t hash_join::left_join_size(cudf::table_view const& left, cuda::stream_ref stream) const { return _impl->left_join_size(left, stream); } std::size_t hash_join::full_join_size(cudf::table_view const& left, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const { return _impl->full_join_size(left, stream, mr); } cudf::join_match_context hash_join::inner_join_match_context( - cudf::table_view const& left, - rmm::cuda_stream_view stream, - rmm::device_async_resource_ref mr) const + cudf::table_view const& left, cuda::stream_ref stream, rmm::device_async_resource_ref mr) const { return _impl->inner_join_match_context(left, stream, mr); } cudf::join_match_context hash_join::left_join_match_context(cudf::table_view const& left, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const { return _impl->left_join_match_context(left, stream, mr); } cudf::join_match_context hash_join::full_join_match_context(cudf::table_view const& left, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const { return _impl->full_join_match_context(left, stream, mr); @@ -271,7 +267,7 @@ cudf::join_match_context hash_join::full_join_match_context(cudf::table_view con std::pair>, std::unique_ptr>> hash_join::partitioned_inner_join(cudf::join_partition_context const& context, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const { CUDF_FUNC_RANGE(); @@ -281,7 +277,7 @@ hash_join::partitioned_inner_join(cudf::join_partition_context const& context, std::pair>, std::unique_ptr>> hash_join::partitioned_left_join(cudf::join_partition_context const& context, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const { CUDF_FUNC_RANGE(); @@ -291,7 +287,7 @@ hash_join::partitioned_left_join(cudf::join_partition_context const& context, std::pair>, std::unique_ptr>> hash_join::partitioned_full_join(cudf::join_partition_context const& context, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const { CUDF_FUNC_RANGE(); diff --git a/cpp/src/join/hash_join/inner_join_match_context.cpp b/cpp/src/join/hash_join/inner_join_match_context.cpp index cf107c7a4223..4a1529b32f87 100644 --- a/cpp/src/join/hash_join/inner_join_match_context.cpp +++ b/cpp/src/join/hash_join/inner_join_match_context.cpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -12,17 +12,13 @@ namespace cudf::detail { template cudf::join_match_context hash_join::inner_join_match_context( - cudf::table_view const& left, - rmm::cuda_stream_view stream, - rmm::device_async_resource_ref mr) const + cudf::table_view const& left, cuda::stream_ref stream, rmm::device_async_resource_ref mr) const { cudf::scoped_range range{"hash_join::inner_join_match_context"}; return cudf::join_match_context{left, make_match_counts(join_kind::INNER_JOIN, left, stream, mr)}; } template cudf::join_match_context cudf::hash_join::impl_type::inner_join_match_context( - cudf::table_view const& left, - rmm::cuda_stream_view stream, - rmm::device_async_resource_ref mr) const; + cudf::table_view const& left, cuda::stream_ref stream, rmm::device_async_resource_ref mr) const; } // namespace cudf::detail diff --git a/cpp/src/join/hash_join/inner_join_retrieve.cu b/cpp/src/join/hash_join/inner_join_retrieve.cu index 57386367a81e..661eebb78ef6 100644 --- a/cpp/src/join/hash_join/inner_join_retrieve.cu +++ b/cpp/src/join/hash_join/inner_join_retrieve.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -12,7 +12,7 @@ std::pair>, std::unique_ptr>> hash_join::inner_join(cudf::table_view const& left, std::optional output_size, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const { return this->template join_retrieve(left, output_size, stream, mr); @@ -22,7 +22,7 @@ template std::pair>, std::unique_ptr>> hash_join::inner_join(cudf::table_view const& left, std::optional output_size, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const; } // namespace cudf::detail diff --git a/cpp/src/join/hash_join/inner_join_size.cu b/cpp/src/join/hash_join/inner_join_size.cu index 2fedd93593e0..c89643749848 100644 --- a/cpp/src/join/hash_join/inner_join_size.cu +++ b/cpp/src/join/hash_join/inner_join_size.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -9,12 +9,12 @@ namespace cudf::detail { template std::size_t hash_join::inner_join_size(cudf::table_view const& left, - rmm::cuda_stream_view stream) const + cuda::stream_ref stream) const { return this->template join_size(left, stream); } -template std::size_t hash_join::inner_join_size( - cudf::table_view const& left, rmm::cuda_stream_view stream) const; +template std::size_t hash_join::inner_join_size(cudf::table_view const& left, + cuda::stream_ref stream) const; } // namespace cudf::detail diff --git a/cpp/src/join/hash_join/left_join_match_context.cpp b/cpp/src/join/hash_join/left_join_match_context.cpp index 59bb6255a796..c3dd9d9d2f79 100644 --- a/cpp/src/join/hash_join/left_join_match_context.cpp +++ b/cpp/src/join/hash_join/left_join_match_context.cpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -12,17 +12,13 @@ namespace cudf::detail { template cudf::join_match_context hash_join::left_join_match_context( - cudf::table_view const& left, - rmm::cuda_stream_view stream, - rmm::device_async_resource_ref mr) const + cudf::table_view const& left, cuda::stream_ref stream, rmm::device_async_resource_ref mr) const { cudf::scoped_range range{"hash_join::left_join_match_context"}; return cudf::join_match_context{left, make_match_counts(join_kind::LEFT_JOIN, left, stream, mr)}; } template cudf::join_match_context cudf::hash_join::impl_type::left_join_match_context( - cudf::table_view const& left, - rmm::cuda_stream_view stream, - rmm::device_async_resource_ref mr) const; + cudf::table_view const& left, cuda::stream_ref stream, rmm::device_async_resource_ref mr) const; } // namespace cudf::detail diff --git a/cpp/src/join/hash_join/left_join_retrieve.cu b/cpp/src/join/hash_join/left_join_retrieve.cu index d84eb05cd4cc..c57d75350aae 100644 --- a/cpp/src/join/hash_join/left_join_retrieve.cu +++ b/cpp/src/join/hash_join/left_join_retrieve.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -12,7 +12,7 @@ std::pair>, std::unique_ptr>> hash_join::left_join(cudf::table_view const& left, std::optional output_size, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const { return this->template join_retrieve(left, output_size, stream, mr); @@ -22,7 +22,7 @@ template std::pair>, std::unique_ptr>> hash_join::left_join(cudf::table_view const& left, std::optional output_size, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const; } // namespace cudf::detail diff --git a/cpp/src/join/hash_join/left_join_size.cu b/cpp/src/join/hash_join/left_join_size.cu index 4bc382165d35..1142b717781a 100644 --- a/cpp/src/join/hash_join/left_join_size.cu +++ b/cpp/src/join/hash_join/left_join_size.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -9,12 +9,12 @@ namespace cudf::detail { template std::size_t hash_join::left_join_size(cudf::table_view const& left, - rmm::cuda_stream_view stream) const + cuda::stream_ref stream) const { return this->template join_size(left, stream); } -template std::size_t hash_join::left_join_size( - cudf::table_view const& left, rmm::cuda_stream_view stream) const; +template std::size_t hash_join::left_join_size(cudf::table_view const& left, + cuda::stream_ref stream) const; } // namespace cudf::detail diff --git a/cpp/src/join/hash_join/match_context.cu b/cpp/src/join/hash_join/match_context.cu index 5fc2dd5ba9cf..e6812f55b3be 100644 --- a/cpp/src/join/hash_join/match_context.cu +++ b/cpp/src/join/hash_join/match_context.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -28,7 +28,7 @@ std::unique_ptr> make_join_match_counts( null_equality compare_nulls, join_kind join, table_view const& left, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { auto match_counts = std::make_unique>(left.num_rows(), stream, mr); @@ -80,7 +80,7 @@ template std::unique_ptr> hash_join::make_match_counts( join_kind join, cudf::table_view const& left, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const { return make_join_match_counts(_right, @@ -98,7 +98,7 @@ std::unique_ptr> hash_join::make_match_co template std::unique_ptr> hash_join::make_match_counts(join_kind, cudf::table_view const&, - rmm::cuda_stream_view, + cuda::stream_ref, rmm::device_async_resource_ref) const; } // namespace cudf::detail diff --git a/cpp/src/join/hash_join/partitioned_count.cu b/cpp/src/join/hash_join/partitioned_count.cu index 67af2bf0d056..4ddc8a9b5473 100644 --- a/cpp/src/join/hash_join/partitioned_count.cu +++ b/cpp/src/join/hash_join/partitioned_count.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -8,16 +8,13 @@ namespace cudf::detail { -template void launch_partitioned_count(probe_key_type const*, - thread_index_type, - size_type*, - primitive_count_ref_t, - rmm::cuda_stream_view); +template void launch_partitioned_count( + probe_key_type const*, thread_index_type, size_type*, primitive_count_ref_t, cuda::stream_ref); template void launch_partitioned_count( - probe_key_type const*, thread_index_type, size_type*, nested_count_ref_t, rmm::cuda_stream_view); + probe_key_type const*, thread_index_type, size_type*, nested_count_ref_t, cuda::stream_ref); template void launch_partitioned_count( - probe_key_type const*, thread_index_type, size_type*, flat_count_ref_t, rmm::cuda_stream_view); + probe_key_type const*, thread_index_type, size_type*, flat_count_ref_t, cuda::stream_ref); } // namespace cudf::detail diff --git a/cpp/src/join/hash_join/partitioned_count_kernels.cuh b/cpp/src/join/hash_join/partitioned_count_kernels.cuh index cf21086b68e9..e07965ab919a 100644 --- a/cpp/src/join/hash_join/partitioned_count_kernels.cuh +++ b/cpp/src/join/hash_join/partitioned_count_kernels.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -9,10 +9,9 @@ #include -#include - #include #include +#include namespace cudf::detail { @@ -80,7 +79,7 @@ void launch_partitioned_count(probe_key_type const* keys, thread_index_type n, size_type* output, Ref ref, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { if (n == 0) { return; } @@ -88,7 +87,7 @@ void launch_partitioned_count(probe_key_type const* keys, grid_1d{static_cast(n * DEFAULT_JOIN_CG_SIZE), DEFAULT_JOIN_BLOCK_SIZE}; partitioned_count_kernel - <<>>(keys, n, output, ref); + <<>>(keys, n, output, ref); CUDF_CUDA_TRY(cudaGetLastError()); } diff --git a/cpp/src/join/hash_join/partitioned_count_kernels.hpp b/cpp/src/join/hash_join/partitioned_count_kernels.hpp index d6bb30b7f00f..14e6db4bc294 100644 --- a/cpp/src/join/hash_join/partitioned_count_kernels.hpp +++ b/cpp/src/join/hash_join/partitioned_count_kernels.hpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -7,7 +7,7 @@ #include "kernels_common.cuh" -#include +#include namespace cudf::detail { @@ -17,6 +17,6 @@ void launch_partitioned_count(probe_key_type const* keys, thread_index_type n, size_type* output, Ref ref, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); } // namespace cudf::detail diff --git a/cpp/src/join/hash_join/partitioned_count_outer.cu b/cpp/src/join/hash_join/partitioned_count_outer.cu index 3f4204cb1fa8..eb0a57632cbd 100644 --- a/cpp/src/join/hash_join/partitioned_count_outer.cu +++ b/cpp/src/join/hash_join/partitioned_count_outer.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -8,16 +8,13 @@ namespace cudf::detail { -template void launch_partitioned_count(probe_key_type const*, - thread_index_type, - size_type*, - primitive_count_ref_t, - rmm::cuda_stream_view); +template void launch_partitioned_count( + probe_key_type const*, thread_index_type, size_type*, primitive_count_ref_t, cuda::stream_ref); template void launch_partitioned_count( - probe_key_type const*, thread_index_type, size_type*, nested_count_ref_t, rmm::cuda_stream_view); + probe_key_type const*, thread_index_type, size_type*, nested_count_ref_t, cuda::stream_ref); template void launch_partitioned_count( - probe_key_type const*, thread_index_type, size_type*, flat_count_ref_t, rmm::cuda_stream_view); + probe_key_type const*, thread_index_type, size_type*, flat_count_ref_t, cuda::stream_ref); } // namespace cudf::detail diff --git a/cpp/src/join/hash_join/partitioned_full_join.cu b/cpp/src/join/hash_join/partitioned_full_join.cu index 06a77a461211..d343492f71e8 100644 --- a/cpp/src/join/hash_join/partitioned_full_join.cu +++ b/cpp/src/join/hash_join/partitioned_full_join.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -11,7 +11,7 @@ template std::pair>, std::unique_ptr>> hash_join::partitioned_full_join(cudf::join_partition_context const& context, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const { return this->partitioned_join_retrieve(join_kind::FULL_JOIN, context, stream, mr); @@ -20,7 +20,7 @@ hash_join::partitioned_full_join(cudf::join_partition_context const& con template std::pair>, std::unique_ptr>> hash_join::partitioned_full_join(cudf::join_partition_context const& context, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const; } // namespace cudf::detail diff --git a/cpp/src/join/hash_join/partitioned_inner_join.cu b/cpp/src/join/hash_join/partitioned_inner_join.cu index 26a0f873de9e..37a91bf89efa 100644 --- a/cpp/src/join/hash_join/partitioned_inner_join.cu +++ b/cpp/src/join/hash_join/partitioned_inner_join.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -11,7 +11,7 @@ template std::pair>, std::unique_ptr>> hash_join::partitioned_inner_join(cudf::join_partition_context const& context, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const { return this->partitioned_join_retrieve(join_kind::INNER_JOIN, context, stream, mr); @@ -20,7 +20,7 @@ hash_join::partitioned_inner_join(cudf::join_partition_context const& co template std::pair>, std::unique_ptr>> hash_join::partitioned_inner_join(cudf::join_partition_context const& context, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const; } // namespace cudf::detail diff --git a/cpp/src/join/hash_join/partitioned_join_retrieve.cu b/cpp/src/join/hash_join/partitioned_join_retrieve.cu index 77dcae1e9325..7c64b9464c55 100644 --- a/cpp/src/join/hash_join/partitioned_join_retrieve.cu +++ b/cpp/src/join/hash_join/partitioned_join_retrieve.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -33,7 +33,7 @@ std::pair>, std::unique_ptr>> make_trivial_outer_indices(size_type left_start_idx, size_type partition_size, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { auto left_indices = std::make_unique>(partition_size, stream, mr); @@ -57,7 +57,7 @@ std::pair>, std::unique_ptr>> hash_join::partitioned_join_retrieve(join_kind join, cudf::join_partition_context const& context, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const { CUDF_FUNC_RANGE(); @@ -158,7 +158,7 @@ template std::pair>, std::unique_ptr>> hash_join::partitioned_join_retrieve(join_kind, cudf::join_partition_context const&, - rmm::cuda_stream_view, + cuda::stream_ref, rmm::device_async_resource_ref) const; } // namespace cudf::detail diff --git a/cpp/src/join/hash_join/partitioned_left_join.cu b/cpp/src/join/hash_join/partitioned_left_join.cu index 1200a9f6a0ec..7643b4be1314 100644 --- a/cpp/src/join/hash_join/partitioned_left_join.cu +++ b/cpp/src/join/hash_join/partitioned_left_join.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -11,7 +11,7 @@ template std::pair>, std::unique_ptr>> hash_join::partitioned_left_join(cudf::join_partition_context const& context, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const { return this->partitioned_join_retrieve(join_kind::LEFT_JOIN, context, stream, mr); @@ -20,7 +20,7 @@ hash_join::partitioned_left_join(cudf::join_partition_context const& con template std::pair>, std::unique_ptr>> hash_join::partitioned_left_join(cudf::join_partition_context const& context, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const; } // namespace cudf::detail diff --git a/cpp/src/join/hash_join/partitioned_retrieve.cu b/cpp/src/join/hash_join/partitioned_retrieve.cu index efb200f4c899..4780ce9b9250 100644 --- a/cpp/src/join/hash_join/partitioned_retrieve.cu +++ b/cpp/src/join/hash_join/partitioned_retrieve.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -15,7 +15,7 @@ launch_partitioned_retrieve(probe_key_type const*, size_type const*, primitive_count_ref_t, size_type, - rmm::cuda_stream_view, + cuda::stream_ref, rmm::device_async_resource_ref); template std::pair>, @@ -25,7 +25,7 @@ launch_partitioned_retrieve(probe_key_type const*, size_type const*, nested_count_ref_t, size_type, - rmm::cuda_stream_view, + cuda::stream_ref, rmm::device_async_resource_ref); template std::pair>, @@ -35,7 +35,7 @@ launch_partitioned_retrieve(probe_key_type const*, size_type const*, flat_count_ref_t, size_type, - rmm::cuda_stream_view, + cuda::stream_ref, rmm::device_async_resource_ref); } // namespace cudf::detail diff --git a/cpp/src/join/hash_join/partitioned_retrieve_kernels.cuh b/cpp/src/join/hash_join/partitioned_retrieve_kernels.cuh index f86e990bfe9a..72518018fb2f 100644 --- a/cpp/src/join/hash_join/partitioned_retrieve_kernels.cuh +++ b/cpp/src/join/hash_join/partitioned_retrieve_kernels.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -12,7 +12,6 @@ #include #include -#include #include #include @@ -21,6 +20,7 @@ #include #include #include +#include #include namespace cudf::detail { @@ -218,7 +218,7 @@ launch_partitioned_retrieve(probe_key_type const* keys, size_type const* match_counts, Ref ref, size_type left_offset, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { if (n == 0) { @@ -248,7 +248,7 @@ launch_partitioned_retrieve(probe_key_type const* keys, auto constexpr tiles_in_block = DEFAULT_JOIN_BLOCK_SIZE / Ref::cg_size; auto const num_blocks = static_cast((n + tiles_in_block - 1) / tiles_in_block); - partitioned_retrieve_kernel<<>>( + partitioned_retrieve_kernel<<>>( keys, n, left_offset, left_indices->data(), right_indices->data(), output_counter.data(), ref); CUDF_CUDA_TRY(cudaGetLastError()); diff --git a/cpp/src/join/hash_join/partitioned_retrieve_kernels.hpp b/cpp/src/join/hash_join/partitioned_retrieve_kernels.hpp index edd8816924ad..aa7f89fc066f 100644 --- a/cpp/src/join/hash_join/partitioned_retrieve_kernels.hpp +++ b/cpp/src/join/hash_join/partitioned_retrieve_kernels.hpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -9,9 +9,10 @@ #include -#include #include +#include + #include #include @@ -35,7 +36,7 @@ launch_partitioned_retrieve(probe_key_type const* keys, size_type const* match_counts, Ref ref, size_type left_offset, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); } // namespace cudf::detail diff --git a/cpp/src/join/hash_join/partitioned_retrieve_outer.cu b/cpp/src/join/hash_join/partitioned_retrieve_outer.cu index 68b8f591ada9..afb2acb16bca 100644 --- a/cpp/src/join/hash_join/partitioned_retrieve_outer.cu +++ b/cpp/src/join/hash_join/partitioned_retrieve_outer.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -15,7 +15,7 @@ launch_partitioned_retrieve(probe_key_type const*, size_type const*, primitive_count_ref_t, size_type, - rmm::cuda_stream_view, + cuda::stream_ref, rmm::device_async_resource_ref); template std::pair>, @@ -25,7 +25,7 @@ launch_partitioned_retrieve(probe_key_type const*, size_type const*, nested_count_ref_t, size_type, - rmm::cuda_stream_view, + cuda::stream_ref, rmm::device_async_resource_ref); template std::pair>, @@ -35,7 +35,7 @@ launch_partitioned_retrieve(probe_key_type const*, size_type const*, flat_count_ref_t, size_type, - rmm::cuda_stream_view, + cuda::stream_ref, rmm::device_async_resource_ref); } // namespace cudf::detail diff --git a/cpp/src/join/hash_join/retrieve_impl.cuh b/cpp/src/join/hash_join/retrieve_impl.cuh index 5efe69afe850..e19b8e8e0c40 100644 --- a/cpp/src/join/hash_join/retrieve_impl.cuh +++ b/cpp/src/join/hash_join/retrieve_impl.cuh @@ -37,7 +37,7 @@ probe_join_hash_table( bool has_nulls, null_equality compare_nulls, std::optional output_size, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { static_assert(Join == join_kind::INNER_JOIN || Join == join_kind::LEFT_JOIN || @@ -81,7 +81,7 @@ probe_join_hash_table( hash_table.hash_function(), out_probe_begin, out_build_begin, - stream.value()); + stream.get()); } else { [[maybe_unused]] auto out_probe_end = hash_table .retrieve_outer(iter, @@ -90,7 +90,7 @@ probe_join_hash_table( hash_table.hash_function(), out_probe_begin, out_build_begin, - stream.value()) + stream.get()) .first; if constexpr (Join == join_kind::FULL_JOIN) { @@ -122,7 +122,7 @@ void retrieve_left_join_build_indices( bool has_nulls, null_equality compare_nulls, RightOutputIterator out_build_begin, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { auto const left_table_num_rows = left_table.num_rows(); @@ -134,7 +134,7 @@ void retrieve_left_join_build_indices( hash_table.hash_function(), cuda::make_discard_iterator(), out_build_begin, - stream.value()); + stream.get()); }; dispatch_join_comparator(right_table, @@ -152,7 +152,7 @@ std::pair>, std::unique_ptr>> hash_join::join_retrieve(cudf::table_view const& left, std::optional output_size, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const { CUDF_FUNC_RANGE(); diff --git a/cpp/src/join/hash_join/size_impl.cuh b/cpp/src/join/hash_join/size_impl.cuh index 3e20ebc7367e..3b1c44672fcc 100644 --- a/cpp/src/join/hash_join/size_impl.cuh +++ b/cpp/src/join/hash_join/size_impl.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ #pragma once @@ -20,7 +20,7 @@ std::size_t get_full_join_size( cudf::detail::hash_table_t const& hash_table, bool has_nulls, null_equality compare_nulls, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); template @@ -32,7 +32,7 @@ std::size_t compute_join_output_size( cudf::detail::hash_table_t const& hash_table, bool has_nulls, cudf::null_equality nulls_equal, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { static_assert(Join == join_kind::INNER_JOIN || Join == join_kind::LEFT_JOIN); @@ -53,10 +53,10 @@ std::size_t compute_join_output_size( auto const iter = cudf::detail::make_counting_transform_iterator(0, pair_fn{d_hasher}); if constexpr (Join == join_kind::LEFT_JOIN) { return hash_table.count_outer( - iter, iter + left_table_num_rows, equality, hash_table.hash_function(), stream.value()); + iter, iter + left_table_num_rows, equality, hash_table.hash_function(), stream.get()); } else { return hash_table.count( - iter, iter + left_table_num_rows, equality, hash_table.hash_function(), stream.value()); + iter, iter + left_table_num_rows, equality, hash_table.hash_function(), stream.get()); } }); } @@ -64,7 +64,7 @@ std::size_t compute_join_output_size( template template std::size_t hash_join::join_size(cudf::table_view const& left, - rmm::cuda_stream_view stream) const + cuda::stream_ref stream) const { static_assert(Join == join_kind::INNER_JOIN || Join == join_kind::LEFT_JOIN); @@ -96,7 +96,7 @@ std::size_t hash_join::join_size(cudf::table_view const& left, template template std::size_t hash_join::join_size(cudf::table_view const& left, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const { static_assert(Join == join_kind::FULL_JOIN); diff --git a/cpp/src/join/join.cu b/cpp/src/join/join.cu index 9334125e05df..6b5191a6e0d0 100644 --- a/cpp/src/join/join.cu +++ b/cpp/src/join/join.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ #include "join_common_utils.hpp" @@ -15,10 +15,11 @@ #include #include -#include #include #include +#include + #include namespace cudf { @@ -29,7 +30,7 @@ std::pair>, inner_join(table_view const& left_input, table_view const& right_input, null_equality compare_nulls, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { // Make sure any dictionary columns have matched key sets. @@ -64,7 +65,7 @@ std::pair>, left_join(table_view const& left_input, table_view const& right_input, null_equality compare_nulls, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { // Make sure any dictionary columns have matched key sets. @@ -89,7 +90,7 @@ std::pair>, full_join(table_view const& left_input, table_view const& right_input, null_equality compare_nulls, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { // Make sure any dictionary columns have matched key sets. @@ -116,7 +117,7 @@ std::pair>, inner_join(table_view const& left, table_view const& right, null_equality compare_nulls, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); @@ -128,7 +129,7 @@ std::pair>, left_join(table_view const& left, table_view const& right, null_equality compare_nulls, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); @@ -140,7 +141,7 @@ std::pair>, full_join(table_view const& left, table_view const& right, null_equality compare_nulls, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); diff --git a/cpp/src/join/join_common_utils.cuh b/cpp/src/join/join_common_utils.cuh index 2caa26616d30..9f78f17e3553 100644 --- a/cpp/src/join/join_common_utils.cuh +++ b/cpp/src/join/join_common_utils.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ #pragma once @@ -12,7 +12,7 @@ #include #include -#include +#include #include diff --git a/cpp/src/join/join_common_utils.hpp b/cpp/src/join/join_common_utils.hpp index a5bf0ce6785c..c1069dff7062 100644 --- a/cpp/src/join/join_common_utils.hpp +++ b/cpp/src/join/join_common_utils.hpp @@ -9,10 +9,11 @@ #include #include -#include #include #include +#include + #include #include @@ -48,7 +49,7 @@ using VectorPair = std::pair>, * @return Join output indices vector pair */ VectorPair get_trivial_left_join_indices(table_view const& left, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -73,7 +74,7 @@ VectorPair get_trivial_left_join_indices(table_view const& left, VectorPair finalize_full_join(VectorPair&& indices, size_type left_table_num_rows, size_type right_table_num_rows, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); /** @@ -100,7 +101,7 @@ VectorPair finalize_full_join( cudf::host_span const> right_partials, size_type left_table_num_rows, size_type right_table_num_rows, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); } // namespace cudf::detail diff --git a/cpp/src/join/join_utils.cu b/cpp/src/join/join_utils.cu index 790fc9629a15..8c47f3659b48 100644 --- a/cpp/src/join/join_utils.cu +++ b/cpp/src/join/join_utils.cu @@ -14,7 +14,6 @@ #include #include -#include #include #include #include @@ -23,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -43,7 +43,7 @@ double checked_load_factor(double load_factor) } VectorPair get_trivial_left_join_indices(table_view const& left, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { auto left_indices = std::make_unique>(left.num_rows(), stream, mr); @@ -86,7 +86,7 @@ struct to_no_match_pair { VectorPair finalize_full_join(VectorPair&& indices, size_type left_table_num_rows, size_type right_table_num_rows, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { auto [left_out, right_out] = std::move(indices); @@ -161,7 +161,7 @@ VectorPair finalize_full_join( cudf::host_span const> right_partials, size_type left_table_num_rows, size_type right_table_num_rows, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { CUDF_EXPECTS(left_partials.size() == right_partials.size(), diff --git a/cpp/src/join/key_remapping.cu b/cpp/src/join/key_remapping.cu index ef8540c261f4..f07fe8344242 100644 --- a/cpp/src/join/key_remapping.cu +++ b/cpp/src/join/key_remapping.cu @@ -23,7 +23,6 @@ #include #include -#include #include #include #include @@ -33,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -240,7 +240,7 @@ class key_remap_table_interface { virtual std::unique_ptr> probe( cudf::table_view const& left_keys, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const = 0; virtual bool has_metrics() const = 0; @@ -279,7 +279,7 @@ class key_remap_table : public key_remap_table_interface { RowHasher const& row_hasher, cudf::null_equality compare_nulls, bool compute_metrics, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, cuda::mr::any_resource mr) : _right_has_nested_columns{cudf::has_nested_columns(right)}, _compare_nulls{compare_nulls}, @@ -294,7 +294,7 @@ class key_remap_table : public key_remap_table_interface { cuco::thread_scope_device, cuco_storage_type{}, rmm::mr::polymorphic_allocator{std::move(mr)}, - stream.value()}, + stream.get()}, _has_metrics{compute_metrics}, _distinct_count{0}, _max_duplicate_count{0} @@ -337,7 +337,7 @@ class key_remap_table : public key_remap_table_interface { void compute_metrics_atomic(cudf::size_type right_num_rows, KeyIter key_iter, cudf::bitmask_type const* bitmask_ptr, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { rmm::device_uvector counts(right_num_rows, stream); thrust::fill(rmm::exec_policy_nosync(stream, cudf::get_current_device_resource_ref()), @@ -352,7 +352,7 @@ class key_remap_table : public key_remap_table_interface { cudf::detail::grid_1d grid{right_num_rows, KEY_REMAP_BLOCK_SIZE}; - insert_and_count_kernel<<>>( + insert_and_count_kernel<<>>( right_num_rows, set_ref, key_iter, counts.data(), d_distinct_count.data(), bitmask_ptr); CUDF_CUDA_TRY(cudaGetLastError()); @@ -369,7 +369,7 @@ class key_remap_table : public key_remap_table_interface { public: std::unique_ptr> probe( cudf::table_view const& left_keys, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const override { CUDF_FUNC_RANGE(); @@ -450,14 +450,14 @@ class key_remap_table : public key_remap_table_interface { EqualType const& d_equal, cudf::table_view const& left_keys, FoundIterator found_begin, - rmm::cuda_stream_view stream) const + cuda::stream_ref stream) const { CUDF_FUNC_RANGE(); auto const left_num_rows = left_keys.num_rows(); if (_compare_nulls == cudf::null_equality::EQUAL or (not cudf::nullable(left_keys))) { _hash_table.find_async( - iter, iter + left_num_rows, d_equal, key_hasher{}, found_begin, stream.value()); + iter, iter + left_num_rows, d_equal, key_hasher{}, found_begin, stream.get()); } else { auto stencil = cuda::counting_iterator{0}; auto const row_bitmask = @@ -472,7 +472,7 @@ class key_remap_table : public key_remap_table_interface { d_equal, key_hasher{}, found_begin, - stream.value()); + stream.get()); } } @@ -493,7 +493,7 @@ std::unique_ptr create_key_remap_table( cudf::table_view const& right, cudf::null_equality compare_nulls, bool compute_metrics, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, cuda::mr::any_resource mr) { CUDF_FUNC_RANGE(); @@ -565,7 +565,7 @@ class key_remapping_impl { key_remapping_impl(cudf::table_view const& right, cudf::null_equality compare_nulls, bool compute_metrics, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, cuda::mr::any_resource mr) : _right{right}, _compare_nulls{compare_nulls}, @@ -575,9 +575,7 @@ class key_remapping_impl { } std::unique_ptr> probe( - cudf::table_view const& keys, - rmm::cuda_stream_view stream, - rmm::device_async_resource_ref mr) const + cudf::table_view const& keys, cuda::stream_ref stream, rmm::device_async_resource_ref mr) const { CUDF_EXPECTS(keys.num_columns() == _right.num_columns(), "Mismatch in number of columns to be joined on", @@ -637,7 +635,7 @@ class key_remapping_impl { key_remapping::key_remapping(cudf::table_view const& right, null_equality compare_nulls, cudf::compute_metrics metrics, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, cuda::mr::any_resource mr) : _impl{std::make_unique( right, compare_nulls, static_cast(metrics), stream, std::move(mr))} @@ -651,7 +649,7 @@ namespace { std::unique_ptr remap_keys_internal(detail::key_remapping_impl const& impl, cudf::table_view const& keys, cudf::size_type not_found_sentinel, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { auto indices = impl.probe(keys, stream, mr); @@ -671,7 +669,7 @@ std::unique_ptr remap_keys_internal(detail::key_remapping_impl con } // namespace std::unique_ptr key_remapping::remap_right_keys( - rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr) const + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const { CUDF_FUNC_RANGE(); // Use the cached right table from the implementation @@ -679,9 +677,7 @@ std::unique_ptr key_remapping::remap_right_keys( } std::unique_ptr key_remapping::remap_left_keys( - cudf::table_view const& keys, - rmm::cuda_stream_view stream, - rmm::device_async_resource_ref mr) const + cudf::table_view const& keys, cuda::stream_ref stream, rmm::device_async_resource_ref mr) const { CUDF_FUNC_RANGE(); return remap_keys_internal(*_impl, keys, KEY_REMAP_NOT_FOUND, stream, mr); diff --git a/cpp/src/join/mark_join.cu b/cpp/src/join/mark_join.cu index c050170e3853..09d92710763c 100644 --- a/cpp/src/join/mark_join.cu +++ b/cpp/src/join/mark_join.cu @@ -39,7 +39,7 @@ namespace detail { namespace { std::pair build_row_bitmask(table_view const& input, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { auto const nullable_columns = get_nullable_columns(input); CUDF_EXPECTS(nullable_columns.size() > 0, @@ -382,14 +382,14 @@ static std::size_t compute_mark_join_capacity(cudf::table_view tbl, double load_ } // namespace -void mark_join::clear_marks(rmm::cuda_stream_view stream) +void mark_join::clear_marks(cuda::stream_ref stream) { auto const storage_ref = _bucket_storage.ref(); auto const num_buckets = static_cast(storage_ref.num_buckets()); if (num_buckets == 0) return; auto const grid_size = cudf::util::div_rounding_up_unsafe(num_buckets, mark_block_size); - clear_marks_kernel<<>>( + clear_marks_kernel<<>>( storage_ref, static_cast(masked_empty_sentinel), num_buckets); CUDF_CUDA_TRY(cudaGetLastError()); } @@ -400,7 +400,7 @@ cudf::size_type mark_join::mark_probe_without_prefilter(storage_ref_type storage right_key_type const* right_rows, cudf::size_type num_right_rows, bitmask_type const* right_row_bitmask, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { cudf::detail::device_scalar d_mark_counter( 0, stream, cudf::get_current_device_resource_ref()); @@ -413,7 +413,7 @@ cudf::size_type mark_join::mark_probe_without_prefilter(storage_ref_type storage CUDF_CUDA_TRY(cudaDeviceGetAttribute(&num_sms, cudaDevAttrMultiProcessorCount, 0)); grid_size *= num_sms; - mark_probe_kernel<<>>( + mark_probe_kernel<<>>( storage_ref, masked_probing_scheme{}, comparator, @@ -434,7 +434,7 @@ cudf::size_type mark_join::mark_probe_with_prefilter(storage_ref_type storage_re right_key_type const* right_rows, cudf::size_type num_right_rows, bitmask_type const* right_row_bitmask, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { CUDF_EXPECTS(_bloom_filter != nullptr, "Prefilter-enabled mark_join is missing bloom filter."); @@ -459,7 +459,7 @@ cudf::size_type mark_join::mark_probe_with_prefilter(storage_ref_type storage_re filter_grid_size *= num_sms; compact_if_kernel - <<>>( + <<>>( filtered_right_rows.data(), d_filtered_count.data(), prefilter_op); CUDF_CUDA_TRY(cudaGetLastError()); @@ -474,7 +474,7 @@ std::unique_ptr> mark_join::mark_probe_and_ std::shared_ptr preprocessed_right, join_kind kind, Comparator comparator, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); @@ -486,7 +486,7 @@ std::unique_ptr> mark_join::mark_probe_and_ right_rows.begin(), right.num_rows(), cuda::proclaim_return_type(key_fn), - stream.value()); + stream.get()); return right_rows; }; @@ -554,22 +554,20 @@ std::unique_ptr> mark_join::mark_probe_and_ grid_size *= num_sms; if (kind == join_kind::LEFT_SEMI_JOIN) { - mark_retrieve_kernel - <<>>( - storage_ref, - static_cast(masked_empty_sentinel), - result.data(), - d_scan_offset.data(), - num_buckets); + mark_retrieve_kernel<<>>( + storage_ref, + static_cast(masked_empty_sentinel), + result.data(), + d_scan_offset.data(), + num_buckets); CUDF_CUDA_TRY(cudaGetLastError()); } else { - mark_retrieve_kernel - <<>>( - storage_ref, - static_cast(masked_empty_sentinel), - result.data(), - d_scan_offset.data(), - num_buckets); + mark_retrieve_kernel<<>>( + storage_ref, + static_cast(masked_empty_sentinel), + result.data(), + d_scan_offset.data(), + num_buckets); CUDF_CUDA_TRY(cudaGetLastError()); } } @@ -591,7 +589,7 @@ mark_join::mark_join(cudf::table_view const& left, cudf::null_equality compare_nulls, double load_factor, cudf::join_prefilter prefilter, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, cuda::mr::any_resource mr) : _has_nested_columns{cudf::has_nested_columns(left)}, _left{left}, @@ -601,7 +599,7 @@ mark_join::mark_join(cudf::table_view const& left, _bucket_storage{ cuco::extent{compute_mark_join_capacity(left, checked_load_factor(load_factor))}, rmm::mr::polymorphic_allocator{mr}, - stream.value()} + stream.get()} { cudf::scoped_range range{"mark_join::mark_join"}; if (_left.num_rows() == 0) return; @@ -612,7 +610,7 @@ mark_join::mark_join(cudf::table_view const& left, cuco::cuda_thread_scope{}, bloom_filter_policy_type{}, bloom_filter_allocator_type{std::move(mr)}, - stream.value()); + stream.get()); } // Any mismatch in nullate between right and left row operators results in UB. Ideally, nullate @@ -639,9 +637,9 @@ mark_join::mark_join(cudf::table_view const& left, hashes.end(), cuda::counting_iterator{size_type{0}}, row_is_valid{row_bitmask_ptr}, - stream.value()); + stream.get()); } else { - _bloom_filter->add_async(hashes.begin(), hashes.end(), stream.value()); + _bloom_filter->add_async(hashes.begin(), hashes.end(), stream.get()); } }; @@ -651,7 +649,7 @@ mark_join::mark_join(cudf::table_view const& left, if (has_null_left_keys) { cuco::detail::open_addressing_ns::insert_if_n - <<>>( + <<>>( left_iter, _left.num_rows(), cuda::counting_iterator{0}, @@ -661,7 +659,7 @@ mark_join::mark_join(cudf::table_view const& left, } else { cuco::detail::open_addressing_ns::insert_if_n - <<>>( + <<>>( left_iter, _left.num_rows(), cuda::constant_iterator{true}, @@ -679,7 +677,7 @@ mark_join::mark_join(cudf::table_view const& left, left_hashes.begin(), _left.num_rows(), cuda::proclaim_return_type(masked_hash_value_fn{d_left_hasher}), - stream.value()); + stream.get()); auto const left_iter = cudf::detail::make_counting_transform_iterator( size_type{0}, hash_pair_fn{left_hashes.data()}); cuco::static_multiset_ref set_ref{masked_empty_sentinel, @@ -737,7 +735,7 @@ mark_join::mark_join(cudf::table_view const& left, std::unique_ptr> mark_join::semi_anti_join( cudf::table_view const& right, join_kind kind, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { clear_marks(stream); @@ -784,7 +782,7 @@ std::unique_ptr> mark_join::semi_anti_join( } std::unique_ptr> mark_join::semi_join( - cudf::table_view const& right, rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr) + cudf::table_view const& right, cuda::stream_ref stream, rmm::device_async_resource_ref mr) { if (_left.num_rows() == 0 || right.num_rows() == 0) { return std::make_unique>(0, stream, mr); @@ -793,7 +791,7 @@ std::unique_ptr> mark_join::semi_join( } std::unique_ptr> mark_join::anti_join( - cudf::table_view const& right, rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr) + cudf::table_view const& right, cuda::stream_ref stream, rmm::device_async_resource_ref mr) { if (_left.num_rows() == 0) { return std::make_unique>(0, stream, mr); @@ -818,7 +816,7 @@ mark_join::~mark_join() = default; mark_join::mark_join(cudf::table_view const& left, cudf::null_equality compare_nulls, cudf::join_prefilter prefilter, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, cuda::mr::any_resource mr) : _impl{std::make_unique( left, compare_nulls, detail::CUCO_DESIRED_LOAD_FACTOR, prefilter, stream, std::move(mr))} @@ -829,7 +827,7 @@ mark_join::mark_join(cudf::table_view const& left, double load_factor, cudf::null_equality compare_nulls, cudf::join_prefilter prefilter, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, cuda::mr::any_resource mr) : _impl{std::make_unique( left, compare_nulls, load_factor, prefilter, stream, std::move(mr))} @@ -837,18 +835,14 @@ mark_join::mark_join(cudf::table_view const& left, } std::unique_ptr> mark_join::semi_join( - cudf::table_view const& right, - rmm::cuda_stream_view stream, - rmm::device_async_resource_ref mr) const + cudf::table_view const& right, cuda::stream_ref stream, rmm::device_async_resource_ref mr) const { cudf::scoped_range range{"mark_join::semi_join"}; return _impl->semi_join(right, stream, mr); } std::unique_ptr> mark_join::anti_join( - cudf::table_view const& right, - rmm::cuda_stream_view stream, - rmm::device_async_resource_ref mr) const + cudf::table_view const& right, cuda::stream_ref stream, rmm::device_async_resource_ref mr) const { cudf::scoped_range range{"mark_join::anti_join"}; return _impl->anti_join(right, stream, mr); diff --git a/cpp/src/join/mark_join.cuh b/cpp/src/join/mark_join.cuh index 2b0d4db7a052..6a3179f3b493 100644 --- a/cpp/src/join/mark_join.cuh +++ b/cpp/src/join/mark_join.cuh @@ -14,7 +14,6 @@ #include #include -#include #include #include @@ -26,6 +25,7 @@ #include #include #include +#include #include @@ -183,14 +183,14 @@ class mark_join { cudf::null_equality compare_nulls, double load_factor, cudf::join_prefilter prefilter, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, cuda::mr::any_resource mr); std::unique_ptr> semi_join( - cudf::table_view const& right, rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr); + cudf::table_view const& right, cuda::stream_ref stream, rmm::device_async_resource_ref mr); std::unique_ptr> anti_join( - cudf::table_view const& right, rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr); + cudf::table_view const& right, cuda::stream_ref stream, rmm::device_async_resource_ref mr); private: using primitive_row_hasher = @@ -212,7 +212,7 @@ class mark_join { std::unique_ptr> semi_anti_join( cudf::table_view const& right, join_kind kind, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); template @@ -221,7 +221,7 @@ class mark_join { right_key_type const* right_rows, cudf::size_type num_right_rows, bitmask_type const* right_row_bitmask, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); template cudf::size_type mark_probe_with_prefilter(storage_ref_type storage_ref, @@ -229,7 +229,7 @@ class mark_join { right_key_type const* right_rows, cudf::size_type num_right_rows, bitmask_type const* right_row_bitmask, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); template @@ -238,10 +238,10 @@ class mark_join { std::shared_ptr preprocessed_right, join_kind kind, Comparator comparator, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); - void clear_marks(rmm::cuda_stream_view stream); + void clear_marks(cuda::stream_ref stream); }; } // namespace cudf::detail diff --git a/cpp/src/join/mixed_join.cu b/cpp/src/join/mixed_join.cu index baeb35670a36..62eaf975d821 100644 --- a/cpp/src/join/mixed_join.cu +++ b/cpp/src/join/mixed_join.cu @@ -17,10 +17,10 @@ #include #include -#include #include #include +#include #include #include @@ -43,7 +43,7 @@ std::pair>, equality_join_indices(cudf::hash_join const& hash_joiner, table_view const& left_equality, join_kind join_type, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { switch (join_type) { @@ -66,7 +66,7 @@ mixed_join(table_view const& left_equality, null_equality compare_nulls, join_kind join_type, output_size_data_type const& output_size_data, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { CUDF_EXPECTS((join_type != join_kind::LEFT_SEMI_JOIN) && (join_type != join_kind::LEFT_ANTI_JOIN), @@ -133,7 +133,7 @@ compute_mixed_join_output_size(table_view const& left_equality, ast::expression const& binary_predicate, null_equality compare_nulls, join_kind join_type, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { CUDF_EXPECTS(join_type != join_kind::FULL_JOIN, @@ -189,7 +189,7 @@ mixed_inner_join( ast::expression const& binary_predicate, null_equality compare_nulls, std::optional>> const output_size_data, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); @@ -212,7 +212,7 @@ std::pair>> mixed_in table_view const& right_conditional, ast::expression const& binary_predicate, null_equality compare_nulls, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); @@ -236,7 +236,7 @@ mixed_left_join(table_view const& left_equality, ast::expression const& binary_predicate, null_equality compare_nulls, output_size_data_type const output_size_data, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); @@ -259,7 +259,7 @@ std::pair>> mixed_le table_view const& right_conditional, ast::expression const& binary_predicate, null_equality compare_nulls, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); @@ -283,7 +283,7 @@ mixed_full_join(table_view const& left_equality, ast::expression const& binary_predicate, null_equality compare_nulls, output_size_data_type const output_size_data, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); diff --git a/cpp/src/join/mixed_join_kernels_semi.cu b/cpp/src/join/mixed_join_kernels_semi.cu index 0302c25c679e..4aebdc034b48 100644 --- a/cpp/src/join/mixed_join_kernels_semi.cu +++ b/cpp/src/join/mixed_join_kernels_semi.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -73,11 +73,11 @@ void launch_mixed_join_semi(bool has_nulls, cudf::ast::detail::expression_device_view device_expression_data, detail::grid_1d const config, int64_t shmem_size_per_block, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { if (has_nulls) { mixed_join_semi - <<>>( + <<>>( left_table, right_table, probe, @@ -89,7 +89,7 @@ void launch_mixed_join_semi(bool has_nulls, CUDF_CUDA_TRY(cudaGetLastError()); } else { mixed_join_semi - <<>>( + <<>>( left_table, right_table, probe, diff --git a/cpp/src/join/mixed_join_kernels_semi.cuh b/cpp/src/join/mixed_join_kernels_semi.cuh index 87885ce89e20..293552e18324 100644 --- a/cpp/src/join/mixed_join_kernels_semi.cuh +++ b/cpp/src/join/mixed_join_kernels_semi.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -13,7 +13,7 @@ #include #include -#include +#include namespace cudf { namespace detail { @@ -57,7 +57,7 @@ void launch_mixed_join_semi(bool has_nulls, cudf::ast::detail::expression_device_view device_expression_data, detail::grid_1d const config, int64_t shmem_size_per_block, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); } // namespace detail diff --git a/cpp/src/join/mixed_join_semi.cu b/cpp/src/join/mixed_join_semi.cu index 8021cdab21bc..52eb1f6b871d 100644 --- a/cpp/src/join/mixed_join_semi.cu +++ b/cpp/src/join/mixed_join_semi.cu @@ -22,12 +22,12 @@ #include #include -#include #include #include #include #include +#include #include #include @@ -43,7 +43,7 @@ std::unique_ptr> mixed_join_semi( ast::expression const& binary_predicate, null_equality compare_nulls, join_kind join_type, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { CUDF_EXPECTS((join_type != join_kind::INNER_JOIN) and (join_type != join_kind::LEFT_JOIN) and @@ -148,13 +148,13 @@ std::unique_ptr> mixed_join_semi( {}, {}, rmm::mr::polymorphic_allocator{}, - {stream.value()}}; + {stream.get()}}; auto iter = cuda::counting_iterator{0}; // skip rows that are null here. if ((compare_nulls == null_equality::EQUAL) or (not nullable(right))) { - row_set.insert_async(iter, iter + right_num_rows, stream.value()); + row_set.insert_async(iter, iter + right_num_rows, stream.get()); } else { cuda::counting_iterator stencil(0); auto const [row_bitmask, _] = @@ -162,7 +162,7 @@ std::unique_ptr> mixed_join_semi( row_is_valid pred{static_cast(row_bitmask.data())}; // insert valid rows - row_set.insert_if_async(iter, iter + right_num_rows, stencil, pred, stream.value()); + row_set.insert_if_async(iter, iter + right_num_rows, stencil, pred, stream.get()); } detail::grid_1d const config(outer_num_rows * hash_set_type::cg_size, DEFAULT_JOIN_BLOCK_SIZE); @@ -217,7 +217,7 @@ std::unique_ptr> mixed_left_semi_join( table_view const& right_conditional, ast::expression const& binary_predicate, null_equality compare_nulls, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); @@ -239,7 +239,7 @@ std::unique_ptr> mixed_left_anti_join( table_view const& right_conditional, ast::expression const& binary_predicate, null_equality compare_nulls, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); diff --git a/cpp/src/join/sort_merge_join.cu b/cpp/src/join/sort_merge_join.cu index b4983d0becb2..f8018e67e9ee 100644 --- a/cpp/src/join/sort_merge_join.cu +++ b/cpp/src/join/sort_merge_join.cu @@ -26,7 +26,6 @@ #include #include -#include #include #include @@ -54,11 +53,11 @@ namespace cudf { namespace { -auto make_cub_env(rmm::cuda_stream_view stream) +auto make_cub_env(cuda::stream_ref stream) { auto mr_prop = cuda::std::execution::prop{cuda::mr::get_memory_resource, cudf::get_current_device_resource_ref()}; - auto env = cuda::std::execution::env{cuda::stream_ref{stream.value()}, mr_prop}; + auto env = cuda::std::execution::env{cuda::stream_ref{stream.get()}, mr_prop}; return env; } @@ -154,7 +153,7 @@ template right_run_index build_right_run_index(SortedOrderIterator sorted_order, size_type num_rows, Less less, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { auto temp_mr = cudf::get_current_device_resource_ref(); auto env = make_cub_env(stream); @@ -199,7 +198,7 @@ right_run_index build_right_run_index(SortedOrderIterator sorted_order, template right_run_index build_right_run_index(table_view const& table, SortedOrderIterator sorted_order, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { auto const has_nulls = has_nested_nulls(table); std::vector column_order(table.num_columns(), cudf::order::ASCENDING); @@ -318,7 +317,7 @@ void batched_copy(InputIts input_iterators, OutputIts output_iterators, SizeIt sizes, size_type num_ranges, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { CUDF_CUDA_TRY(cub::DeviceCopy::Batched( input_iterators, output_iterators, sizes, num_ranges, make_cub_env(stream))); @@ -348,7 +347,7 @@ class merge { device_span unique_smaller_rows, device_span smaller_run_offsets, table_view const& larger, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) : smaller{smaller}, larger{larger}, sorted_smaller_order_begin{sorted_smaller_order_begin}, @@ -362,26 +361,24 @@ class merge { } std::unique_ptr> matches_per_row( - rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr); + cuda::stream_ref stream, rmm::device_async_resource_ref mr); match_ranges find_match_ranges(compute_match_starts compute_starts, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr); std::pair>, std::unique_ptr>> - inner(rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr); + inner(cuda::stream_ref stream, rmm::device_async_resource_ref mr); std::pair>, std::unique_ptr>> - left(rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr); + left(cuda::stream_ref stream, rmm::device_async_resource_ref mr); }; template typename merge::match_ranges merge::find_match_ranges( - compute_match_starts compute_starts, - rmm::cuda_stream_view stream, - rmm::device_async_resource_ref mr) + compute_match_starts compute_starts, cuda::stream_ref stream, rmm::device_async_resource_ref mr) { auto const has_nulls = has_nested_nulls(smaller) or has_nested_nulls(larger); auto const larger_numrows = larger.num_rows(); @@ -431,7 +428,7 @@ typename merge::match_ranges merge::find_match template std::unique_ptr> merge::matches_per_row( - rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr) + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { return find_match_ranges(compute_match_starts::NO, stream, mr).counts; } @@ -439,7 +436,7 @@ std::unique_ptr> merge::matches_ template std::pair>, std::unique_ptr>> -merge::inner(rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr) +merge::inner(cuda::stream_ref stream, rmm::device_async_resource_ref mr) { auto temp_mr = cudf::get_current_device_resource_ref(); auto const larger_numrows = larger.num_rows(); @@ -492,7 +489,7 @@ merge::inner(rmm::cuda_stream_view stream, rmm::device_async_re template std::pair>, std::unique_ptr>> -merge::left(rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr) +merge::left(cuda::stream_ref stream, rmm::device_async_resource_ref mr) { auto temp_mr = cudf::get_current_device_resource_ref(); auto const larger_numrows = larger.num_rows(); @@ -537,7 +534,7 @@ merge::left(rmm::cuda_stream_view stream, rmm::device_async_res namespace detail { -void sort_merge_join::preprocessed_table::populate_nonnull_filter(rmm::cuda_stream_view stream) +void sort_merge_join::preprocessed_table::populate_nonnull_filter(cuda::stream_ref stream) { auto table = this->_table_view; auto temp_mr = cudf::get_current_device_resource_ref(); @@ -640,7 +637,7 @@ void sort_merge_join::preprocessed_table::populate_nonnull_filter(rmm::cuda_stre this->_validity_mask = std::move(validity_mask); } -void sort_merge_join::preprocessed_table::apply_nonnull_filter(rmm::cuda_stream_view stream) +void sort_merge_join::preprocessed_table::apply_nonnull_filter(cuda::stream_ref stream) { auto temp_mr = cudf::get_current_device_resource_ref(); // construct bool column to apply mask @@ -655,13 +652,13 @@ void sort_merge_join::preprocessed_table::apply_nonnull_filter(rmm::cuda_stream_ _null_processed_table_view = _null_processed_table.value()->view(); } -void sort_merge_join::preprocessed_table::preprocess_unprocessed_table(rmm::cuda_stream_view stream) +void sort_merge_join::preprocessed_table::preprocess_unprocessed_table(cuda::stream_ref stream) { populate_nonnull_filter(stream); apply_nonnull_filter(stream); } -void sort_merge_join::preprocessed_table::compute_sorted_order(rmm::cuda_stream_view stream) +void sort_merge_join::preprocessed_table::compute_sorted_order(cuda::stream_ref stream) { auto temp_mr = cudf::get_current_device_resource_ref(); std::vector column_order(_null_processed_table_view.num_columns(), @@ -673,10 +670,7 @@ void sort_merge_join::preprocessed_table::compute_sorted_order(rmm::cuda_stream_ } sort_merge_join::preprocessed_table sort_merge_join::preprocessed_table::create( - table_view const& table, - null_equality compare_nulls, - sorted is_sorted, - rmm::cuda_stream_view stream) + table_view const& table, null_equality compare_nulls, sorted is_sorted, cuda::stream_ref stream) { preprocessed_table result; result._table_view = table; @@ -700,7 +694,7 @@ sort_merge_join::preprocessed_table sort_merge_join::preprocessed_table::create( sort_merge_join::sort_merge_join(table_view const& right, sorted is_right_sorted, null_equality compare_nulls, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) : preprocessed_right{preprocessed_table::create(right, compare_nulls, is_right_sorted, stream)}, compare_nulls{compare_nulls} { @@ -724,7 +718,7 @@ sort_merge_join::sort_merge_join(table_view const& right, } rmm::device_uvector sort_merge_join::preprocessed_table::map_table_to_unprocessed( - rmm::cuda_stream_view stream) const + cuda::stream_ref stream) const { CUDF_EXPECTS(_validity_mask.has_value() && _num_nulls.has_value(), "Mapping is not possible"); auto temp_mr = cudf::get_current_device_resource_ref(); @@ -743,7 +737,7 @@ rmm::device_uvector sort_merge_join::preprocessed_table::map_table_to void sort_merge_join::postprocess_indices(preprocessed_table const& preprocessed_left, device_span smaller_indices, device_span larger_indices, - rmm::cuda_stream_view stream) const + cuda::stream_ref stream) const { if (compare_nulls == null_equality::UNEQUAL) { auto env = make_cub_env(stream); @@ -775,7 +769,7 @@ template auto sort_merge_join::invoke_merge(table_view right_view, table_view left_view, MergeOperation&& op, - rmm::cuda_stream_view stream) const + cuda::stream_ref stream) const { auto const unique_right_rows = device_span{right_run_rows->data(), static_cast(num_right_runs)}; @@ -800,7 +794,7 @@ auto sort_merge_join::invoke_merge(table_view right_view, std::pair>, std::unique_ptr>> sort_merge_join::inner_join(table_view const& left, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const { cudf::scoped_range range{"sort_merge_join::inner_join"}; @@ -831,7 +825,7 @@ sort_merge_join::inner_join(table_view const& left, std::pair>, std::unique_ptr>> sort_merge_join::left_join(table_view const& left, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const { cudf::scoped_range range{"sort_merge_join::left_join"}; @@ -906,7 +900,7 @@ sort_merge_join::left_join(table_view const& left, } std::unique_ptr sort_merge_join::inner_join_match_context( - table_view const& left, rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr) const + table_view const& left, cuda::stream_ref stream, rmm::device_async_resource_ref mr) const { cudf::scoped_range range{"sort_merge_join::inner_join_match_context"}; // Sanity checks @@ -955,7 +949,7 @@ std::unique_ptr sort_merge_join::inner_join_match_cont std::pair>, std::unique_ptr>> sort_merge_join::partitioned_inner_join(cudf::join_partition_context const& context, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const { cudf::scoped_range range{"sort_merge_join::partitioned_inner_join"}; @@ -1017,7 +1011,7 @@ sort_merge_join::~sort_merge_join() = default; sort_merge_join::sort_merge_join(table_view const& right, sorted is_right_sorted, null_equality compare_nulls, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) : _impl{std::make_unique(right, is_right_sorted, compare_nulls, stream)} { } @@ -1025,7 +1019,7 @@ sort_merge_join::sort_merge_join(table_view const& right, std::pair>, std::unique_ptr>> sort_merge_join::inner_join(table_view const& left, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const { return _impl->inner_join(left, stream, mr); @@ -1035,7 +1029,7 @@ std::pair>, std::unique_ptr>> sort_merge_join::inner_join(table_view const& left, sorted is_left_sorted, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const { static_cast(is_left_sorted); @@ -1045,7 +1039,7 @@ sort_merge_join::inner_join(table_view const& left, std::pair>, std::unique_ptr>> sort_merge_join::left_join(table_view const& left, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const { return _impl->left_join(left, stream, mr); @@ -1055,7 +1049,7 @@ std::pair>, std::unique_ptr>> sort_merge_join::left_join(table_view const& left, sorted is_left_sorted, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const { static_cast(is_left_sorted); @@ -1063,7 +1057,7 @@ sort_merge_join::left_join(table_view const& left, } std::unique_ptr sort_merge_join::inner_join_match_context( - table_view const& left, rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr) const + table_view const& left, cuda::stream_ref stream, rmm::device_async_resource_ref mr) const { return _impl->inner_join_match_context(left, stream, mr); } @@ -1071,7 +1065,7 @@ std::unique_ptr sort_merge_join::inner_join_match_context( std::unique_ptr sort_merge_join::inner_join_match_context( table_view const& left, sorted is_left_sorted, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const { static_cast(is_left_sorted); @@ -1081,7 +1075,7 @@ std::unique_ptr sort_merge_join::inner_join_match_context( std::pair>, std::unique_ptr>> sort_merge_join::partitioned_inner_join(cudf::join_partition_context const& context, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const { return _impl->partitioned_inner_join(context, stream, mr); diff --git a/cpp/src/join/sort_merge_join.hpp b/cpp/src/join/sort_merge_join.hpp index 214d384ab871..71b8daef8e74 100644 --- a/cpp/src/join/sort_merge_join.hpp +++ b/cpp/src/join/sort_merge_join.hpp @@ -13,10 +13,11 @@ #include #include -#include #include #include +#include + #include #include @@ -52,7 +53,7 @@ class sort_merge_join { sort_merge_join(table_view const& right, sorted is_right_sorted, null_equality compare_nulls, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); /** * @brief Returns the row indices for an inner join. @@ -65,7 +66,7 @@ class sort_merge_join { std::pair>, std::unique_ptr>> inner_join(table_view const& left, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const; /** @@ -79,7 +80,7 @@ class sort_merge_join { std::pair>, std::unique_ptr>> left_join(table_view const& left, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const; /** @@ -91,7 +92,7 @@ class sort_merge_join { * @return A unique_ptr to join_match_context */ std::unique_ptr inner_join_match_context( - table_view const& left, rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr) const; + table_view const& left, cuda::stream_ref stream, rmm::device_async_resource_ref mr) const; /** * @brief Performs an inner join between a partition of the left table and the right table. @@ -104,7 +105,7 @@ class sort_merge_join { std::pair>, std::unique_ptr>> partitioned_inner_join(cudf::join_partition_context const& context, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) const; private: @@ -141,7 +142,7 @@ class sort_merge_join { static preprocessed_table create(table_view const& table, null_equality compare_nulls, sorted is_sorted, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); /** * @brief Mark rows in unprocessed table with nulls at root or child levels by populating the @@ -149,28 +150,28 @@ class sort_merge_join { * * @param stream CUDA stream used for device memory operations and kernel launches */ - void populate_nonnull_filter(rmm::cuda_stream_view stream); + void populate_nonnull_filter(cuda::stream_ref stream); /** * @brief Apply _validity_mask to the _table_view to create a null-free table * * @param stream CUDA stream used for device memory operations and kernel launches */ - void apply_nonnull_filter(rmm::cuda_stream_view stream); + void apply_nonnull_filter(cuda::stream_ref stream); /** * @brief Pre-process the unprocessed table when null equality is set to unequal * * @param stream CUDA stream used for device memory operations and kernel launches */ - void preprocess_unprocessed_table(rmm::cuda_stream_view stream); + void preprocess_unprocessed_table(cuda::stream_ref stream); /** * @brief Compute sorted ordering of the processed table * * @param stream CUDA stream used for device memory operations and kernel launches */ - void compute_sorted_order(rmm::cuda_stream_view stream); + void compute_sorted_order(cuda::stream_ref stream); /** * @brief Create mapping from processed table indices to unprocessed table indices @@ -179,7 +180,7 @@ class sort_merge_join { * @return A device vector containing the mapping from processed table indices to unprocessed * table indices */ - rmm::device_uvector map_table_to_unprocessed(rmm::cuda_stream_view stream) const; + rmm::device_uvector map_table_to_unprocessed(cuda::stream_ref stream) const; }; /** @@ -229,7 +230,7 @@ class sort_merge_join { void postprocess_indices(preprocessed_table const& preprocessed_left, device_span smaller_indices, device_span larger_indices, - rmm::cuda_stream_view stream) const; + cuda::stream_ref stream) const; /** * @brief Core merge operation implementation for the sort-merge join algorithm. @@ -245,7 +246,7 @@ class sort_merge_join { auto invoke_merge(table_view right_view, table_view left_view, MergeOperation&& op, - rmm::cuda_stream_view stream) const; + cuda::stream_ref stream) const; }; } // namespace detail diff --git a/cpp/src/reductions/all.cu b/cpp/src/reductions/all.cu index 8807eb9c67db..219ac5461822 100644 --- a/cpp/src/reductions/all.cu +++ b/cpp/src/reductions/all.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -45,7 +45,7 @@ struct all_fn { template std::unique_ptr operator()(column_view const& input, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) requires(std::is_arithmetic_v) { @@ -66,7 +66,7 @@ struct all_fn { } template std::unique_ptr operator()(column_view const&, - rmm::cuda_stream_view, + cuda::stream_ref, rmm::device_async_resource_ref) requires(!std::is_arithmetic_v) { @@ -79,7 +79,7 @@ struct all_fn { std::unique_ptr all(column_view const& col, cudf::data_type const output_dtype, std::optional> init, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { CUDF_EXPECTS(output_dtype == cudf::data_type(cudf::type_id::BOOL8), diff --git a/cpp/src/reductions/any.cu b/cpp/src/reductions/any.cu index 39816394a3f7..596411de969a 100644 --- a/cpp/src/reductions/any.cu +++ b/cpp/src/reductions/any.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -45,7 +45,7 @@ struct any_fn { template std::unique_ptr operator()(column_view const& input, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) requires(std::is_arithmetic_v) { @@ -66,7 +66,7 @@ struct any_fn { } template std::unique_ptr operator()(column_view const&, - rmm::cuda_stream_view, + cuda::stream_ref, rmm::device_async_resource_ref) requires(!std::is_arithmetic_v) { @@ -79,7 +79,7 @@ struct any_fn { std::unique_ptr any(column_view const& col, cudf::data_type const output_dtype, std::optional> init, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, rmm::device_async_resource_ref mr) { CUDF_EXPECTS(output_dtype == cudf::data_type(cudf::type_id::BOOL8), diff --git a/cpp/src/reductions/approx_distinct_count.cu b/cpp/src/reductions/approx_distinct_count.cu index 70b1c46ff58b..61f0bf140db0 100644 --- a/cpp/src/reductions/approx_distinct_count.cu +++ b/cpp/src/reductions/approx_distinct_count.cu @@ -15,12 +15,12 @@ #include #include -#include #include #include #include #include +#include #include #include @@ -166,7 +166,7 @@ approx_distinct_count::approx_distinct_count( std::int32_t precision, null_policy null_handling, nan_policy nan_handling, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, cuda::mr::any_resource mr) : _mr{std::move(mr)}, _storage{rmm::device_uvector{ @@ -176,7 +176,7 @@ approx_distinct_count::approx_distinct_count( _nan_handling{nan_handling} { auto sketch_span = sketch(); - CUDF_CUDA_TRY(cudaMemsetAsync(sketch_span.data(), 0, sketch_span.size(), stream.value())); + CUDF_CUDA_TRY(cudaMemsetAsync(sketch_span.data(), 0, sketch_span.size(), stream.get())); if (input.num_rows() > 0) { add(input, stream); } } @@ -187,7 +187,7 @@ approx_distinct_count::approx_distinct_count( cudf::approx_distinct_count::desired_standard_error error, null_policy null_handling, nan_policy nan_handling, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, cuda::mr::any_resource mr) : approx_distinct_count{input, precision_from_standard_error(error.value), @@ -214,7 +214,7 @@ approx_distinct_count::approx_distinct_count( } template