Skip to content

[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

Merged
merged 9 commits into from
May 28, 2025

Conversation

ShengchenJ
Copy link
Contributor

No description provided.

Signed-off-by: Chen, Sheng S <sheng.s.chen@intel.com>
@ShengchenJ ShengchenJ requested a review from a team as a code owner May 13, 2025 06:10
@ShengchenJ ShengchenJ requested review from intwanghao and zhiweij1 May 13, 2025 06:10
Signed-off-by: Chen, Sheng S <sheng.s.chen@intel.com>
Signed-off-by: Chen, Sheng S <sheng.s.chen@intel.com>
@zhimingwang36 zhimingwang36 changed the title [SYCLomatic] Cast the CUDA enum type to int if the type is scoped. [SYCLomatic] Add explicit cast if CUDA enum type is migrated scoped type and the value is compared to a different type value. May 15, 2025
@ShengchenJ ShengchenJ requested a review from Copilot May 16, 2025 01:43
Copy link

@Copilot Copilot AI left a 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

Signed-off-by: Chen, Sheng S <sheng.s.chen@intel.com>
Signed-off-by: Chen, Sheng S <sheng.s.chen@intel.com>
Signed-off-by: Chen, Sheng S <sheng.s.chen@intel.com>
Signed-off-by: Chen, Sheng S <sheng.s.chen@intel.com>
Signed-off-by: Chen, Sheng S <sheng.s.chen@intel.com>
Signed-off-by: Chen, Sheng S <sheng.s.chen@intel.com>
@zhimingwang36 zhimingwang36 merged commit 7d3f6e9 into oneapi-src:SYCLomatic May 28, 2025
1 of 6 checks passed
@ShengchenJ ShengchenJ deleted the add_op_val branch May 28, 2025 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants