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

Expose reflection to check if casting between two types is supported #16239

Merged
merged 4 commits into from
Jul 11, 2024

Conversation

wence-
Copy link
Contributor

@wence- wence- commented Jul 10, 2024

Description

In cudf-polars we need to check if a cast between two datatypes is supported (and fallback, or generate different code if not).

Let's ask libcudf to be the source of truth for when a cast is supported.

Checklist

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

@github-actions github-actions bot added libcudf Affects libcudf (C++/CUDA) code. Python Affects Python cuDF API. pylibcudf Issues specific to the pylibcudf package labels Jul 10, 2024
@wence- wence- added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Jul 10, 2024
Copy link
Contributor

@bdice bdice left a comment

Choose a reason for hiding this comment

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

Implementation looks good. Having pylibcudf tests would be helpful.

edit: Sorry, this is draft. Maybe I reviewed too early.

python/cudf/cudf/_lib/pylibcudf/unary.pyx Show resolved Hide resolved
@wence- wence- marked this pull request as ready for review July 10, 2024 15:37
@wence- wence- requested review from a team as code owners July 10, 2024 15:37
Copy link
Contributor

@davidwendt davidwendt left a comment

Choose a reason for hiding this comment

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

Approving C++ changes

cpp/src/unary/cast_ops.cu Outdated Show resolved Hide resolved
Copy link
Contributor

@mythrocks mythrocks left a comment

Choose a reason for hiding this comment

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

The C++ portion of this was straightforward enough for me to grasp.

I'm not familiar enough with the Python bit, but from a cursory look, the changes seem to track. Thank you for adding tests for this.

@wence-
Copy link
Contributor Author

wence- commented Jul 11, 2024

/merge

@rapids-bot rapids-bot bot merged commit cd2d53b into rapidsai:branch-24.08 Jul 11, 2024
81 checks passed
@wence- wence- deleted the wence/fea/cast-reflection branch July 11, 2024 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Improvement / enhancement to an existing function libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change pylibcudf Issues specific to the pylibcudf package Python Affects Python cuDF API.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants