-
Notifications
You must be signed in to change notification settings - Fork 801
[SYCL][clang] Fix more free-function kernel integration header cases #20877
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: sycl
Are you sure you want to change the base?
[SYCL][clang] Fix more free-function kernel integration header cases #20877
Conversation
This commit fixes a number of known issues when the integration header generates prototypes of the free-function kernels. These changes focus on the additional removal of aliasing and proper handling of templated template arguments. This commit also adds disabled test cases for a known issue with unresolved nested templated type aliases. These are cases for future work. Signed-off-by: Larsen, Steffen <[email protected]> Co-authored-by: Sachkov, Alexey <[email protected]>
Fznamznon
left a comment
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.
Just questions, will continue with meaningful review on Monday.
@elizabethandrews , @premanandrao given the size of the pr you're weclome to review as well.
| } | ||
|
|
||
| const TemplateSpecializationType * | ||
| getAsTemplateSpecializationTypeWithoutAliases(const ASTContext &Ctx) const; |
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.
Is there any reason to have it as a member of Type class rather than a static function in SemaSYCL.cpp?
| const TemplateSpecializationType *TST = | ||
| getAsNonAliasTemplateSpecializationType(); | ||
| if (!TST) | ||
| return TST; |
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.
That looks a bit unusual, can we make it explicit?
| return TST; | |
| return nullptr; |
| return TST; | ||
| } | ||
|
|
||
| const TemplateSpecializationType * |
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.
Can we also have a documentation comment explaining what the function does and what is the difference from getAsNonAliasTemplateSpecializationType ?
|
|
||
| const TemplateSpecializationType *TSTAsNonAlias = | ||
| TST->getAsNonAliasTemplateSpecializationType(); | ||
| TST->getAsTemplateSpecializationTypeWithoutAliases(Context); |
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.
So I was kind of expecting that the visitor soluiton would help us to avoid unwrapping and modifying types manually like getAsTemplateSpecializationTypeWithoutAliases does. Is that not the case? Could you please elaborate why do we need such a complex solution?
| /// What this visitor does is it iterates over both in sync, picking the right | ||
| /// values from one or another. | ||
| /// | ||
| /// Moral of the story: drop integration header ASAP (but that is blocked |
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.
Lol, now we have two comments in SemaSYCL saying drop integration header.
This commit fixes a number of known issues when the integration header generates prototypes of the free-function kernels. These changes focus on the additional removal of aliasing and proper handling of templated template arguments.
This commit also adds disabled test cases for a known issue with unresolved nested templated type aliases. These are cases for future work.