Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use offsetalator in orc rowgroup_char_counts_kernel #15891

Merged
merged 1 commit into from
May 31, 2024
Merged
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
6 changes: 4 additions & 2 deletions cpp/src/io/orc/dict_enc.cu
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

#include "orc_gpu.hpp"

#include <cudf/detail/offsets_iterator.cuh>
#include <cudf/detail/utilities/integer_utils.hpp>
#include <cudf/io/orc_types.hpp>
#include <cudf/table/experimental/row_operators.cuh>
Expand Down Expand Up @@ -43,11 +44,12 @@ CUDF_KERNEL void rowgroup_char_counts_kernel(device_2dspan<size_type> char_count
auto const start_row = rowgroup_bounds[row_group_idx][col_idx].begin + str_col.offset();
auto const num_rows = rowgroup_bounds[row_group_idx][col_idx].size();

auto const& offsets = str_col.child(strings_column_view::offsets_column_index);
auto const& offsets = str_col.child(strings_column_view::offsets_column_index);
auto const offsets_itr = cudf::detail::input_offsetalator(offsets.head(), offsets.type());
char_counts[str_col_idx][row_group_idx] =
(num_rows == 0)
? 0
: offsets.element<size_type>(start_row + num_rows) - offsets.element<size_type>(start_row);
: static_cast<size_type>(offsets_itr[start_row + num_rows] - offsets_itr[start_row]);
}

void rowgroup_char_counts(device_2dspan<size_type> counts,
Expand Down
Loading