Change make_strings_children to return uvector#15171
Change make_strings_children to return uvector#15171rapids-bot[bot] merged 4 commits intorapidsai:branch-24.04from
Conversation
PointKernel
left a comment
There was a problem hiding this comment.
Looks great with a non-blocking comment on the function return type.
| // Now build the chars column | ||
| std::unique_ptr<column> chars_column = | ||
| create_chars_child_column(static_cast<size_type>(bytes), stream, mr); | ||
| rmm::device_uvector<char> chars(bytes, stream, mr); |
There was a problem hiding this comment.
Preferably returning a unique pointer of uvector according to the developer guide,
cudf/cpp/doxygen/developer_guide/DEVELOPER_GUIDE.md
Lines 185 to 190 in 63e9040
I also noticed #14202 changed the input argument from unique ptr to rvalue reference for make_strings_column, which makes the ownership information obscure IMO.
| } | ||
|
|
||
| return std::pair(std::move(offsets_column), std::move(chars_column)); | ||
| return std::pair(std::move(offsets_column), std::move(chars)); |
There was a problem hiding this comment.
| return std::pair(std::move(offsets_column), std::move(chars)); | |
| return std::pair(std::move(offsets_column), chars); |
nit: no need to move if it's just a uvector
There was a problem hiding this comment.
Without the std::move the uvector is copied.
https://godbolt.org/z/K1sTfP1na
There was a problem hiding this comment.
I thought copy elision could happen automatically with C++17 based on multiple discussions at our cpp channel and also StackOverflow and then by taking a closer look at your sample code, I realized that returning a pair makes a difference (see here).
|
/merge |
Description
Changes the
cudf::strings::detail::make_strings_childrenutility to return armm::device_uvector<char>instead of a chars column. This further helps enable large strings support by not storing chars in a column.This is an internal utility and so is non-breaking for any public APIs.
Checklist