-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[clang][SME] Emit error for OpenMP captured regions in SME functions #124590
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
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
81 changes: 81 additions & 0 deletions
81
clang/test/Sema/aarch64-sme-attrs-openmp-captured-region.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sme -target-feature +sme2 -fopenmp -fsyntax-only -verify %s | ||
| // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sme -target-feature +sme2 -fopenmp -fsyntax-only -verify=expected-cpp -x c++ %s | ||
|
|
||
| int compute(int); | ||
|
|
||
| void streaming_openmp_captured_region(int * out) __arm_streaming { | ||
| // expected-error@+2 {{OpenMP captured regions are not yet supported in streaming functions}} | ||
| // expected-cpp-error@+1 {{OpenMP captured regions are not yet supported in streaming functions}} | ||
| #pragma omp parallel for num_threads(32) | ||
| for (int ci = 0; ci < 8; ci++) { | ||
| out[ci] = compute(ci); | ||
| } | ||
| } | ||
|
|
||
| __arm_locally_streaming void locally_streaming_openmp_captured_region(int * out) { | ||
| // expected-error@+2 {{OpenMP captured regions are not yet supported in streaming functions}} | ||
| // expected-cpp-error@+1 {{OpenMP captured regions are not yet supported in streaming functions}} | ||
| #pragma omp parallel for num_threads(32) | ||
| for (int ci = 0; ci < 8; ci++) { | ||
| out[ci] = compute(ci); | ||
| } | ||
| } | ||
|
|
||
| void za_state_captured_region(int * out) __arm_inout("za") { | ||
| // expected-error@+2 {{OpenMP captured regions are not yet supported in functions with ZA state}} | ||
| // expected-cpp-error@+1 {{OpenMP captured regions are not yet supported in functions with ZA state}} | ||
| #pragma omp parallel for num_threads(32) | ||
| for (int ci = 0; ci < 8; ci++) { | ||
| out[ci] = compute(ci); | ||
| } | ||
| } | ||
|
|
||
| __arm_new("za") void new_za_state_captured_region(int * out) { | ||
| // expected-error@+2 {{OpenMP captured regions are not yet supported in functions with ZA state}} | ||
| // expected-cpp-error@+1 {{OpenMP captured regions are not yet supported in functions with ZA state}} | ||
| #pragma omp parallel for num_threads(32) | ||
| for (int ci = 0; ci < 8; ci++) { | ||
| out[ci] = compute(ci); | ||
| } | ||
| } | ||
|
|
||
| void zt0_state_openmp_captured_region(int * out) __arm_inout("zt0") { | ||
| // expected-error@+2 {{OpenMP captured regions are not yet supported in functions with ZT0 state}} | ||
| // expected-cpp-error@+1 {{OpenMP captured regions are not yet supported in functions with ZT0 state}} | ||
| #pragma omp parallel for num_threads(32) | ||
| for (int ci = 0; ci < 8; ci++) { | ||
| out[ci] = compute(ci); | ||
| } | ||
| } | ||
|
|
||
| __arm_new("zt0") void new_zt0_state_openmp_captured_region(int * out) { | ||
| // expected-error@+2 {{OpenMP captured regions are not yet supported in functions with ZT0 state}} | ||
| // expected-cpp-error@+1 {{OpenMP captured regions are not yet supported in functions with ZT0 state}} | ||
| #pragma omp parallel for num_threads(32) | ||
| for (int ci = 0; ci < 8; ci++) { | ||
| out[ci] = compute(ci); | ||
| } | ||
| } | ||
|
|
||
| /// OpenMP directives that don't create a captured region are okay: | ||
|
|
||
| void streaming_function_openmp(int * out) __arm_streaming __arm_inout("za", "zt0") { | ||
| #pragma omp unroll full | ||
| for (int ci = 0; ci < 8; ci++) { | ||
| out[ci] = compute(ci); | ||
| } | ||
| } | ||
|
|
||
| __arm_locally_streaming void locally_streaming_openmp(int * out) __arm_inout("za", "zt0") { | ||
| #pragma omp unroll full | ||
| for (int ci = 0; ci < 8; ci++) { | ||
| out[ci] = compute(ci); | ||
| } | ||
| } | ||
|
|
||
| __arm_new("za", "zt0") void arm_new_openmp(int * out) { | ||
| #pragma omp unroll full | ||
| for (int ci = 0; ci < 8; ci++) { | ||
| out[ci] = compute(ci); | ||
| } | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.