From c450a4dd6e0f9a6b7d0097ccee68db3f60cc49e5 Mon Sep 17 00:00:00 2001 From: David Wendt Date: Mon, 6 May 2024 13:09:43 -0400 Subject: [PATCH] Use experimental make_strings_children for multi-replace_re --- cpp/src/strings/replace/multi_re.cu | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/cpp/src/strings/replace/multi_re.cu b/cpp/src/strings/replace/multi_re.cu index 5172dba3fc3..b9a3acf747f 100644 --- a/cpp/src/strings/replace/multi_re.cu +++ b/cpp/src/strings/replace/multi_re.cu @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include #include @@ -56,13 +56,14 @@ struct replace_multi_regex_fn { device_span progs; // array of regex progs found_range* d_found_ranges; // working array matched (begin,end) values column_device_view const d_repls; // replacement strings - size_type* d_offsets{}; + size_type* d_sizes{}; char* d_chars{}; + cudf::detail::input_offsetalator d_offsets; __device__ void operator()(size_type idx) { if (d_strings.is_null(idx)) { - if (!d_chars) d_offsets[idx] = 0; + if (!d_chars) { d_sizes[idx] = 0; } return; } @@ -129,7 +130,7 @@ struct replace_multi_regex_fn { d_str.size_bytes() - last_pos.byte_offset(), out_ptr); } else { - d_offsets[idx] = nbytes; + d_sizes[idx] = nbytes; } } }; @@ -186,7 +187,7 @@ std::unique_ptr replace_re(strings_column_view const& input, auto found_ranges = rmm::device_uvector(d_progs.size() * input.size(), stream); - auto [offsets_column, chars] = make_strings_children( + auto [offsets_column, chars] = experimental::make_strings_children( replace_multi_regex_fn{*d_strings, d_progs, found_ranges.data(), *d_repls}, input.size(), stream,