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
17 changes: 11 additions & 6 deletions cpp/src/lists/combine/concatenate_rows.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 All @@ -10,6 +10,7 @@
#include <cudf/detail/gather.cuh>
#include <cudf/detail/iterator.cuh>
#include <cudf/detail/nvtx/ranges.hpp>
#include <cudf/detail/sizes_to_offsets_iterator.cuh>
#include <cudf/lists/combine.hpp>
#include <cudf/utilities/default_stream.hpp>
#include <cudf/utilities/error.hpp>
Expand Down Expand Up @@ -110,11 +111,15 @@ generate_regrouped_offsets_and_null_mask(table_device_view const& input,
stream);

// convert to offsets
thrust::exclusive_scan(rmm::exec_policy_nosync(stream, cudf::get_current_device_resource_ref()),
offsets->view().begin<size_type>(),
offsets->view().begin<size_type>() + input.num_rows() + 1,
offsets->mutable_view().begin<size_type>(),
0);
auto total_size =
cudf::detail::sizes_to_offsets(offsets->view().begin<size_type>(),
offsets->view().begin<size_type>() + input.num_rows() + 1,
offsets->mutable_view().begin<size_type>(),
0,
stream);
CUDF_EXPECTS(total_size <= static_cast<decltype(total_size)>(std::numeric_limits<int32_t>::max()),
"Size of offsets exceeds maximum int32 limit",
std::overflow_error);

// generate appropriate null mask
auto [null_mask, null_count] = [&]() {
Expand Down
11 changes: 6 additions & 5 deletions cpp/src/lists/interleave_columns.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 @@ -76,10 +76,11 @@ generate_list_offsets_and_validities(table_view const& input,
}));

// Compute offsets from sizes.
thrust::exclusive_scan(rmm::exec_policy_nosync(stream, cudf::get_current_device_resource_ref()),
d_offsets,
d_offsets + num_output_lists + 1,
d_offsets);
auto total_size = cudf::detail::sizes_to_offsets(
d_offsets, d_offsets + num_output_lists + 1, d_offsets, 0, stream);
CUDF_EXPECTS(total_size <= static_cast<decltype(total_size)>(std::numeric_limits<int32_t>::max()),
"Size of offsets exceeds maximum int32 limit",
std::overflow_error);

return {std::move(list_offsets), std::move(validities)};
}
Expand Down
Loading