-
Notifications
You must be signed in to change notification settings - Fork 788
[SYCL] Update tests with new test cases for FPGA function attributes #3089
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
Conversation
Template parameter support was added for 1. [[intel::max_global_work_dim)]] attribute on intel#2816 2. [[intel::num_simd_work_items()]] attribute on intel#2510 3. [[intel::reqd_sub_group_size()]] attribute on intel#1807 This patch adds the following new test cases that were not there before to improve the support: 1. Test that checks wrong function template instantiation and ensures that the type is checked properly when instantiating from the template definition. 2. Test that checks expression is not a constant expression. 3. Test that checks expression is a constant expression. 4. Test that checks template parameter support on function. NOTE: No change in compiler. All new test cases have already been supported. Signed-off-by: Soumi Manna <[email protected]>
clang/test/SemaSYCL/sycl-device-num_simd_work_items-template.cpp
Outdated
Show resolved
Hide resolved
clang/test/SemaSYCL/sycl-device-intel-max-global-work-dim-template.cpp
Outdated
Show resolved
Hide resolved
clang/test/SemaSYCL/sycl-device-reqd-sub-group-size-template.cpp
Outdated
Show resolved
Hide resolved
Signed-off-by: Soumi Manna <[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.
LGTM. Thanks!
Thanks @elizabethandrews for the reviews. |
struct S {}; | ||
void var() { | ||
//expected-note@+1{{in instantiation of function template specialization 'func<S>' requested here}} | ||
func<S>(); |
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.
Another interesting test would be: func<float>();
to see if we get an exciting implicit conversion to int there or not. Also, a test like func<int>();
, which should be accepted.
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.
Another interesting test would be: func(); to see if we get an exciting implicit conversion to int there or not.
Test is added. We get an implicit conversion to int for all attributes here.
Also, a test like func();, which should be accepted.
Test is added.
[intel::max_global_work_dim)]] -- accepts this test
[[intel::num_simd_work_items()]] -- does not accept this test
[[intel::reqd_sub_group_size()]] -- does not accept this test
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 it expected that we get an implicit conversion for func<float>()
or was that a surprise (if a surprise, maybe open an issue for it)?
Also, is the inconsistency between the other attributes with func<int>()
expected? I would assume we'd want all of these or none of these to behave the same way. If it's unexpected, maybe open another issue?
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 have created #3100 for this issue and assigned to me. I will investigate this behavior for all of these in a separate PR. Thanks @AaronBallman for suggesting about this tests.
Signed-off-by: Soumi Manna <[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.
Changes LGTM!
Thank you @elizabethandrews and @AaronBallman for the discussion and reviews. |
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.
Sorry, I missed the earlier notifications.
Looks good to me.
Thanks @premanandrao. |
Template parameter support was added for
This patch adds the following new test cases that were not there before to verify/improve the template support:
is checked properly when instantiating from the template definition.
NOTE: No change in compiler. All new test cases have already been supported.
Signed-off-by: Soumi Manna [email protected]