Skip to content

Commit 94d7922

Browse files
committed
[Frontend][OpenMP] Remove reduction from allowed clauses for target
The "reduction" clause is not allowed on the "target" construct. The RFC: https://discourse.llvm.org/t/removing-reduction-from-allowed-clauses-for-target-in-omp-td/78881
1 parent cc3b6c3 commit 94d7922

File tree

5 files changed

+0
-560
lines changed

5 files changed

+0
-560
lines changed

clang/test/OpenMP/nvptx_target_cuda_mode_messages.cpp

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -46,23 +46,6 @@ int foo(int n, double *ptr) {
4646
return a;
4747
}
4848

49-
template <typename tx>
50-
tx ftemplate(int n) {
51-
tx a = 0;
52-
tx b[10];
53-
54-
#pragma omp target reduction(+ \
55-
: a, b) // expected-note {{defined as threadprivate or thread local}}
56-
{
57-
int e; // expected-note {{defined as threadprivate or thread local}}
58-
#pragma omp parallel shared(a, e) // expected-error 2 {{threadprivate or thread local variable cannot be shared}}
59-
a += 1;
60-
b[2] += 1;
61-
}
62-
63-
return a;
64-
}
65-
6649
static int fstatic(int n) {
6750
int a = 0;
6851
char aaa = 0;
@@ -101,7 +84,6 @@ int bar(int n, double *ptr) {
10184
S1 S;
10285
a += S.r1(n);
10386
a += fstatic(n);
104-
a += ftemplate<int>(n); // expected-note {{in instantiation of function template specialization 'ftemplate<int>' requested here}}
10587

10688
return a;
10789
}

clang/test/OpenMP/target_reduction_codegen.cpp

Lines changed: 0 additions & 231 deletions
This file was deleted.

0 commit comments

Comments
 (0)