Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 9 additions & 17 deletions cpp/benchmarks/lists/copying/scatter_lists.cu
Original file line number Diff line number Diff line change
@@ -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
*/

Expand Down Expand Up @@ -50,27 +50,19 @@ static void bench_scatter_lists(nvbench::state& state, nvbench::type_list<TypePa
target_base_col->mutable_view().begin<TypeParam>(),
target_base_col->mutable_view().end<TypeParam>());

auto source_offsets =
make_fixed_width_column(cudf::data_type{cudf::type_to_id<cudf::size_type>()},
num_rows + 1,
cudf::mask_state::UNALLOCATED,
stream,
mr);
auto target_offsets =
make_fixed_width_column(cudf::data_type{cudf::type_to_id<cudf::size_type>()},
num_rows + 1,
cudf::mask_state::UNALLOCATED,
stream,
mr);
auto source_offsets = make_fixed_width_column(
cudf::data_type{cudf::type_id::INT32}, num_rows + 1, cudf::mask_state::UNALLOCATED, stream, mr);
auto target_offsets = make_fixed_width_column(
cudf::data_type{cudf::type_id::INT32}, num_rows + 1, cudf::mask_state::UNALLOCATED, stream, mr);

thrust::sequence(rmm::exec_policy_nosync(stream),
source_offsets->mutable_view().begin<cudf::size_type>(),
source_offsets->mutable_view().end<cudf::size_type>(),
source_offsets->mutable_view().begin<int32_t>(),
source_offsets->mutable_view().end<int32_t>(),
0,
num_elements_per_row);
thrust::sequence(rmm::exec_policy_nosync(stream),
target_offsets->mutable_view().begin<cudf::size_type>(),
target_offsets->mutable_view().end<cudf::size_type>(),
target_offsets->mutable_view().begin<int32_t>(),
target_offsets->mutable_view().end<int32_t>(),
0,
num_elements_per_row);

Expand Down
8 changes: 4 additions & 4 deletions cpp/tests/copying/concatenate_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ TEST_F(OverflowTest, OverflowTest)
constexpr auto size = static_cast<cudf::size_type>(static_cast<uint32_t>(1024) * 1024 * 1024);

// try and concatenate 6 string columns of with 1 billion chars in each
auto offsets = cudf::test::fixed_width_column_wrapper<cudf::size_type>{0, size};
auto offsets = cudf::test::fixed_width_column_wrapper<int32_t>{0, size};
auto many_chars = rmm::device_uvector<char>(size, cudf::get_default_stream());
auto col = cudf::make_strings_column(
1, offsets.release(), many_chars.release(), 0, rmm::device_buffer{});
Expand Down Expand Up @@ -422,7 +422,7 @@ TEST_F(OverflowTest, OverflowTest)
cudf::make_structs_column(inner_size, std::move(children), 0, rmm::device_buffer{});

// list
auto offsets = cudf::test::fixed_width_column_wrapper<cudf::size_type>{0, inner_size};
auto offsets = cudf::test::fixed_width_column_wrapper<int32_t>{0, inner_size};
auto col =
cudf::make_lists_column(1, offsets.release(), std::move(struct_col), 0, rmm::device_buffer{});

Expand All @@ -439,7 +439,7 @@ TEST_F(OverflowTest, OverflowTest)
constexpr cudf::size_type size = 3;

// list
auto offsets = cudf::test::fixed_width_column_wrapper<cudf::size_type>{0, 0, 0, inner_size};
auto offsets = cudf::test::fixed_width_column_wrapper<int32_t>{0, 0, 0, inner_size};
auto many_chars =
cudf::make_fixed_width_column(cudf::data_type{cudf::type_id::INT8}, inner_size);
auto list_col =
Expand Down Expand Up @@ -645,7 +645,7 @@ TEST_F(OverflowTest, Presliced)
constexpr cudf::size_type list_size = inner_size / num_rows;

// list
auto offsets = cudf::test::fixed_width_column_wrapper<cudf::size_type>{
auto offsets = cudf::test::fixed_width_column_wrapper<int32_t>{
0, list_size, (list_size * 2) - 1, list_size * 3, inner_size};
auto many_chars =
cudf::make_fixed_width_column(cudf::data_type{cudf::type_id::INT8}, inner_size);
Expand Down
13 changes: 6 additions & 7 deletions cpp/tests/copying/get_value_tests.cpp
Original file line number Diff line number Diff line change
@@ -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
*/

Expand Down Expand Up @@ -883,12 +883,11 @@ TEST_F(StructGetValueTest, multi_level_nested)
// col fields
LCW l3({LCW{1, 1, 1}, LCW{2, 2}, LCW{3}}, validity_mask_t{false, true, true}.begin());
cudf::test::structs_column_wrapper l2{l3};
auto l1 =
cudf::make_lists_column(1,
cudf::test::fixed_width_column_wrapper<cudf::size_type>{0, 3}.release(),
l2.release(),
0,
cudf::create_null_mask(1, cudf::mask_state::UNALLOCATED));
auto l1 = cudf::make_lists_column(1,
cudf::test::fixed_width_column_wrapper<int32_t>{0, 3}.release(),
l2.release(),
0,
cudf::create_null_mask(1, cudf::mask_state::UNALLOCATED));
std::vector<std::unique_ptr<cudf::column>> l0_fields;
l0_fields.emplace_back(std::move(l1));
cudf::test::structs_column_wrapper l0(std::move(l0_fields));
Expand Down
84 changes: 42 additions & 42 deletions cpp/tests/copying/scatter_list_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ TYPED_TEST(TypedScatterListsTest, EmptyListsOfFixedWidth)
};

// One null list row, and one row with nulls.
auto src_list_column = cudf::make_lists_column(
3,
cudf::test::fixed_width_column_wrapper<cudf::size_type>{0, 4, 7, 7}.release(),
src_child.release(),
0,
{});
auto src_list_column =
cudf::make_lists_column(3,
cudf::test::fixed_width_column_wrapper<int32_t>{0, 4, 7, 7}.release(),
src_child.release(),
0,
{});

auto target_list_column = cudf::test::lists_column_wrapper<T, int32_t>{
{0, 0}, {1, 1}, {2, 2}, {3, 3}, {4, 4}, {5, 5}, {6, 6}};
Expand All @@ -104,7 +104,7 @@ TYPED_TEST(TypedScatterListsTest, EmptyListsOfFixedWidth)
{8, 8, 8, 1, 1, 9, 9, 9, 9, 3, 3, 4, 4, 6, 6}};
auto expected_lists_column = cudf::make_lists_column(
7,
cudf::test::fixed_width_column_wrapper<cudf::size_type>{0, 3, 5, 9, 11, 13, 13, 15}.release(),
cudf::test::fixed_width_column_wrapper<int32_t>{0, 3, 5, 9, 11, 13, 13, 15}.release(),
expected_child_ints.release(),
0,
{});
Expand All @@ -120,12 +120,12 @@ TYPED_TEST(TypedScatterListsTest, EmptyListsOfNullableFixedWidth)
{1, 1, 1, 0, 1, 1, 1}};

// One null list row, and one row with nulls.
auto src_list_column = cudf::make_lists_column(
3,
cudf::test::fixed_width_column_wrapper<cudf::size_type>{0, 4, 7, 7}.release(),
src_child.release(),
0,
{});
auto src_list_column =
cudf::make_lists_column(3,
cudf::test::fixed_width_column_wrapper<int32_t>{0, 4, 7, 7}.release(),
src_child.release(),
0,
{});

auto target_list_column = cudf::test::lists_column_wrapper<T, int32_t>{
{0, 0}, {1, 1}, {2, 2}, {3, 3}, {4, 4}, {5, 5}, {6, 6}};
Expand All @@ -140,7 +140,7 @@ TYPED_TEST(TypedScatterListsTest, EmptyListsOfNullableFixedWidth)
{8, 8, 8, 1, 1, 9, 9, 9, 9, 3, 3, 4, 4, 6, 6}, {1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1}};
auto expected_lists_column = cudf::make_lists_column(
7,
cudf::test::fixed_width_column_wrapper<cudf::size_type>{0, 3, 5, 9, 11, 13, 13, 15}.release(),
cudf::test::fixed_width_column_wrapper<int32_t>{0, 3, 5, 9, 11, 13, 13, 15}.release(),
expected_child_ints.release(),
0,
{});
Expand All @@ -159,12 +159,12 @@ TYPED_TEST(TypedScatterListsTest, NullableListsOfNullableFixedWidth)
auto [null_mask, null_count] =
cudf::test::detail::make_null_mask(src_list_validity, src_list_validity + 3);
// One null list row, and one row with nulls.
auto src_list_column = cudf::make_lists_column(
3,
cudf::test::fixed_width_column_wrapper<cudf::size_type>{0, 4, 7, 7}.release(),
src_child.release(),
null_count,
std::move(null_mask));
auto src_list_column =
cudf::make_lists_column(3,
cudf::test::fixed_width_column_wrapper<int32_t>{0, 4, 7, 7}.release(),
src_child.release(),
null_count,
std::move(null_mask));

auto target_list_column = cudf::test::lists_column_wrapper<T, int32_t>{
{0, 0}, {1, 1}, {2, 2}, {3, 3}, {4, 4}, {5, 5}, {6, 6}};
Expand All @@ -183,7 +183,7 @@ TYPED_TEST(TypedScatterListsTest, NullableListsOfNullableFixedWidth)
cudf::test::detail::make_null_mask(expected_validity, expected_validity + 7);
auto expected_lists_column = cudf::make_lists_column(
7,
cudf::test::fixed_width_column_wrapper<cudf::size_type>{0, 3, 5, 9, 11, 13, 13, 15}.release(),
cudf::test::fixed_width_column_wrapper<int32_t>{0, 3, 5, 9, 11, 13, 13, 15}.release(),
expected_child_ints.release(),
null_count,
std::move(null_mask));
Expand Down Expand Up @@ -223,12 +223,12 @@ TEST_F(ScatterListsTest, ListsOfNullableStrings)
cudf::test::strings_column_wrapper{{"all", "the", "leaves", "", "brown", "", "dreaming"},
{true, true, true, false, true, false, true}};

auto src_list_column = cudf::make_lists_column(
2,
cudf::test::fixed_width_column_wrapper<cudf::size_type>{0, 5, 7}.release(),
src_strings_column.release(),
0,
{});
auto src_list_column =
cudf::make_lists_column(2,
cudf::test::fixed_width_column_wrapper<int32_t>{0, 5, 7}.release(),
src_strings_column.release(),
0,
{});

auto target_list_column = cudf::test::lists_column_wrapper<cudf::string_view>{{"zero"},
{"one", "one"},
Expand Down Expand Up @@ -263,7 +263,7 @@ TEST_F(ScatterListsTest, ListsOfNullableStrings)

auto expected_lists = cudf::make_lists_column(
6,
cudf::test::fixed_width_column_wrapper<cudf::size_type>{0, 2, 4, 9, 11, 13, 15}.release(),
cudf::test::fixed_width_column_wrapper<int32_t>{0, 2, 4, 9, 11, 13, 15}.release(),
expected_strings.release(),
0,
{});
Expand All @@ -277,12 +277,12 @@ TEST_F(ScatterListsTest, EmptyListsOfNullableStrings)
cudf::test::strings_column_wrapper{{"all", "the", "leaves", "", "brown", "", "dreaming"},
{true, true, true, false, true, false, true}};

auto src_list_column = cudf::make_lists_column(
3,
cudf::test::fixed_width_column_wrapper<cudf::size_type>{0, 5, 5, 7}.release(),
src_strings_column.release(),
0,
{});
auto src_list_column =
cudf::make_lists_column(3,
cudf::test::fixed_width_column_wrapper<int32_t>{0, 5, 5, 7}.release(),
src_strings_column.release(),
0,
{});

auto target_list_column = cudf::test::lists_column_wrapper<cudf::string_view>{{"zero"},
{"one", "one"},
Expand Down Expand Up @@ -315,7 +315,7 @@ TEST_F(ScatterListsTest, EmptyListsOfNullableStrings)

auto expected_lists = cudf::make_lists_column(
6,
cudf::test::fixed_width_column_wrapper<cudf::size_type>{0, 2, 4, 9, 11, 11, 13}.release(),
cudf::test::fixed_width_column_wrapper<int32_t>{0, 2, 4, 9, 11, 11, 13}.release(),
expected_strings.release(),
0,
{});
Expand All @@ -331,12 +331,12 @@ TEST_F(ScatterListsTest, NullableListsOfNullableStrings)

auto src_validity = cudf::test::iterators::null_at(1);
auto [null_mask, null_count] = cudf::test::detail::make_null_mask(src_validity, src_validity + 3);
auto src_list_column = cudf::make_lists_column(
3,
cudf::test::fixed_width_column_wrapper<cudf::size_type>{0, 5, 5, 7}.release(),
src_strings_column.release(),
null_count,
std::move(null_mask));
auto src_list_column =
cudf::make_lists_column(3,
cudf::test::fixed_width_column_wrapper<int32_t>{0, 5, 5, 7}.release(),
src_strings_column.release(),
null_count,
std::move(null_mask));

auto target_list_column = cudf::test::lists_column_wrapper<cudf::string_view>{{"zero"},
{"one", "one"},
Expand Down Expand Up @@ -372,7 +372,7 @@ TEST_F(ScatterListsTest, NullableListsOfNullableStrings)
cudf::test::detail::make_null_mask(expected_validity, expected_validity + 6);
auto expected_lists = cudf::make_lists_column(
6,
cudf::test::fixed_width_column_wrapper<cudf::size_type>{0, 2, 4, 9, 11, 11, 13}.release(),
cudf::test::fixed_width_column_wrapper<int32_t>{0, 2, 4, 9, 11, 11, 13}.release(),
expected_strings.release(),
null_count,
std::move(null_mask));
Expand Down
26 changes: 7 additions & 19 deletions cpp/tests/groupby/collect_list_tests.cpp
Original file line number Diff line number Diff line change
@@ -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
*/

Expand Down Expand Up @@ -162,30 +162,18 @@ TYPED_TEST(groupby_collect_list_test, CollectOnEmptyInputListsOfStructs)
auto struct_child = LCW{};
auto struct_column = cudf::test::structs_column_wrapper{{struct_child}};

auto values =
cudf::make_lists_column(0,
cudf::make_empty_column(cudf::type_to_id<cudf::size_type>()),
struct_column.release(),
0,
{});
auto values = cudf::make_lists_column(
0, cudf::make_empty_column(cudf::type_id::INT32), struct_column.release(), 0, {});

cudf::test::fixed_width_column_wrapper<K, int32_t> expect_keys{};

auto expect_struct_child = LCW{};
auto expect_struct_column = cudf::test::structs_column_wrapper{{expect_struct_child}};

auto expect_child =
cudf::make_lists_column(0,
cudf::make_empty_column(cudf::type_to_id<cudf::size_type>()),
expect_struct_column.release(),
0,
{});
auto expect_values =
cudf::make_lists_column(0,
cudf::make_empty_column(cudf::type_to_id<cudf::size_type>()),
std::move(expect_child),
0,
{});
auto expect_child = cudf::make_lists_column(
0, cudf::make_empty_column(cudf::type_id::INT32), expect_struct_column.release(), 0, {});
auto expect_values = cudf::make_lists_column(
0, cudf::make_empty_column(cudf::type_id::INT32), std::move(expect_child), 0, {});

auto agg = cudf::make_collect_list_aggregation<cudf::groupby_aggregation>();
test_single_agg(keys, values->view(), expect_keys, expect_values->view(), std::move(agg));
Expand Down
8 changes: 4 additions & 4 deletions cpp/tests/hashing/murmurhash3_x86_32_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ TEST_F(MurmurHashTest, ListOfStruct)
true,
true}};

auto offsets = cudf::test::fixed_width_column_wrapper<cudf::size_type>{
auto offsets = cudf::test::fixed_width_column_wrapper<int32_t>{
0, 0, 0, 0, 0, 2, 3, 4, 5, 6, 8, 10, 12, 14, 15, 16, 17, 18};

auto list_nullmask = std::vector<bool>{true,
Expand Down Expand Up @@ -343,8 +343,8 @@ TEST_F(MurmurHashTest, ListOfEmptyStruct)
cudf::test::detail::make_null_mask(struct_validity.begin(), struct_validity.end());
auto struct_col = cudf::make_structs_column(14, {}, null_count, std::move(null_mask));

auto offsets = cudf::test::fixed_width_column_wrapper<cudf::size_type>{
0, 0, 0, 0, 0, 2, 4, 6, 7, 8, 9, 10, 12, 14};
auto offsets =
cudf::test::fixed_width_column_wrapper<int32_t>{0, 0, 0, 0, 0, 2, 4, 6, 7, 8, 9, 10, 12, 14};
auto list_nullmask = std::vector<bool>{
true, true, false, false, true, true, true, true, true, true, true, true, true};
std::tie(null_mask, null_count) =
Expand Down Expand Up @@ -381,7 +381,7 @@ TEST_F(MurmurHashTest, EmptyDeepList)
// Internal empty list
auto list1 = cudf::test::lists_column_wrapper<int>{};

auto offsets = cudf::test::fixed_width_column_wrapper<cudf::size_type>{0, 0, 0, 0, 0};
auto offsets = cudf::test::fixed_width_column_wrapper<int32_t>{0, 0, 0, 0, 0};
auto list_nullmask = std::vector<bool>{true, true, false, false};
auto [null_mask, null_count] =
cudf::test::detail::make_null_mask(list_nullmask.begin(), list_nullmask.end());
Expand Down
Loading
Loading