-
Notifications
You must be signed in to change notification settings - Fork 14.5k
[OpenMP][Clang] Handle unsupported inscan modifier for generic types #79431
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,28 +12,6 @@ | |
|
||
void foo() {} | ||
|
||
template <class T> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How was this test case working till now when templates were not supported in scan? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The test was passing because the |
||
T tmain(T argc) { | ||
static T a; | ||
#pragma omp for reduction(inscan, +: a) | ||
for (int i = 0; i < 10; ++i) { | ||
#pragma omp scan inclusive(a) | ||
} | ||
return a + argc; | ||
} | ||
// CHECK: static T a; | ||
// CHECK-NEXT: #pragma omp for reduction(inscan, +: a) | ||
// CHECK-NEXT: for (int i = 0; i < 10; ++i) { | ||
// CHECK-NEXT: #pragma omp scan inclusive(a){{$}} | ||
// CHECK: static int a; | ||
// CHECK-NEXT: #pragma omp for reduction(inscan, +: a) | ||
// CHECK-NEXT: for (int i = 0; i < 10; ++i) { | ||
// CHECK-NEXT: #pragma omp scan inclusive(a) | ||
// CHECK: static char a; | ||
// CHECK-NEXT: #pragma omp for reduction(inscan, +: a) | ||
// CHECK-NEXT: for (int i = 0; i < 10; ++i) { | ||
// CHECK-NEXT: #pragma omp scan inclusive(a) | ||
|
||
int main(int argc, char **argv) { | ||
static int a; | ||
// CHECK: static int a; | ||
|
@@ -46,7 +24,7 @@ int main(int argc, char **argv) { | |
// CHECK-NEXT: #pragma omp for simd reduction(inscan, ^: a,argc) | ||
// CHECK-NEXT: for (int i = 0; i < 10; ++i) { | ||
// CHECK-NEXT: #pragma omp scan exclusive(a,argc){{$}} | ||
return tmain(argc) + tmain(argv[0][0]) + a; | ||
return 0; | ||
} | ||
|
||
#endif |
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.
This is definetely wrong, templates should be supported
Uh oh!
There was an error while loading. Please reload this page.
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.
It should ideally be supported. However, the compiler crashes as per #67002 on the latest builds.
And, can you please elaborate on what you think is wrong with the patch?
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.
Did you mean that templates are currently supported, or did you mean that they should be supported?
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.
They are supported, but this check disables this support