Skip to content

Commit

Permalink
Remove offsets_begin() call from nvtext::generate_ngrams (rapidsai#15077
Browse files Browse the repository at this point in the history
)

Removes call to `strings_column_view::offsets_begin()` call from `nvtext::generate_ngrams()`.
A future PR will deprecate the `offsets_begin()` function which hardcodes to int32 type.

Authors:
  - David Wendt (https://github.com/davidwendt)

Approvers:
  - Bradley Dice (https://github.com/bdice)
  - Mike Wilson (https://github.com/hyperbolic2346)

URL: rapidsai#15077
  • Loading branch information
davidwendt authored Feb 27, 2024
1 parent ef20ef9 commit c32725d
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions cpp/src/text/generate_ngrams.cu
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,8 @@ std::unique_ptr<cudf::column> generate_ngrams(cudf::strings_column_view const& s

// first create a new offsets vector removing nulls and empty strings from the input column
std::unique_ptr<cudf::column> non_empty_offsets_column = [&] {
cudf::column_view offsets_view(cudf::data_type{cudf::type_id::INT32},
strings_count + 1,
strings.offsets_begin(),
nullptr,
0);
cudf::column_view offsets_view(
strings.offsets().type(), strings_count + 1, strings.offsets().head(), nullptr, 0);
auto table_offsets = cudf::detail::copy_if(
cudf::table_view({offsets_view}),
[d_strings, strings_count] __device__(cudf::size_type idx) {
Expand Down

0 comments on commit c32725d

Please sign in to comment.