diff --git a/cpp/src/strings/reverse.cu b/cpp/src/strings/reverse.cu index aecb029f25f..f9aec41b5e3 100644 --- a/cpp/src/strings/reverse.cu +++ b/cpp/src/strings/reverse.cu @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -37,7 +38,7 @@ namespace { */ struct reverse_characters_fn { column_device_view const d_strings; - size_type const* d_offsets; + cudf::detail::input_offsetalator d_offsets; char* d_chars; __device__ void operator()(size_type idx) @@ -62,10 +63,10 @@ std::unique_ptr reverse(strings_column_view const& input, if (input.is_empty()) { return make_empty_column(type_id::STRING); } // copy the column; replace data in the chars column - auto result = std::make_unique(input.parent(), stream, mr); - auto const d_offsets = - result->view().child(strings_column_view::offsets_column_index).data(); - auto d_chars = result->mutable_view().head(); + auto result = std::make_unique(input.parent(), stream, mr); + auto sv = strings_column_view(result->view()); + auto const d_offsets = cudf::detail::offsetalator_factory::make_input_iterator(sv.offsets()); + auto d_chars = result->mutable_view().head(); auto const d_column = column_device_view::create(input.parent(), stream); thrust::for_each_n(rmm::exec_policy(stream),