-
Notifications
You must be signed in to change notification settings - Fork 928
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
Allow cudf::type_to_id<T const>() #17831
base: branch-25.02
Are you sure you want to change the base?
Conversation
Forward-merge branch-25.02 into branch-25.04
Forward-merge branch-25.02 into branch-25.04
Forward-merge branch-25.02 into branch-25.04
Forward-merge branch-25.02 into branch-25.04
Forward-merge branch-25.02 into branch-25.04
Forward-merge branch-25.02 into branch-25.04
Forward-merge branch-25.02 into branch-25.04
Forward-merge branch-25.02 into branch-25.04
/ok to test |
Please wait for CI to pass before merging this! I didn't check it much! |
/ok to test |
/ok to test |
Looks like many compile failures here. Example: https://github.com/rapidsai/cudf/actions/runs/12996716950/job/36246264687?pr=17831#step:8:3511 |
Tests are in this file: cudf/cpp/tests/types/type_dispatcher_test.cu Line 108 in 6dc4a53
|
This completes the migration to NVKS runners now that all libraries have been tested and rapidsai/shared-workflows#273 has been merged. xref: rapidsai/build-infra#184 Authors: - Bradley Dice (https://github.com/bdice) Approvers: - James Lamb (https://github.com/jameslamb) URL: rapidsai#17943
@davidwendt Thanks for the pointer. I've added tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm approving this change, as the code looks fine. However, I think it's worth getting more context on the use cases that this solves and/or how it might affect user expectations of cv-qualified types.
This PR drops cv-qualifiers that the user might expect to carry some kind of meaning (though I feel it is unrealistic to assert any meaning for those qualifiers in the context of a libcudf column). Would users of type_to_id<T>
expect that a column created with type_to_id<const int>
is read-only, for instance? Or some kind of behavior change corresponding to volatile
qualifiers? Today, we fail, and I think that's an acceptable position (we don't have type ids that correspond to cv-qualified types).
Does it make sense for cudf to be responsible for dropping cv-qualifiers in type_to_id<T>
, or should that requirement fall upon the caller of type_to_id
to instead use type_to_id<std::remove_cv_t<T>>
if their type may be cv-qualified?
I could envision this PR being just a docs change to state that type_to_id
requires non-cv-qualified types.
I think this probably falls under Repeating my suggestion to rebase this on branch-25.04 |
@bdice A type id is just a enum value. it's an int. Would would it even mean for an integer literal to be If I write a templated function with type Bikeshed moment here. |
Currently, `cudf::type_to_id<X>` where X is a valid type for converting to a `cudf::id` only works if X is neither `const` nor `volatile`. However, if it has either of those "cv" qualifiers, the function returns `type_id::EMPTY`. With this change, return the correct type id no matter the cv-qualifiers.
/ok to test |
Needs a style fix (and unfortunately not one of the fixes that our PR linter can push an autofix for). Please run pre-commit locally and then push up the changes. |
Also need to rebase upstream. |
Description
Currently,
cudf::type_to_id<X>
where X is a valid type for converting to acudf::id
only works if X is neitherconst
norvolatile
. However, if it has either of those "cv" qualifiers, the function returnstype_id::EMPTY
.With this change, return the correct type id no matter the cv-qualifiers.
Checklist