Skip to content

Commit

Permalink
Use offsetalator in cudf::interleave_columns() (#15004)
Browse files Browse the repository at this point in the history
Updates `cudf::interleave_columns()` to use the new `make_offsets_child_column` utility and the offsetalator to build the output strings column.

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

Approvers:
  - Nghia Truong (https://github.com/ttnghia)
  - Vukasin Milovanovic (https://github.com/vuule)

URL: #15004
  • Loading branch information
davidwendt authored Feb 14, 2024
1 parent 3547d41 commit dd131dc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cpp/src/reshape/interleave_columns.cu
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <cudf/copying.hpp>
#include <cudf/detail/copy.hpp>
#include <cudf/detail/nvtx/ranges.hpp>
#include <cudf/detail/offsets_iterator_factory.cuh>
#include <cudf/detail/reshape.hpp>
#include <cudf/detail/valid_if.cuh>
#include <cudf/lists/detail/interleave_columns.hpp>
Expand Down Expand Up @@ -188,9 +189,10 @@ struct interleave_columns_impl<T, std::enable_if_t<std::is_same_v<T, cudf::strin
});
auto offsets_transformer_itr = thrust::make_transform_iterator(
thrust::make_counting_iterator<size_type>(0), offsets_transformer);
auto [offsets_column, bytes] = cudf::detail::make_offsets_child_column(
auto [offsets_column, bytes] = cudf::strings::detail::make_offsets_child_column(
offsets_transformer_itr, offsets_transformer_itr + num_strings, stream, mr);
auto d_results_offsets = offsets_column->view().template data<int32_t>();
auto d_results_offsets =
cudf::detail::offsetalator_factory::make_input_iterator(offsets_column->view());

// Create the chars column
rmm::device_uvector<char> chars(bytes, stream, mr);
Expand Down

0 comments on commit dd131dc

Please sign in to comment.