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

Add move_to function to cudf::string_view iterator #13369

Closed

Conversation

davidwendt
Copy link
Contributor

Description

Adds a move_to() function the cudf::string_view::const_iterator class to help minimize character counting when creating and incrementing the iterator on multi-byte UTF8 characters.
The function simply moves the iterator from the current character position to the given one. This is just a shortcut for the form

itr += (new_position - itr.position());

This pattern is repeated many times in #13322 and likely future PRs that require the same behavior.
The PR also includes an update to the string_view::begin() to set the byte-offset directly rather than waste instructions calculating it.

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 May 17, 2023
@davidwendt davidwendt self-assigned this May 18, 2023
@github-actions github-actions bot added ci CMake CMake build issue Java Affects Java cuDF API. Python Affects Python cuDF API. labels May 24, 2023
@davidwendt davidwendt changed the base branch from branch-23.06 to branch-23.08 May 24, 2023 12:39
@github-actions github-actions bot removed CMake CMake build issue Java Affects Java cuDF API. Python Affects Python cuDF API. ci labels May 24, 2023
@davidwendt
Copy link
Contributor Author

Messed up moving this to 23.08 so closing this one and re-opening as #13428

@davidwendt davidwendt closed this May 24, 2023
@davidwendt davidwendt deleted the string-iterator-move-to branch May 24, 2023 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 - In Progress Currently a work in progress 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.

1 participant