-
Notifications
You must be signed in to change notification settings - Fork 93
[SYCLomatic] Add explicit cast if CUDA enum type is migrated scoped type and the value is compared to a different type value. #2829
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
base: SYCLomatic
Are you sure you want to change the base?
Conversation
Signed-off-by: Chen, Sheng S <[email protected]>
Signed-off-by: Chen, Sheng S <[email protected]>
Signed-off-by: Chen, Sheng S <[email protected]>
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.
Pull Request Overview
This PR adds a new migration rule to handle explicit cast insertion for CUDA enum type comparisons and registers it in the AST traversal. The key changes include:
- Introducing BinaryOperatorCallRule in the header and implementation files.
- Inserting explicit cast replacements for certain enum values.
- Registering the new rule in the AST traversal.
Reviewed Changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
clang/lib/DPCT/RulesLang/RulesLang.h | Added declaration for BinaryOperatorCallRule. |
clang/lib/DPCT/RulesLang/RulesLang.cpp | Implemented BinaryOperatorCallRule with cast logic. |
clang/lib/DPCT/ASTTraversal.cpp | Registered BinaryOperatorCallRule. |
Files not reviewed (1)
- clang/test/dpct/enum_type.cu: Language not supported
if (!BO) | ||
return; | ||
|
||
// The migration rule covered these test type, no need to cast. |
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.
[nitpick] There appears to be a typographical error in the comment. Consider revising the comment to clarify the intended meaning (e.g., "The migration rule covers these enum types so no cast is required.").
// The migration rule covered these test type, no need to cast. | |
// The migration rule covers these enum types, so no cast is required. |
Copilot uses AI. Check for mistakes.
Signed-off-by: Chen, Sheng S <[email protected]>
Signed-off-by: Chen, Sheng S <[email protected]>
Signed-off-by: Chen, Sheng S <[email protected]>
Signed-off-by: Chen, Sheng S <[email protected]>
Signed-off-by: Chen, Sheng S <[email protected]>
No description provided.