diff --git a/cpp/include/cudf/detail/merge.cuh b/cpp/include/cudf/detail/merge.cuh index f141d9b5d59..ee5cb5c265d 100644 --- a/cpp/include/cudf/detail/merge.cuh +++ b/cpp/include/cudf/detail/merge.cuh @@ -80,14 +80,10 @@ struct tagged_element_relational_comparator { __device__ weak_ordering compare(index_type lhs_tagged_index, index_type rhs_tagged_index) const noexcept { - side const l_side = thrust::get<0>(lhs_tagged_index); - side const r_side = thrust::get<0>(rhs_tagged_index); - - cudf::size_type const l_indx = thrust::get<1>(lhs_tagged_index); - cudf::size_type const r_indx = thrust::get<1>(rhs_tagged_index); + auto const [l_side, l_indx] = lhs_tagged_index; + auto const [r_side, r_indx] = rhs_tagged_index; column_device_view const* ptr_left_dview{l_side == side::LEFT ? &lhs : &rhs}; - column_device_view const* ptr_right_dview{r_side == side::LEFT ? &lhs : &rhs}; auto erl_comparator = element_relational_comparator( diff --git a/cpp/include/cudf/strings/detail/merge.cuh b/cpp/include/cudf/strings/detail/merge.cuh index a132d8c7229..dba1c24be93 100644 --- a/cpp/include/cudf/strings/detail/merge.cuh +++ b/cpp/include/cudf/strings/detail/merge.cuh @@ -68,8 +68,7 @@ std::unique_ptr merge(strings_column_view const& lhs, // build offsets column auto offsets_transformer = [d_lhs, d_rhs] __device__(auto index_pair) { - auto side = thrust::get<0>(index_pair); - auto index = thrust::get<1>(index_pair); + auto const [side, index] = index_pair; if (side == side::LEFT ? d_lhs.is_null(index) : d_rhs.is_null(index)) return 0; auto d_str = side == side::LEFT ? d_lhs.element(index) : d_rhs.element(index); @@ -90,9 +89,7 @@ std::unique_ptr merge(strings_column_view const& lhs, thrust::make_counting_iterator(0), strings_count, [d_lhs, d_rhs, begin, d_offsets, d_chars] __device__(size_type idx) { - index_type index_pair = begin[idx]; - auto side = thrust::get<0>(index_pair); - auto index = thrust::get<1>(index_pair); + auto const [side, index] = begin[idx]; if (side == side::LEFT ? d_lhs.is_null(index) : d_rhs.is_null(index)) return; auto d_str = side == side::LEFT ? d_lhs.element(index) : d_rhs.element(index); diff --git a/cpp/src/dictionary/detail/merge.cu b/cpp/src/dictionary/detail/merge.cu index e972403cad3..a194f4add2e 100644 --- a/cpp/src/dictionary/detail/merge.cu +++ b/cpp/src/dictionary/detail/merge.cu @@ -53,10 +53,8 @@ std::unique_ptr merge(dictionary_column_view const& lcol, row_order.end(), output_iter, [lcol_iter, rcol_iter] __device__(auto const& index_pair) { - auto index = thrust::get<1>(index_pair); - return (thrust::get<0>(index_pair) == cudf::detail::side::LEFT - ? lcol_iter[index] - : rcol_iter[index]); + auto const [side, index] = index_pair; + return side == cudf::detail::side::LEFT ? lcol_iter[index] : rcol_iter[index]; }); // build dictionary; the validity mask is updated by the caller diff --git a/cpp/src/merge/merge.cu b/cpp/src/merge/merge.cu index f7e9b114f7b..ff9401022b2 100644 --- a/cpp/src/merge/merge.cu +++ b/cpp/src/merge/merge.cu @@ -80,9 +80,7 @@ __global__ void materialize_merged_bitmask_kernel( auto active_threads = __ballot_sync(0xffffffff, destination_row < num_destination_rows); while (destination_row < num_destination_rows) { - index_type const& merged_idx = merged_indices[destination_row]; - side const src_side = thrust::get<0>(merged_idx); - size_type const src_row = thrust::get<1>(merged_idx); + auto const [src_side, src_row] = merged_indices[destination_row]; bool const from_left{src_side == side::LEFT}; bool source_bit_is_valid{true}; if (left_have_valids && from_left) { @@ -284,8 +282,7 @@ struct column_merger { row_order_.end(), merged_view.begin(), [d_lcol, d_rcol] __device__(index_type const& index_pair) { - auto side = thrust::get<0>(index_pair); - auto index = thrust::get<1>(index_pair); + auto const [side, index] = index_pair; return side == side::LEFT ? d_lcol[index] : d_rcol[index]; }); diff --git a/cpp/tests/copying/sample_tests.cpp b/cpp/tests/copying/sample_tests.cpp index 4da1b541a65..8cb2b9ce74e 100644 --- a/cpp/tests/copying/sample_tests.cpp +++ b/cpp/tests/copying/sample_tests.cpp @@ -89,9 +89,8 @@ struct SampleBasicTest : public SampleTest, TEST_P(SampleBasicTest, CombinationOfParameters) { - cudf::size_type const table_size = 1024; - cudf::size_type const n_samples = std::get<0>(GetParam()); - cudf::sample_with_replacement multi_smpl = std::get<1>(GetParam()); + cudf::size_type const table_size = 1024; + auto const [n_samples, multi_smpl] = GetParam(); auto data = cudf::detail::make_counting_transform_iterator(0, [](auto i) { return i; }); cudf::test::fixed_width_column_wrapper col1(data, data + table_size); diff --git a/cpp/tests/interop/from_arrow_test.cpp b/cpp/tests/interop/from_arrow_test.cpp index 52d5da8f6e5..946ac7fc891 100644 --- a/cpp/tests/interop/from_arrow_test.cpp +++ b/cpp/tests/interop/from_arrow_test.cpp @@ -333,11 +333,10 @@ struct FromArrowTestSlice TEST_P(FromArrowTestSlice, SliceTest) { - auto tables = get_tables(10000); - auto cudf_table_view = tables.first->view(); - auto arrow_table = tables.second; - auto start = std::get<0>(GetParam()); - auto end = std::get<1>(GetParam()); + auto tables = get_tables(10000); + auto cudf_table_view = tables.first->view(); + auto arrow_table = tables.second; + auto const [start, end] = GetParam(); auto sliced_cudf_table = cudf::slice(cudf_table_view, {start, end})[0]; auto expected_cudf_table = cudf::table{sliced_cudf_table}; diff --git a/cpp/tests/interop/to_arrow_test.cpp b/cpp/tests/interop/to_arrow_test.cpp index 9ad546d3e01..98031f42a9c 100644 --- a/cpp/tests/interop/to_arrow_test.cpp +++ b/cpp/tests/interop/to_arrow_test.cpp @@ -488,11 +488,10 @@ struct ToArrowTestSlice TEST_P(ToArrowTestSlice, SliceTest) { - auto tables = get_tables(10000); - auto cudf_table_view = tables.first->view(); - auto arrow_table = tables.second; - auto start = std::get<0>(GetParam()); - auto end = std::get<1>(GetParam()); + auto tables = get_tables(10000); + auto cudf_table_view = tables.first->view(); + auto arrow_table = tables.second; + auto const [start, end] = GetParam(); auto sliced_cudf_table = cudf::slice(cudf_table_view, {start, end})[0]; auto expected_arrow_table = arrow_table->Slice(start, end - start); diff --git a/cpp/tests/io/orc_test.cpp b/cpp/tests/io/orc_test.cpp index 574ce8573e9..656c72ef02f 100644 --- a/cpp/tests/io/orc_test.cpp +++ b/cpp/tests/io/orc_test.cpp @@ -1137,8 +1137,7 @@ struct OrcWriterTestDecimal : public OrcWriterTest, TEST_P(OrcWriterTestDecimal, Decimal64) { - auto const num_rows = std::get<0>(GetParam()); - auto const scale = std::get<1>(GetParam()); + auto const [num_rows, scale] = GetParam(); // Using int16_t because scale causes values to overflow if they already require 32 bits auto const vals = random_values(num_rows); @@ -1241,9 +1240,8 @@ struct OrcWriterTestStripes TEST_P(OrcWriterTestStripes, StripeSize) { - constexpr auto num_rows = 1000000; - auto size_bytes = std::get<0>(GetParam()); - auto size_rows = std::get<1>(GetParam()); + constexpr auto num_rows = 1000000; + auto const [size_bytes, size_rows] = GetParam(); const auto seq_col = random_values(num_rows); const auto validity = diff --git a/cpp/tests/transform/mask_to_bools_test.cpp b/cpp/tests/transform/mask_to_bools_test.cpp index 2a759ffcfe5..02057fc3f3a 100644 --- a/cpp/tests/transform/mask_to_bools_test.cpp +++ b/cpp/tests/transform/mask_to_bools_test.cpp @@ -56,8 +56,7 @@ struct MaskToBoolsTest TEST_P(MaskToBoolsTest, LargeDataSizeTest) { auto data = std::vector(10000); - cudf::size_type const begin_bit = std::get<0>(GetParam()); - cudf::size_type const end_bit = std::get<1>(GetParam()); + auto const [begin_bit, end_bit] = GetParam(); std::transform(data.cbegin(), data.cend(), data.begin(), [](auto val) { return rand() % 2 == 0 ? true : false; });