case OMP_CLAUSE_MAP:
case OMP_CLAUSE_IS_DEVICE_PTR:
case OMP_CLAUSE_DEFAULTMAP:
+ case OMP_CLAUSE_DEPEND:
s = C_OMP_CLAUSE_SPLIT_TARGET;
break;
case OMP_CLAUSE_NUM_TEAMS:
s = C_OMP_CLAUSE_SPLIT_PARALLEL;
break;
case OMP_CLAUSE_ORDERED:
- case OMP_CLAUSE_NOWAIT:
s = C_OMP_CLAUSE_SPLIT_FOR;
break;
case OMP_CLAUSE_SCHEDULE:
else
s = C_OMP_CLAUSE_SPLIT_FOR;
break;
+ case OMP_CLAUSE_NOWAIT:
+ /* Nowait clause is allowed on target, for and sections, but
+ is not allowed on parallel for or parallel sections. Therefore,
+ put it on target construct if present, because that can only
+ be combined with parallel for{, simd} and not with for{, simd},
+ otherwise to the worksharing construct. */
+ if ((mask & (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_MAP))
+ != 0)
+ s = C_OMP_CLAUSE_SPLIT_TARGET;
+ else
+ s = C_OMP_CLAUSE_SPLIT_FOR;
+ break;
default:
gcc_unreachable ();
}
strcat (p_name, " for");
mask |= OMP_FOR_CLAUSE_MASK;
- if (cclauses)
+ /* parallel for{, simd} disallows nowait clause, but for
+ target {teams distribute ,}parallel for{, simd} it should be accepted. */
+ if (cclauses && (mask & (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_MAP)) == 0)
mask &= ~(OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_NOWAIT);
/* Composite distribute parallel for{, simd} disallows ordered clause. */
if ((mask & (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_DIST_SCHEDULE)) != 0)
}
}
- clauses = cp_parser_omp_all_clauses (parser, mask, p_name, pragma_tok);
+ clauses = cp_parser_omp_all_clauses (parser, mask, p_name, pragma_tok,
+ cclauses == NULL);
if (cclauses)
{
cp_omp_split_clauses (loc, OMP_PARALLEL, mask, clauses, cclauses);
void
bar (int d, int m, int i1, int i2, int p, int *idp, int s,
- int nte, int tl, int nth, int g, int nta, int fi, int pp, int *q)
+ int nte, int tl, int nth, int g, int nta, int fi, int pp, int *q, int *dd)
{
#pragma omp for simd \
private (p) firstprivate (f) lastprivate (l) linear (ll:1) reduction(+:r) schedule(static, 4) collapse(1) nowait \
}
#pragma omp target parallel \
device(d) map (tofrom: m) if (target: i1) private (p) firstprivate (f) defaultmap(tofrom: scalar) is_device_ptr (idp) \
- if (parallel: i2) default(shared) shared(s) reduction(+:r) num_threads (nth) proc_bind(spread)
+ if (parallel: i2) default(shared) shared(s) reduction(+:r) num_threads (nth) proc_bind(spread) \
+ nowait depend(inout: dd[0])
;
#pragma omp target parallel for \
device(d) map (tofrom: m) if (target: i1) private (p) firstprivate (f) defaultmap(tofrom: scalar) is_device_ptr (idp) \
if (parallel: i2) default(shared) shared(s) reduction(+:r) num_threads (nth) proc_bind(spread) \
- lastprivate (l) linear (ll:1) ordered schedule(static, 4) collapse(1)
+ lastprivate (l) linear (ll:1) ordered schedule(static, 4) collapse(1) nowait depend(inout: dd[0])
for (int i = 0; i < 64; i++)
ll++;
#pragma omp target parallel for simd \
device(d) map (tofrom: m) if (target: i1) private (p) firstprivate (f) defaultmap(tofrom: scalar) is_device_ptr (idp) \
if (parallel: i2) default(shared) shared(s) reduction(+:r) num_threads (nth) proc_bind(spread) \
lastprivate (l) linear (ll:1) schedule(static, 4) collapse(1) \
- safelen(8) simdlen(4) aligned(q: 32)
+ safelen(8) simdlen(4) aligned(q: 32) nowait depend(inout: dd[0])
for (int i = 0; i < 64; i++)
ll++;
#pragma omp target teams \
device(d) map (tofrom: m) if (target: i1) private (p) firstprivate (f) defaultmap(tofrom: scalar) is_device_ptr (idp) \
- shared(s) default(shared) reduction(+:r) num_teams(nte) thread_limit(tl)
+ shared(s) default(shared) reduction(+:r) num_teams(nte) thread_limit(tl) nowait depend(inout: dd[0])
;
#pragma omp target teams distribute \
device(d) map (tofrom: m) if (target: i1) private (p) firstprivate (f) defaultmap(tofrom: scalar) is_device_ptr (idp) \
shared(s) default(shared) reduction(+:r) num_teams(nte) thread_limit(tl) \
- collapse(1) dist_schedule(static, 16)
+ collapse(1) dist_schedule(static, 16) nowait depend(inout: dd[0])
for (int i = 0; i < 64; i++)
;
#pragma omp target teams distribute parallel for \
shared(s) default(shared) reduction(+:r) num_teams(nte) thread_limit(tl) \
collapse(1) dist_schedule(static, 16) \
if (parallel: i2) num_threads (nth) proc_bind(spread) \
- lastprivate (l) schedule(static, 4)
+ lastprivate (l) schedule(static, 4) nowait depend(inout: dd[0])
for (int i = 0; i < 64; i++)
ll++;
#pragma omp target teams distribute parallel for simd \
collapse(1) dist_schedule(static, 16) \
if (parallel: i2) num_threads (nth) proc_bind(spread) \
lastprivate (l) schedule(static, 4) \
- safelen(8) simdlen(4) aligned(q: 32)
+ safelen(8) simdlen(4) aligned(q: 32) nowait depend(inout: dd[0])
for (int i = 0; i < 64; i++)
ll++;
#pragma omp target teams distribute simd \
device(d) map (tofrom: m) if (target: i1) private (p) firstprivate (f) defaultmap(tofrom: scalar) is_device_ptr (idp) \
shared(s) default(shared) reduction(+:r) num_teams(nte) thread_limit(tl) \
collapse(1) dist_schedule(static, 16) \
- safelen(8) simdlen(4) aligned(q: 32)
+ safelen(8) simdlen(4) aligned(q: 32) nowait depend(inout: dd[0])
for (int i = 0; i < 64; i++)
ll++;
#pragma omp target simd \
device(d) map (tofrom: m) if (target: i1) private (p) firstprivate (f) defaultmap(tofrom: scalar) is_device_ptr (idp) \
- safelen(8) simdlen(4) lastprivate (l) linear(ll: 1) aligned(q: 32) reduction(+:r)
+ safelen(8) simdlen(4) lastprivate (l) linear(ll: 1) aligned(q: 32) reduction(+:r) \
+ nowait depend(inout: dd[0])
for (int i = 0; i < 64; i++)
ll++;
#pragma omp taskloop simd \
safelen(8) simdlen(4) linear(ll: 1) aligned(q: 32) reduction(+:r)
for (int i = 0; i < 64; i++)
ll++;
- #pragma omp target
+ #pragma omp target nowait depend(inout: dd[0])
#pragma omp teams distribute \
private(p) firstprivate (f) shared(s) default(shared) reduction(+:r) num_teams(nte) thread_limit(tl) \
collapse(1) dist_schedule(static, 16)