Skip to content

Fix potential problems with optional arguments on ReqdWorkGroupAttr #3175

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

Closed
smanna12 opened this issue Feb 8, 2021 · 1 comment · Fixed by #5782
Closed

Fix potential problems with optional arguments on ReqdWorkGroupAttr #3175

smanna12 opened this issue Feb 8, 2021 · 1 comment · Fixed by #5782
Assignees
Labels
bug Something isn't working confirmed

Comments

@smanna12
Copy link
Contributor

smanna12 commented Feb 8, 2021

One thing to double-check is whether YDimVal and ZDimVal can ever be null when we create the default values from SetDefaultValue(). I don't think they can be null within this if block, but it seems plausible they could be null in the D->getAttr<WorkGroupAttr>() block below (which could be an existing bug).

Originally posted by @AaronBallman in #3170 (comment)

@smanna12
Copy link
Contributor Author

smanna12 commented Feb 8, 2021

Those test cases does not work with current implementation (existing bug).

struct TRIFuncObjGood11 {
//expected-warning@+1 {{attribute 'reqd_work_group_size' is already applied with different parameters}}
[[intel::reqd_work_group_size(64)]] [[intel::reqd_work_group_size(128)]]void
operator()() const {}
};

struct TRIFuncObjGood3 {
//expected-warning@+1 {{attribute 'reqd_work_group_size' is already applied with different parameters}}
[[intel::reqd_work_group_size(64, 64)]] [[intel::reqd_work_group_size(128, 128)]]void
operator()() const {}
};

@smanna12 smanna12 self-assigned this Feb 8, 2021
@smanna12 smanna12 changed the title Avoid potential NULL value problems with ReqdWorkGroupAttr on optional arguments Avoid potential NULL value problems with optional arguments on ReqdWorkGroupAttr Feb 8, 2021
@smanna12 smanna12 changed the title Avoid potential NULL value problems with optional arguments on ReqdWorkGroupAttr Avoid potential problems with optional arguments on ReqdWorkGroupAttr Feb 8, 2021
@smanna12 smanna12 changed the title Avoid potential problems with optional arguments on ReqdWorkGroupAttr Fix potential problems with optional arguments on ReqdWorkGroupAttr Feb 8, 2021
@smanna12 smanna12 added the bug Something isn't working label Mar 4, 2022
@bader bader linked a pull request Mar 11, 2022 that will close this issue
bader pushed a commit that referenced this issue Mar 22, 2022
This patch

1. refactors SYCL kernel function attribute reqd_work_group_size to better fit for community standards.

2. refactors the way we handled duplicate attributes logic with when present on a given declaration.

3. refactors the way we handled mutually exclusive attributes logic with when present on a given declaration with 
     reqd_work_group_size, max_work_group_size, max_global_work_dim, and num_simd_work_items attributes.

5. handles redeclarations or template instantiations properly.

6. stores ConstantExpr into the semantic attribute rather than calling getIntegerConstantExpr() for attribute dimension values. 

7. fixes crash with optional arguments on ReqdWorkGroupAttr and adds missing diagnostics for merging cases  when present 
    on a given declaration with reqd_work_group_size, max_work_group_size, max_global_work_dim, and num_simd_work_items 
    attributes.

8. updates clang-tidy build after reqd_work_group_size attribute changes.

9.  adds tests.

This patch fixes 
#5736, #5735, #5734, #5732, #5731, #3223, #3361, #3175, #3742, and #5733

Signed-off-by: Soumi Manna <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working confirmed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant