Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use offsetalator in cudf::strings::reverse #15001

Merged
merged 1 commit into from
Feb 9, 2024

Conversation

davidwendt
Copy link
Contributor

Description

Updates cudf::strings::reverse to use the offsetalator instead of hardcoded int32 type for offsets column data.

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@davidwendt davidwendt added 2 - In Progress Currently a work in progress libcudf Affects libcudf (C++/CUDA) code. strings strings issues (C++ and Python) improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Feb 7, 2024
@davidwendt davidwendt self-assigned this Feb 7, 2024
@davidwendt davidwendt marked this pull request as ready for review February 8, 2024 15:17
@davidwendt davidwendt requested a review from a team as a code owner February 8, 2024 15:17
@davidwendt davidwendt requested review from mythrocks and vuule February 8, 2024 15:17
result->view().child(strings_column_view::offsets_column_index).data<size_type>();
auto d_chars = result->mutable_view().head<char>();
auto result = std::make_unique<column>(input.parent(), stream, mr);
auto sv = strings_column_view(result->view());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could result be const here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we do modify the column, const would be a bit misleading IMO 🤷

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The result should be elided on return which is kind of like a move which changes the object which would be prevented on a const object. I'd rather communicate to the compiler (and the reviewers) that this object is moved and not copied on return. I fear the const declaration would send the wrong hint to the compiler.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, constness does not interfere with the copy elision, e.g. https://godbolt.org/z/TzPjshqrd
We'd need a std::move in the return if the copy elision didn't kick in, since result is not copyable.

I agree that const sends the wrong message regardless.

@davidwendt davidwendt added 3 - Ready for Review Ready for review by team and removed 2 - In Progress Currently a work in progress labels Feb 9, 2024
@davidwendt
Copy link
Contributor Author

/merge

@rapids-bot rapids-bot bot merged commit e596480 into rapidsai:branch-24.04 Feb 9, 2024
69 checks passed
@davidwendt davidwendt deleted the reverse-offsetalator branch February 9, 2024 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 - Ready for Review Ready for review by team improvement Improvement / enhancement to an existing function libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change strings strings issues (C++ and Python)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants