-
Notifications
You must be signed in to change notification settings - Fork 962
Use cuda::std:: traits and utilities for AST operators #19179
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
Merged
rapids-bot
merged 7 commits into
rapidsai:branch-25.08
from
PointKernel:cccl-ast-operators
Jun 24, 2025
Merged
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
d5bce56
Use CCCL traits and utilities for AST operators
PointKernel 0656507
Merge remote-tracking branch 'upstream/branch-25.08' into cccl-ast-op…
PointKernel 6f75170
Move AST host APIs to a cpp header
PointKernel 13198bd
Update copyright
PointKernel c147017
Cleanups
PointKernel bebe336
Merge remote-tracking branch 'upstream/branch-25.08' into cccl-ast-op…
PointKernel a5a2098
Merge branch 'branch-25.08' into cccl-ast-operators
PointKernel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
240 changes: 119 additions & 121 deletions
240
cpp/include/cudf/ast/detail/operators.hpp → cpp/include/cudf/ast/detail/operators.cuh
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
Does this need to be a
.cuh
? See rules in developer guide. This is primarily__device__
functions, so I can see the argument, but I believeCUDF_HOST_DEVICE
is meant to be usable by host compilers too.Uh oh!
There was an error while loading. Please reload this page.
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 not sure
CUDF_HOST_DEVICE
was ever meant to support host-only compilers. I had assumed it was just a temporary workaround from when CCCL wasn’t mature, and we had to rely on relaxed constexpr to use STL utilities on device. Back then, we didn’t really try to separate host and device usage because we didn’t have the option. Also, since CUDA rdc is disabled in libcudf, device function definitions can't be separated from declarations. If they contain host-device code, even headers ending in.hpp
have likely always been compiled with nvcc.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.
Many of the pieces like
ast_operator_dispatcher
,ast_operator_return_type
,ast_operator_arity
, etc. are meant to be usable in host-only code, that's how we build up the AST program.Uh oh!
There was an error while loading. Please reload this page.
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.
Let me move
ast_operator_return_type
andast_operator_arity
tooperators.hpp
. As forast_operator_dispatcher
, it seems that it's used in both host and device code so I will will probably leave it in the.cuh
?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.
Counterpoint: Given that the
operator()()
s run in a__device__
context, it appears that there isn't any getting aroundnvcc
having to process this file. Wouldn't switching it to a.hpp
then at best match the current compile time?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.
To be clear, CUDF_HOST_DEVICE does not rely on relaxed constexpr. The whole point of specifying CUDF_HOST_DEVICE is so that we get valid host and device callables for those functions without any UB around constexpr functions.