diff --git a/cpp/benchmarks/common/generate_input.cu b/cpp/benchmarks/common/generate_input.cu index edb19b7b0ca..545028260b8 100644 --- a/cpp/benchmarks/common/generate_input.cu +++ b/cpp/benchmarks/common/generate_input.cu @@ -31,6 +31,7 @@ #include #include +#include #include #include @@ -542,7 +543,8 @@ std::unique_ptr create_random_column(data_profi sample_indices, cudf::out_of_bounds_policy::DONT_CHECK, cudf::detail::negative_index_policy::NOT_ALLOWED, - cudf::get_default_stream()); + cudf::get_default_stream(), + rmm::mr::get_current_device_resource()); return std::move(str_table->release()[0]); } diff --git a/cpp/include/cudf/detail/copy.hpp b/cpp/include/cudf/detail/copy.hpp index 8c3f315284d..83395f8fa90 100644 --- a/cpp/include/cudf/detail/copy.hpp +++ b/cpp/include/cudf/detail/copy.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2022, NVIDIA CORPORATION. + * Copyright (c) 2018-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -144,12 +144,11 @@ std::vector split(table_view const& input, * * @param stream CUDA stream used for device memory operations and kernel launches. */ -std::unique_ptr shift( - column_view const& input, - size_type offset, - scalar const& fill_value, - rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); +std::unique_ptr shift(column_view const& input, + size_type offset, + scalar const& fill_value, + rmm::cuda_stream_view stream, + rmm::mr::device_memory_resource* mr); /** * @brief Performs segmented shifts for specified values. @@ -184,24 +183,22 @@ std::unique_ptr shift( * * @note If `offset == 0`, a copy of @p segmented_values is returned. */ -std::unique_ptr segmented_shift( - column_view const& segmented_values, - device_span segment_offsets, - size_type offset, - scalar const& fill_value, - rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); +std::unique_ptr segmented_shift(column_view const& segmented_values, + device_span segment_offsets, + size_type offset, + scalar const& fill_value, + rmm::cuda_stream_view stream, + rmm::mr::device_memory_resource* mr); /** * @copydoc cudf::contiguous_split * * @param stream CUDA stream used for device memory operations and kernel launches. **/ -std::vector contiguous_split( - cudf::table_view const& input, - std::vector const& splits, - rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); +std::vector contiguous_split(cudf::table_view const& input, + std::vector const& splits, + rmm::cuda_stream_view stream, + rmm::mr::device_memory_resource* mr); /** * @copydoc cudf::pack @@ -210,7 +207,7 @@ std::vector contiguous_split( **/ packed_columns pack(cudf::table_view const& input, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::mr::device_memory_resource* mr); /** * @copydoc cudf::allocate_like(column_view const&, size_type, mask_allocation_policy, @@ -218,12 +215,11 @@ packed_columns pack(cudf::table_view const& input, * * @param[in] stream CUDA stream used for device memory operations and kernel launches. */ -std::unique_ptr allocate_like( - column_view const& input, - size_type size, - mask_allocation_policy mask_alloc = mask_allocation_policy::RETAIN, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); +std::unique_ptr allocate_like(column_view const& input, + size_type size, + mask_allocation_policy mask_alloc, + rmm::cuda_stream_view stream, + rmm::mr::device_memory_resource* mr); /** * @copydoc cudf::copy_if_else( column_view const&, column_view const&, @@ -231,12 +227,11 @@ std::unique_ptr allocate_like( * * @param[in] stream CUDA stream used for device memory operations and kernel launches. */ -std::unique_ptr copy_if_else( - column_view const& lhs, - column_view const& rhs, - column_view const& boolean_mask, - rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); +std::unique_ptr copy_if_else(column_view const& lhs, + column_view const& rhs, + column_view const& boolean_mask, + rmm::cuda_stream_view stream, + rmm::mr::device_memory_resource* mr); /** * @copydoc cudf::copy_if_else( scalar const&, column_view const&, @@ -244,12 +239,11 @@ std::unique_ptr copy_if_else( * * @param[in] stream CUDA stream used for device memory operations and kernel launches. */ -std::unique_ptr copy_if_else( - scalar const& lhs, - column_view const& rhs, - column_view const& boolean_mask, - rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); +std::unique_ptr copy_if_else(scalar const& lhs, + column_view const& rhs, + column_view const& boolean_mask, + rmm::cuda_stream_view stream, + rmm::mr::device_memory_resource* mr); /** * @copydoc cudf::copy_if_else( column_view const&, scalar const&, @@ -257,12 +251,11 @@ std::unique_ptr copy_if_else( * * @param[in] stream CUDA stream used for device memory operations and kernel launches. */ -std::unique_ptr copy_if_else( - column_view const& lhs, - scalar const& rhs, - column_view const& boolean_mask, - rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); +std::unique_ptr copy_if_else(column_view const& lhs, + scalar const& rhs, + column_view const& boolean_mask, + rmm::cuda_stream_view stream, + rmm::mr::device_memory_resource* mr); /** * @copydoc cudf::copy_if_else( scalar const&, scalar const&, @@ -270,36 +263,33 @@ std::unique_ptr copy_if_else( * * @param[in] stream CUDA stream used for device memory operations and kernel launches. */ -std::unique_ptr copy_if_else( - scalar const& lhs, - scalar const& rhs, - column_view const& boolean_mask, - rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); +std::unique_ptr copy_if_else(scalar const& lhs, + scalar const& rhs, + column_view const& boolean_mask, + rmm::cuda_stream_view stream, + rmm::mr::device_memory_resource* mr); /** * @copydoc cudf::sample * * @param[in] stream CUDA stream used for device memory operations and kernel launches. */ -std::unique_ptr sample( - table_view const& input, - size_type const n, - sample_with_replacement replacement = sample_with_replacement::FALSE, - int64_t const seed = 0, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); +std::unique_ptr
sample(table_view const& input, + size_type const n, + sample_with_replacement replacement, + int64_t const seed, + rmm::cuda_stream_view stream, + rmm::mr::device_memory_resource* mr); /** * @copydoc cudf::get_element * * @param[in] stream CUDA stream used for device memory operations and kernel launches. */ -std::unique_ptr get_element( - column_view const& input, - size_type index, - rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); +std::unique_ptr get_element(column_view const& input, + size_type index, + rmm::cuda_stream_view stream, + rmm::mr::device_memory_resource* mr); /** * @copydoc cudf::has_nonempty_nulls @@ -320,10 +310,9 @@ bool may_have_nonempty_nulls(column_view const& input, rmm::cuda_stream_view str * * @param stream CUDA stream used for device memory operations and kernel launches. */ -std::unique_ptr purge_nonempty_nulls( - column_view const& input, - rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); +std::unique_ptr purge_nonempty_nulls(column_view const& input, + rmm::cuda_stream_view stream, + rmm::mr::device_memory_resource* mr); } // namespace detail } // namespace cudf diff --git a/cpp/include/cudf/detail/gather.cuh b/cpp/include/cudf/detail/gather.cuh index 57d834e6277..ac2865c05c5 100644 --- a/cpp/include/cudf/detail/gather.cuh +++ b/cpp/include/cudf/detail/gather.cuh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2022, NVIDIA CORPORATION. + * Copyright (c) 2019-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -647,13 +647,12 @@ void gather_bitmask(table_view const& source, * @return cudf::table Result of the gather */ template -std::unique_ptr
gather( - table_view const& source_table, - MapIterator gather_map_begin, - MapIterator gather_map_end, - out_of_bounds_policy bounds_policy = out_of_bounds_policy::DONT_CHECK, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()) +std::unique_ptr
gather(table_view const& source_table, + MapIterator gather_map_begin, + MapIterator gather_map_end, + out_of_bounds_policy bounds_policy, + rmm::cuda_stream_view stream, + rmm::mr::device_memory_resource* mr) { std::vector> destination_columns; diff --git a/cpp/include/cudf/detail/gather.hpp b/cpp/include/cudf/detail/gather.hpp index 9d61a8de184..034eb6c1282 100644 --- a/cpp/include/cudf/detail/gather.hpp +++ b/cpp/include/cudf/detail/gather.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2022, NVIDIA CORPORATION. + * Copyright (c) 2019-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -61,13 +61,12 @@ enum class negative_index_policy : bool { ALLOWED, NOT_ALLOWED }; * @param[in] mr Device memory resource used to allocate the returned table's device memory * @return Result of the gather */ -std::unique_ptr
gather( - table_view const& source_table, - column_view const& gather_map, - out_of_bounds_policy bounds_policy, - negative_index_policy neg_indices, - rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); +std::unique_ptr
gather(table_view const& source_table, + column_view const& gather_map, + out_of_bounds_policy bounds_policy, + negative_index_policy neg_indices, + rmm::cuda_stream_view stream, + rmm::mr::device_memory_resource* mr); /** * @copydoc cudf::detail::gather(table_view const&,column_view const&,table_view @@ -76,13 +75,12 @@ std::unique_ptr
gather( * * @throws cudf::logic_error if `gather_map` span size is larger than max of `size_type`. */ -std::unique_ptr
gather( - table_view const& source_table, - device_span const gather_map, - out_of_bounds_policy bounds_policy, - negative_index_policy neg_indices, - rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); +std::unique_ptr
gather(table_view const& source_table, + device_span const gather_map, + out_of_bounds_policy bounds_policy, + negative_index_policy neg_indices, + rmm::cuda_stream_view stream, + rmm::mr::device_memory_resource* mr); } // namespace detail } // namespace cudf diff --git a/cpp/include/cudf/detail/hashing.hpp b/cpp/include/cudf/detail/hashing.hpp index b7469d80a8d..771b3e150ec 100644 --- a/cpp/include/cudf/detail/hashing.hpp +++ b/cpp/include/cudf/detail/hashing.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2022, NVIDIA CORPORATION. + * Copyright (c) 2019-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,29 +31,25 @@ namespace detail { * * @param stream CUDA stream used for device memory operations and kernel launches. */ -std::unique_ptr hash( - table_view const& input, - hash_id hash_function = hash_id::HASH_MURMUR3, - uint32_t seed = cudf::DEFAULT_HASH_SEED, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); +std::unique_ptr hash(table_view const& input, + hash_id hash_function, + uint32_t seed, + rmm::cuda_stream_view stream, + rmm::mr::device_memory_resource* mr); -std::unique_ptr murmur_hash3_32( - table_view const& input, - uint32_t seed = cudf::DEFAULT_HASH_SEED, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); +std::unique_ptr murmur_hash3_32(table_view const& input, + uint32_t seed, + rmm::cuda_stream_view, + rmm::mr::device_memory_resource* mr); -std::unique_ptr spark_murmur_hash3_32( - table_view const& input, - uint32_t seed = cudf::DEFAULT_HASH_SEED, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); +std::unique_ptr spark_murmur_hash3_32(table_view const& input, + uint32_t seed, + rmm::cuda_stream_view, + rmm::mr::device_memory_resource* mr); -std::unique_ptr md5_hash( - table_view const& input, - rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); +std::unique_ptr md5_hash(table_view const& input, + rmm::cuda_stream_view stream, + rmm::mr::device_memory_resource* mr); /* Copyright 2005-2014 Daniel James. * diff --git a/cpp/include/cudf/detail/interop.hpp b/cpp/include/cudf/detail/interop.hpp index 25ce5b09eb8..452144da167 100644 --- a/cpp/include/cudf/detail/interop.hpp +++ b/cpp/include/cudf/detail/interop.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2022, NVIDIA CORPORATION. + * Copyright (c) 2020-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -111,9 +111,9 @@ data_type arrow_to_cudf_type(arrow::DataType const& arrow_type); * @param stream CUDA stream used for device memory operations and kernel launches. */ std::shared_ptr to_arrow(table_view input, - std::vector const& metadata = {}, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - arrow::MemoryPool* ar_mr = arrow::default_memory_pool()); + std::vector const& metadata, + rmm::cuda_stream_view stream, + arrow::MemoryPool* ar_mr); /** * @copydoc cudf::arrow_to_cudf diff --git a/cpp/include/cudf/detail/stream_compaction.hpp b/cpp/include/cudf/detail/stream_compaction.hpp index e725718ed22..e0fc7b71cd9 100644 --- a/cpp/include/cudf/detail/stream_compaction.hpp +++ b/cpp/include/cudf/detail/stream_compaction.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2022, NVIDIA CORPORATION. + * Copyright (c) 2019-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,12 +32,11 @@ namespace detail { * * @param[in] stream CUDA stream used for device memory operations and kernel launches. */ -std::unique_ptr
drop_nulls( - table_view const& input, - std::vector const& keys, - cudf::size_type keep_threshold, - rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); +std::unique_ptr
drop_nulls(table_view const& input, + std::vector const& keys, + cudf::size_type keep_threshold, + rmm::cuda_stream_view stream, + rmm::mr::device_memory_resource* mr); /** * @copydoc cudf::drop_nans(table_view const&, std::vector const&, @@ -45,50 +44,46 @@ std::unique_ptr
drop_nulls( * * @param[in] stream CUDA stream used for device memory operations and kernel launches. */ -std::unique_ptr
drop_nans( - table_view const& input, - std::vector const& keys, - cudf::size_type keep_threshold, - rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); +std::unique_ptr
drop_nans(table_view const& input, + std::vector const& keys, + cudf::size_type keep_threshold, + rmm::cuda_stream_view stream, + rmm::mr::device_memory_resource* mr); /** * @copydoc cudf::apply_boolean_mask * * @param[in] stream CUDA stream used for device memory operations and kernel launches. */ -std::unique_ptr
apply_boolean_mask( - table_view const& input, - column_view const& boolean_mask, - rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); +std::unique_ptr
apply_boolean_mask(table_view const& input, + column_view const& boolean_mask, + rmm::cuda_stream_view stream, + rmm::mr::device_memory_resource* mr); /** * @copydoc cudf::unique * * @param[in] stream CUDA stream used for device memory operations and kernel launches. */ -std::unique_ptr
unique( - table_view const& input, - std::vector const& keys, - duplicate_keep_option keep, - null_equality nulls_equal = null_equality::EQUAL, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); +std::unique_ptr
unique(table_view const& input, + std::vector const& keys, + duplicate_keep_option keep, + null_equality nulls_equal, + rmm::cuda_stream_view stream, + rmm::mr::device_memory_resource* mr); /** * @copydoc cudf::distinct * * @param[in] stream CUDA stream used for device memory operations and kernel launches. */ -std::unique_ptr
distinct( - table_view const& input, - std::vector const& keys, - duplicate_keep_option keep = duplicate_keep_option::KEEP_ANY, - null_equality nulls_equal = null_equality::EQUAL, - nan_equality nans_equal = nan_equality::ALL_EQUAL, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); +std::unique_ptr
distinct(table_view const& input, + std::vector const& keys, + duplicate_keep_option keep, + null_equality nulls_equal, + nan_equality nans_equal, + rmm::cuda_stream_view stream, + rmm::mr::device_memory_resource* mr); /** * @brief Create a new table without duplicate rows. @@ -110,14 +105,13 @@ std::unique_ptr
distinct( * @param mr Device memory resource used to allocate the returned table * @return A table containing the resulting distinct rows */ -std::unique_ptr
stable_distinct( - table_view const& input, - std::vector const& keys, - duplicate_keep_option keep = duplicate_keep_option::KEEP_ANY, - null_equality nulls_equal = null_equality::EQUAL, - nan_equality nans_equal = nan_equality::ALL_EQUAL, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); +std::unique_ptr
stable_distinct(table_view const& input, + std::vector const& keys, + duplicate_keep_option keep, + null_equality nulls_equal, + nan_equality nans_equal, + rmm::cuda_stream_view stream, + rmm::mr::device_memory_resource* mr); /** * @brief Create a column of indices of all distinct rows in the input table. @@ -133,13 +127,12 @@ std::unique_ptr
stable_distinct( * @param mr Device memory resource used to allocate the returned vector * @return A device_uvector containing the result indices */ -rmm::device_uvector get_distinct_indices( - table_view const& input, - duplicate_keep_option keep = duplicate_keep_option::KEEP_ANY, - null_equality nulls_equal = null_equality::EQUAL, - nan_equality nans_equal = nan_equality::ALL_EQUAL, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); +rmm::device_uvector get_distinct_indices(table_view const& input, + duplicate_keep_option keep, + null_equality nulls_equal, + nan_equality nans_equal, + rmm::cuda_stream_view stream, + rmm::mr::device_memory_resource* mr); /** * @copydoc cudf::unique_count(column_view const&, null_policy, nan_policy) @@ -157,8 +150,8 @@ cudf::size_type unique_count(column_view const& input, * @param[in] stream CUDA stream used for device memory operations and kernel launches. */ 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, + rmm::cuda_stream_view stream); /** * @copydoc cudf::distinct_count(column_view const&, null_policy, nan_policy) @@ -176,8 +169,8 @@ cudf::size_type distinct_count(column_view const& input, * @param[in] stream CUDA stream used for device memory operations and kernel launches. */ 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, + rmm::cuda_stream_view stream); } // namespace detail } // namespace cudf diff --git a/cpp/include/cudf/lists/detail/gather.cuh b/cpp/include/cudf/lists/detail/gather.cuh index 48c0ed8f6e9..83710a49f6a 100644 --- a/cpp/include/cudf/lists/detail/gather.cuh +++ b/cpp/include/cudf/lists/detail/gather.cuh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2022, NVIDIA CORPORATION. + * Copyright (c) 2020-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -285,11 +285,10 @@ gather_data make_gather_data(cudf::lists_column_view const& source_column, * * @returns column with elements gathered based on `gather_data` */ -std::unique_ptr gather_list_nested( - lists_column_view const& list, - gather_data& gd, - rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); +std::unique_ptr gather_list_nested(lists_column_view const& list, + gather_data& gd, + rmm::cuda_stream_view stream, + rmm::mr::device_memory_resource* mr); /** * @brief Gather a leaf column from a hierarchy of list columns. @@ -303,11 +302,10 @@ std::unique_ptr gather_list_nested( * * @returns column with elements gathered based on `gather_data` */ -std::unique_ptr gather_list_leaf( - column_view const& column, - gather_data const& gd, - rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); +std::unique_ptr gather_list_leaf(column_view const& column, + gather_data const& gd, + rmm::cuda_stream_view stream, + rmm::mr::device_memory_resource* mr); /** * @copydoc cudf::lists::segmented_gather(lists_column_view const& source_column, @@ -317,13 +315,11 @@ std::unique_ptr gather_list_leaf( * * @param stream CUDA stream on which to execute kernels */ -std::unique_ptr segmented_gather( - lists_column_view const& source_column, - lists_column_view const& gather_map_list, - out_of_bounds_policy bounds_policy = out_of_bounds_policy::DONT_CHECK, - // Move before bounds_policy? - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); +std::unique_ptr segmented_gather(lists_column_view const& source_column, + lists_column_view const& gather_map_list, + out_of_bounds_policy bounds_policy, + rmm::cuda_stream_view stream, + rmm::mr::device_memory_resource* mr); } // namespace detail } // namespace lists diff --git a/cpp/src/binaryop/compiled/binary_ops.hpp b/cpp/src/binaryop/compiled/binary_ops.hpp index c51993409ef..47fd50c5d97 100644 --- a/cpp/src/binaryop/compiled/binary_ops.hpp +++ b/cpp/src/binaryop/compiled/binary_ops.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2022, NVIDIA CORPORATION. + * Copyright (c) 2018-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,29 +32,26 @@ class mutable_column_device_view; namespace binops { namespace compiled { -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 = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); +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, + rmm::mr::device_memory_resource* 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 = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); +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, + rmm::mr::device_memory_resource* 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 = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); +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, + rmm::mr::device_memory_resource* mr); /** * @brief Performs a binary operation between a string scalar and a string @@ -75,13 +72,12 @@ std::unique_ptr string_null_min_max( * @param mr Device memory resource used to allocate the returned column's device memory * @return std::unique_ptr Output column */ -std::unique_ptr binary_operation( - scalar const& lhs, - column_view const& rhs, - binary_operator op, - data_type output_type, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); +std::unique_ptr binary_operation(scalar const& lhs, + column_view const& rhs, + binary_operator op, + data_type output_type, + rmm::cuda_stream_view stream, + rmm::mr::device_memory_resource* mr); /** * @brief Performs a binary operation between a string column and a string @@ -102,13 +98,12 @@ std::unique_ptr binary_operation( * @param mr Device memory resource used to allocate the returned column's device memory * @return std::unique_ptr Output column */ -std::unique_ptr binary_operation( - column_view const& lhs, - scalar const& rhs, - binary_operator op, - data_type output_type, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); +std::unique_ptr binary_operation(column_view const& lhs, + scalar const& rhs, + binary_operator op, + data_type output_type, + rmm::cuda_stream_view stream, + rmm::mr::device_memory_resource* mr); /** * @brief Performs a binary operation between two string columns. @@ -128,13 +123,12 @@ std::unique_ptr binary_operation( * @param mr Device memory resource used to allocate the returned column's device memory * @return std::unique_ptr Output column */ -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 = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); +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, + rmm::mr::device_memory_resource* mr); void binary_operation(mutable_column_view& out, scalar const& lhs, diff --git a/cpp/src/copying/copy.cu b/cpp/src/copying/copy.cu index 0978cf441d8..9ec00612f2f 100644 --- a/cpp/src/copying/copy.cu +++ b/cpp/src/copying/copy.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2022, NVIDIA CORPORATION. + * Copyright (c) 2019-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ #include #include +#include #include #include @@ -174,7 +175,8 @@ std::unique_ptr scatter_gather_based_if_else(cudf::column_view const& lh gather_map, out_of_bounds_policy::DONT_CHECK, negative_index_policy::NOT_ALLOWED, - stream); + stream, + rmm::mr::get_current_device_resource()); auto result = cudf::detail::scatter( table_view{std::vector{scatter_src_lhs->get_column(0).view()}}, diff --git a/cpp/src/copying/scatter.cu b/cpp/src/copying/scatter.cu index dd4912a216e..316f39b616c 100644 --- a/cpp/src/copying/scatter.cu +++ b/cpp/src/copying/scatter.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2022, NVIDIA CORPORATION. + * Copyright (c) 2019-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -253,7 +253,8 @@ struct column_scalar_scatterer_impl { auto scatter_functor = column_scalar_scatterer{}; auto fields_iter_begin = make_counting_transform_iterator(0, [&](auto const& i) { - auto row_slr = get_element(typed_s->view().column(i), 0, stream); + auto row_slr = + get_element(typed_s->view().column(i), 0, stream, rmm::mr::get_current_device_resource()); return type_dispatcher(row_slr->type(), scatter_functor, *row_slr, @@ -392,8 +393,8 @@ std::unique_ptr boolean_mask_scatter(column_view const& input, 0); // The scatter map is actually a table with only one column, which is scatter map. - auto scatter_map = - detail::apply_boolean_mask(table_view{{indices->view()}}, boolean_mask, stream); + auto scatter_map = detail::apply_boolean_mask( + table_view{{indices->view()}}, boolean_mask, stream, rmm::mr::get_current_device_resource()); auto output_table = detail::scatter( table_view{{input}}, scatter_map->get_column(0).view(), table_view{{target}}, stream, mr); diff --git a/cpp/src/rolling/detail/lead_lag_nested.cuh b/cpp/src/rolling/detail/lead_lag_nested.cuh index 859ed7e5d53..d2fe9fabd1b 100644 --- a/cpp/src/rolling/detail/lead_lag_nested.cuh +++ b/cpp/src/rolling/detail/lead_lag_nested.cuh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022, NVIDIA CORPORATION. + * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,6 +26,7 @@ #include #include +#include #include #include @@ -191,7 +192,8 @@ std::unique_ptr compute_lead_lag_for_nested(aggregation::Kind op, scatter_map, out_of_bounds_policy::DONT_CHECK, cudf::detail::negative_index_policy::NOT_ALLOWED, - stream); + stream, + rmm::mr::get_current_device_resource()); // Scatter defaults into locations where LEAD/LAG computed nulls. auto scattered_results = cudf::detail::scatter( diff --git a/cpp/src/sort/segmented_sort_impl.cuh b/cpp/src/sort/segmented_sort_impl.cuh index a32382b840f..b7347974173 100644 --- a/cpp/src/sort/segmented_sort_impl.cuh +++ b/cpp/src/sort/segmented_sort_impl.cuh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022, NVIDIA CORPORATION. + * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ #include #include +#include #include @@ -72,8 +73,11 @@ struct column_fast_sort_fn { { // CUB's segmented sort functions cannot accept iterators. // We create a temporary column here for it to use. - auto temp_col = - cudf::detail::allocate_like(input, input.size(), mask_allocation_policy::NEVER, stream); + auto temp_col = cudf::detail::allocate_like(input, + input.size(), + mask_allocation_policy::NEVER, + stream, + rmm::mr::get_current_device_resource()); mutable_column_view output_view = temp_col->mutable_view(); // DeviceSegmentedSort is faster than DeviceSegmentedRadixSort at this time diff --git a/cpp/src/stream_compaction/distinct.cu b/cpp/src/stream_compaction/distinct.cu index e15d54b4251..083b1b2eb46 100644 --- a/cpp/src/stream_compaction/distinct.cu +++ b/cpp/src/stream_compaction/distinct.cu @@ -25,6 +25,8 @@ #include #include +#include + #include #include #include @@ -145,8 +147,12 @@ std::unique_ptr
distinct(table_view const& input, return empty_like(input); } - auto const gather_map = - get_distinct_indices(input.select(keys), keep, nulls_equal, nans_equal, stream); + auto const gather_map = get_distinct_indices(input.select(keys), + keep, + nulls_equal, + nans_equal, + stream, + rmm::mr::get_current_device_resource()); return detail::gather(input, gather_map, out_of_bounds_policy::DONT_CHECK, diff --git a/cpp/src/stream_compaction/distinct_count.cu b/cpp/src/stream_compaction/distinct_count.cu index 760fcf4bb6b..0dae26c18a9 100644 --- a/cpp/src/stream_compaction/distinct_count.cu +++ b/cpp/src/stream_compaction/distinct_count.cu @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -209,6 +210,6 @@ cudf::size_type distinct_count(column_view const& input, cudf::size_type distinct_count(table_view const& input, null_equality nulls_equal) { CUDF_FUNC_RANGE(); - return detail::distinct_count(input, nulls_equal); + return detail::distinct_count(input, nulls_equal, cudf::get_default_stream()); } } // namespace cudf diff --git a/cpp/src/stream_compaction/stable_distinct.cu b/cpp/src/stream_compaction/stable_distinct.cu index dc80a454777..d45897930b0 100644 --- a/cpp/src/stream_compaction/stable_distinct.cu +++ b/cpp/src/stream_compaction/stable_distinct.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, NVIDIA CORPORATION. + * Copyright (c) 2022-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,8 +38,12 @@ std::unique_ptr
stable_distinct(table_view const& input, return empty_like(input); } - auto const distinct_indices = - get_distinct_indices(input.select(keys), keep, nulls_equal, nans_equal, stream); + auto const distinct_indices = get_distinct_indices(input.select(keys), + keep, + nulls_equal, + nans_equal, + stream, + rmm::mr::get_current_device_resource()); // Markers to denote which rows to be copied to the output. auto const output_markers = [&] { diff --git a/cpp/src/stream_compaction/unique_count.cu b/cpp/src/stream_compaction/unique_count.cu index c7c10438d7a..4c1cf2b2bc3 100644 --- a/cpp/src/stream_compaction/unique_count.cu +++ b/cpp/src/stream_compaction/unique_count.cu @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -144,7 +145,7 @@ cudf::size_type unique_count(column_view const& input, cudf::size_type unique_count(table_view const& input, null_equality nulls_equal) { CUDF_FUNC_RANGE(); - return detail::unique_count(input, nulls_equal); + return detail::unique_count(input, nulls_equal, cudf::get_default_stream()); } } // namespace cudf diff --git a/cpp/tests/copying/detail_gather_tests.cu b/cpp/tests/copying/detail_gather_tests.cu index bf2937ae8ab..aae511413ef 100644 --- a/cpp/tests/copying/detail_gather_tests.cu +++ b/cpp/tests/copying/detail_gather_tests.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2022, NVIDIA CORPORATION. + * Copyright (c) 2020-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -58,7 +58,12 @@ TYPED_TEST(GatherTest, GatherDetailDeviceVectorTest) // test with device vector iterators { std::unique_ptr result = - cudf::detail::gather(source_table, gather_map.begin(), gather_map.end()); + cudf::detail::gather(source_table, + gather_map.begin(), + gather_map.end(), + cudf::out_of_bounds_policy::DONT_CHECK, + cudf::get_default_stream(), + rmm::mr::get_current_device_resource()); for (auto i = 0; i < source_table.num_columns(); ++i) { CUDF_TEST_EXPECT_COLUMNS_EQUAL(source_table.column(i), result->view().column(i)); @@ -70,7 +75,12 @@ TYPED_TEST(GatherTest, GatherDetailDeviceVectorTest) // test with raw pointers { std::unique_ptr result = - cudf::detail::gather(source_table, gather_map.data(), gather_map.data() + gather_map.size()); + cudf::detail::gather(source_table, + gather_map.begin(), + gather_map.data() + gather_map.size(), + cudf::out_of_bounds_policy::DONT_CHECK, + cudf::get_default_stream(), + rmm::mr::get_current_device_resource()); for (auto i = 0; i < source_table.num_columns(); ++i) { CUDF_TEST_EXPECT_COLUMNS_EQUAL(source_table.column(i), result->view().column(i)); @@ -97,7 +107,8 @@ TYPED_TEST(GatherTest, GatherDetailInvalidIndexTest) gather_map, cudf::out_of_bounds_policy::NULLIFY, cudf::detail::negative_index_policy::NOT_ALLOWED, - cudf::get_default_stream()); + cudf::get_default_stream(), + rmm::mr::get_current_device_resource()); auto expect_data = cudf::detail::make_counting_transform_iterator(0, [](auto i) { return (i % 2) ? 0 : i; }); diff --git a/cpp/tests/copying/gather_str_tests.cpp b/cpp/tests/copying/gather_str_tests.cpp index 3db2ce399cc..7810566fbf1 100644 --- a/cpp/tests/copying/gather_str_tests.cpp +++ b/cpp/tests/copying/gather_str_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2022, NVIDIA CORPORATION. + * Copyright (c) 2020-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,6 +25,8 @@ #include #include +#include + class GatherTestStr : public cudf::test::BaseFixture { }; @@ -87,7 +89,8 @@ TEST_F(GatherTestStr, Gather) gather_map, cudf::out_of_bounds_policy::NULLIFY, cudf::detail::negative_index_policy::NOT_ALLOWED, - cudf::get_default_stream()); + cudf::get_default_stream(), + rmm::mr::get_current_device_resource()); std::vector h_expected; std::vector expected_validity; @@ -118,7 +121,8 @@ TEST_F(GatherTestStr, GatherDontCheckOutOfBounds) gather_map, cudf::out_of_bounds_policy::DONT_CHECK, cudf::detail::negative_index_policy::NOT_ALLOWED, - cudf::get_default_stream()); + cudf::get_default_stream(), + rmm::mr::get_current_device_resource()); std::vector h_expected; for (auto itr = h_map.begin(); itr != h_map.end(); ++itr) { @@ -137,7 +141,8 @@ TEST_F(GatherTestStr, GatherEmptyMapStringsColumn) gather_map, cudf::out_of_bounds_policy::NULLIFY, cudf::detail::negative_index_policy::NOT_ALLOWED, - cudf::get_default_stream()); + cudf::get_default_stream(), + rmm::mr::get_current_device_resource()); cudf::test::expect_column_empty(results->get_column(0).view()); } @@ -151,6 +156,7 @@ TEST_F(GatherTestStr, GatherZeroSizeStringsColumn) gather_map, cudf::out_of_bounds_policy::NULLIFY, cudf::detail::negative_index_policy::NOT_ALLOWED, - cudf::get_default_stream()); + cudf::get_default_stream(), + rmm::mr::get_current_device_resource()); CUDF_TEST_EXPECT_COLUMNS_EQUAL(expected, results->get_column(0).view()); } diff --git a/java/src/main/native/src/ColumnViewJni.cu b/java/src/main/native/src/ColumnViewJni.cu index 7e0b0f9330d..8a2c0b2b411 100644 --- a/java/src/main/native/src/ColumnViewJni.cu +++ b/java/src/main/native/src/ColumnViewJni.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022, NVIDIA CORPORATION. + * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -187,13 +188,14 @@ std::unique_ptr lists_distinct_by_key(cudf::lists_column_view cons // Use `cudf::duplicate_keep_option::KEEP_LAST` so this will produce the desired behavior when // being called in `create_map` in spark-rapids. // Other options comparing nulls and NaNs are set as all-equal. - auto out_columns = cudf::detail::stable_distinct( - table_view{{column_view{cudf::device_span{labels}}, - child.child(0), child.child(1)}}, // input table - std::vector{0, 1}, // key columns - cudf::duplicate_keep_option::KEEP_LAST, cudf::null_equality::EQUAL, - cudf::nan_equality::ALL_EQUAL, stream) - ->release(); + auto out_columns = + cudf::detail::stable_distinct( + table_view{{column_view{cudf::device_span{labels}}, child.child(0), + child.child(1)}}, // input table + std::vector{0, 1}, // key columns + cudf::duplicate_keep_option::KEEP_LAST, cudf::null_equality::EQUAL, + cudf::nan_equality::ALL_EQUAL, stream, rmm::mr::get_current_device_resource()) + ->release(); auto const out_labels = out_columns.front()->view(); // Assemble a structs column of .