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

Refactor math_ops.cu dispatcher logic #18006

Open
wants to merge 4 commits into
base: branch-25.04
Choose a base branch
from

Conversation

davidwendt
Copy link
Contributor

Description

Refactors the type-dispatcher logic and cleans up the code in math_ops.cu for unary operations.
The 3 of the 4 dispatch functors had the same logic except for the supported types SFINAE clause.
Also correcting the code for handling RINT properly created a 4th common functor.
These have been refactored into a single functor and separated from the supported-types checks.
The single functor now excepts the transform function as well as the supported-types expression.
Also, the 2nd dispatcher call for dictionary was replaced with an if-statement to help simplify the code and minimize maintenance syncing up the supported-types clauses correctly.

One side effect is that more ops are now supported appropriately with dictionary types.

Referenced cleanup needed here: #17560 (comment)

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 3 - Ready for Review Ready for review by team libcudf Affects libcudf (C++/CUDA) code. improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Feb 13, 2025
@davidwendt davidwendt self-assigned this Feb 13, 2025
@davidwendt davidwendt requested a review from a team as a code owner February 13, 2025 19:42
@davidwendt davidwendt requested review from shrshi and vuule February 13, 2025 19:42
Copy link
Contributor

@Matt711 Matt711 left a comment

Choose a reason for hiding this comment

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

FWIW changes look good.

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants