diff --git a/cpp/src/binaryop/compiled/struct_binary_ops.cuh b/cpp/src/binaryop/compiled/struct_binary_ops.cuh index 8418493318f..2299df5a9bb 100644 --- a/cpp/src/binaryop/compiled/struct_binary_ops.cuh +++ b/cpp/src/binaryop/compiled/struct_binary_ops.cuh @@ -70,8 +70,8 @@ void apply_struct_binary_op(mutable_column_view& out, column_view const& rhs, bool is_lhs_scalar, bool is_rhs_scalar, - PhysicalElementComparator comparator = {}, - rmm::cuda_stream_view stream = cudf::get_default_stream()) + PhysicalElementComparator comparator, + rmm::cuda_stream_view stream) { auto const compare_orders = std::vector( lhs.size(), @@ -144,8 +144,8 @@ void apply_struct_equality_op(mutable_column_view& out, bool is_lhs_scalar, bool is_rhs_scalar, binary_operator op, - PhysicalEqualityComparator comparator = {}, - rmm::cuda_stream_view stream = cudf::get_default_stream()) + PhysicalEqualityComparator comparator, + rmm::cuda_stream_view stream) { CUDF_EXPECTS(op == binary_operator::EQUAL || op == binary_operator::NOT_EQUAL || op == binary_operator::NULL_EQUALS, diff --git a/cpp/src/join/conditional_join.hpp b/cpp/src/join/conditional_join.hpp index 7c329cd8e17..9bc6024ee7e 100644 --- a/cpp/src/join/conditional_join.hpp +++ b/cpp/src/join/conditional_join.hpp @@ -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. @@ -47,9 +47,9 @@ conditional_join(table_view const& left, table_view const& right, ast::expression const& binary_predicate, join_kind JoinKind, - std::optional output_size = {}, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + std::optional output_size, + rmm::cuda_stream_view stream, + rmm::mr::device_memory_resource* mr); /** * @brief Computes the size of a join operation between two tables without @@ -63,13 +63,12 @@ conditional_join(table_view const& left, * * @return Join output indices vector pair */ -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, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); +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, + rmm::mr::device_memory_resource* mr); } // namespace detail } // namespace cudf diff --git a/cpp/src/merge/merge.cu b/cpp/src/merge/merge.cu index d9c573e8155..05842348807 100644 --- a/cpp/src/merge/merge.cu +++ b/cpp/src/merge/merge.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. @@ -170,8 +170,8 @@ index_vector generate_merged_indices(table_view const& left_table, table_view const& right_table, std::vector const& column_order, std::vector const& null_precedence, - bool nullable = true, - rmm::cuda_stream_view stream = cudf::get_default_stream()) + bool nullable, + rmm::cuda_stream_view stream) { const size_type left_size = left_table.num_rows(); const size_type right_size = right_table.num_rows(); @@ -410,7 +410,7 @@ table_ptr_type merge(cudf::table_view const& left_table, // extract merged row order according to indices: // auto const merged_indices = generate_merged_indices( - index_left_view, index_right_view, column_order, null_precedence, nullable); + index_left_view, index_right_view, column_order, null_precedence, nullable, stream); // create merged table: // diff --git a/cpp/src/partitioning/round_robin.cu b/cpp/src/partitioning/round_robin.cu index 990992cd8f2..00f64b36e2d 100644 --- a/cpp/src/partitioning/round_robin.cu +++ b/cpp/src/partitioning/round_robin.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. @@ -151,9 +151,9 @@ namespace detail { std::pair, std::vector> round_robin_partition( table_view const& input, cudf::size_type num_partitions, - cudf::size_type start_partition = 0, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()) + cudf::size_type start_partition, + rmm::cuda_stream_view stream, + rmm::mr::device_memory_resource* mr) { auto nrows = input.num_rows(); diff --git a/cpp/src/rolling/detail/range_window_bounds.hpp b/cpp/src/rolling/detail/range_window_bounds.hpp index 506bd54e5eb..d1de7adba7a 100644 --- a/cpp/src/rolling/detail/range_window_bounds.hpp +++ b/cpp/src/rolling/detail/range_window_bounds.hpp @@ -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. @@ -146,10 +146,9 @@ RepT range_comparable_value_impl(scalar const& range_scalar, * @return RepType Value of the range scalar */ template -range_rep_type range_comparable_value( - range_window_bounds const& range_bounds, - data_type const& order_by_data_type = data_type{type_to_id()}, - rmm::cuda_stream_view stream = cudf::get_default_stream()) +range_rep_type range_comparable_value(range_window_bounds const& range_bounds, + data_type const& order_by_data_type, + rmm::cuda_stream_view stream) { auto const& range_scalar = range_bounds.range_scalar(); using range_type = cudf::detail::range_type; diff --git a/cpp/tests/rolling/range_window_bounds_test.cpp b/cpp/tests/rolling/range_window_bounds_test.cpp index 1b753fb6040..c70e0a78100 100644 --- a/cpp/tests/rolling/range_window_bounds_test.cpp +++ b/cpp/tests/rolling/range_window_bounds_test.cpp @@ -21,6 +21,7 @@ #include #include +#include #include #include @@ -57,34 +58,43 @@ TYPED_TEST(TimestampRangeWindowBoundsTest, BoundsConstruction) using OrderByType = TypeParam; using range_type = cudf::detail::range_type; using rep_type = cudf::detail::range_rep_type; + auto const dtype = cudf::data_type{cudf::type_to_id()}; static_assert(cudf::is_duration()); auto range_3 = cudf::range_window_bounds::get(cudf::duration_scalar{3, true}); EXPECT_FALSE(range_3.is_unbounded() && "range_window_bounds constructed from scalar cannot be unbounded."); - EXPECT_EQ(cudf::detail::range_comparable_value(range_3), rep_type{3}); + EXPECT_EQ( + cudf::detail::range_comparable_value(range_3, dtype, cudf::get_default_stream()), + rep_type{3}); auto range_unbounded = cudf::range_window_bounds::unbounded(cudf::data_type{cudf::type_to_id()}); EXPECT_TRUE(range_unbounded.is_unbounded() && "range_window_bounds::unbounded() must return an unbounded range."); - EXPECT_EQ(cudf::detail::range_comparable_value(range_unbounded), rep_type{}); + EXPECT_EQ(cudf::detail::range_comparable_value( + range_unbounded, dtype, cudf::get_default_stream()), + rep_type{}); } TYPED_TEST(TimestampRangeWindowBoundsTest, WrongRangeType) { using OrderByType = TypeParam; + auto const dtype = cudf::data_type{cudf::type_to_id()}; using wrong_range_type = std::conditional_t, cudf::duration_ns, cudf::duration_D>; auto range_3 = cudf::range_window_bounds::get(cudf::duration_scalar{3, true}); - EXPECT_THROW(cudf::detail::range_comparable_value(range_3), cudf::logic_error); + EXPECT_THROW( + cudf::detail::range_comparable_value(range_3, dtype, cudf::get_default_stream()), + cudf::logic_error); auto range_unbounded = cudf::range_window_bounds::unbounded(cudf::data_type{cudf::type_to_id()}); - EXPECT_THROW(cudf::detail::range_comparable_value(range_unbounded), + EXPECT_THROW(cudf::detail::range_comparable_value( + range_unbounded, dtype, cudf::get_default_stream()), cudf::logic_error); } @@ -112,33 +122,42 @@ TYPED_TEST(NumericRangeWindowBoundsTest, BoundsConstruction) using OrderByType = TypeParam; using range_type = cudf::detail::range_type; using rep_type = cudf::detail::range_rep_type; + auto const dtype = cudf::data_type{cudf::type_to_id()}; static_assert(std::is_integral_v); auto range_3 = cudf::range_window_bounds::get(cudf::numeric_scalar{3, true}); EXPECT_FALSE(range_3.is_unbounded() && "range_window_bounds constructed from scalar cannot be unbounded."); - EXPECT_EQ(cudf::detail::range_comparable_value(range_3), rep_type{3}); + EXPECT_EQ( + cudf::detail::range_comparable_value(range_3, dtype, cudf::get_default_stream()), + rep_type{3}); auto range_unbounded = cudf::range_window_bounds::unbounded(cudf::data_type{cudf::type_to_id()}); EXPECT_TRUE(range_unbounded.is_unbounded() && "range_window_bounds::unbounded() must return an unbounded range."); - EXPECT_EQ(cudf::detail::range_comparable_value(range_unbounded), rep_type{}); + EXPECT_EQ(cudf::detail::range_comparable_value( + range_unbounded, dtype, cudf::get_default_stream()), + rep_type{}); } TYPED_TEST(NumericRangeWindowBoundsTest, WrongRangeType) { using OrderByType = TypeParam; + auto const dtype = cudf::data_type{cudf::type_to_id()}; using wrong_range_type = std::conditional_t, int16_t, int32_t>; auto range_3 = cudf::range_window_bounds::get(cudf::numeric_scalar{3, true}); - EXPECT_THROW(cudf::detail::range_comparable_value(range_3), cudf::logic_error); + EXPECT_THROW( + cudf::detail::range_comparable_value(range_3, dtype, cudf::get_default_stream()), + cudf::logic_error); auto range_unbounded = cudf::range_window_bounds::unbounded(cudf::data_type{cudf::type_to_id()}); - EXPECT_THROW(cudf::detail::range_comparable_value(range_unbounded), + EXPECT_THROW(cudf::detail::range_comparable_value( + range_unbounded, dtype, cudf::get_default_stream()), cudf::logic_error); } @@ -150,8 +169,9 @@ TYPED_TEST_SUITE(DecimalRangeBoundsTest, cudf::test::FixedPointTypes); TYPED_TEST(DecimalRangeBoundsTest, BoundsConstruction) { - using DecimalT = TypeParam; - using Rep = cudf::detail::range_rep_type; + using DecimalT = TypeParam; + using Rep = cudf::detail::range_rep_type; + auto const dtype = cudf::data_type{cudf::type_to_id()}; // Interval type must match the decimal type. static_assert(std::is_same_v, DecimalT>); @@ -160,7 +180,9 @@ TYPED_TEST(DecimalRangeBoundsTest, BoundsConstruction) cudf::fixed_point_scalar{Rep{3}, numeric::scale_type{0}}); EXPECT_FALSE(range_3.is_unbounded() && "range_window_bounds constructed from scalar cannot be unbounded."); - EXPECT_EQ(cudf::detail::range_comparable_value(range_3), Rep{3}); + EXPECT_EQ( + cudf::detail::range_comparable_value(range_3, dtype, cudf::get_default_stream()), + Rep{3}); auto const range_unbounded = cudf::range_window_bounds::unbounded(cudf::data_type{cudf::type_to_id()}); @@ -183,8 +205,8 @@ TYPED_TEST(DecimalRangeBoundsTest, Rescale) for (auto const range_scale : {-2, -1, 0, 1, 2}) { auto const decimal_range_bounds = cudf::range_window_bounds::get( cudf::fixed_point_scalar{RepT{20}, numeric::scale_type{range_scale}}); - auto const rescaled_range_rep = - cudf::detail::range_comparable_value(decimal_range_bounds, order_by_data_type); + auto const rescaled_range_rep = cudf::detail::range_comparable_value( + decimal_range_bounds, order_by_data_type, cudf::get_default_stream()); EXPECT_EQ(rescaled_range_rep, RepT{20} * pow10[range_scale - order_by_scale]); } @@ -192,8 +214,8 @@ TYPED_TEST(DecimalRangeBoundsTest, Rescale) { auto const decimal_range_bounds = cudf::range_window_bounds::get( cudf::fixed_point_scalar{RepT{200}, numeric::scale_type{-3}}); - EXPECT_THROW( - cudf::detail::range_comparable_value(decimal_range_bounds, order_by_data_type), - cudf::logic_error); + EXPECT_THROW(cudf::detail::range_comparable_value( + decimal_range_bounds, order_by_data_type, cudf::get_default_stream()), + cudf::logic_error); } }