/* { dg-additional-options "-fopenmp" } for '#pragma omp threadprivate'. */
+/* Array sections without spaces between [ and : or : and ] are incompatible
+ with C++26. */
+/* { dg-skip-if "array sections vs. C++26" { c++26 } } */
+
/* The current implementation doesn't restrict where a 'cache' directive may
appear, so we don't make any special arrangements. */
;
#pragma acc cache (r[-1:2])
;
- #pragma acc cache (s[-1:2][:])
+ #pragma acc cache (s[-1:2][ : ])
;
#pragma acc cache (s[-1:2][-2:10]) /* { dg-error "negative low bound in array section in" } */
;
#pragma acc cache (a[-1:2]) /* { dg-error "negative low bound in array section in" } */
;
- #pragma acc cache (b[-1:2][0:]) /* { dg-error "negative low bound in array section in" } */
+ #pragma acc cache (b[-1:2][0: ]) /* { dg-error "negative low bound in array section in" } */
;
#pragma acc cache (b[1:2][-2:10]) /* { dg-error "negative low bound in array section in" } */
;
#pragma acc cache (p[2:-3]) /* { dg-error "negative length in array section in" } */
;
- #pragma acc cache (q[2:-3][:]) /* { dg-error "negative length in array section in" } */
+ #pragma acc cache (q[2:-3][ : ]) /* { dg-error "negative length in array section in" } */
;
#pragma acc cache (q[2:3][0:-1]) /* { dg-error "negative length in array section in" } */
;
#pragma acc cache (r[2:-5]) /* { dg-error "negative length in array section in" } */
;
- #pragma acc cache (s[2:-5][:]) /* { dg-error "negative length in array section in" } */
+ #pragma acc cache (s[2:-5][ : ]) /* { dg-error "negative length in array section in" } */
;
#pragma acc cache (s[2:5][0:-4]) /* { dg-error "negative length in array section in" } */
;
;
#pragma acc parallel copyout(t[2:5]) /* { dg-error "is threadprivate variable" } */
;
- #pragma acc parallel copy(k[0.5:]) /* { dg-error "low bound \[^\n\r]* of array section does not have integral type" } */
+ #pragma acc parallel copy(k[0.5: ]) /* { dg-error "low bound \[^\n\r]* of array section does not have integral type" } */
;
- #pragma acc parallel copyout(l[:7.5f]) /* { dg-error "length \[^\n\r]* of array section does not have integral type" } */
+ #pragma acc parallel copyout(l[ :7.5f]) /* { dg-error "length \[^\n\r]* of array section does not have integral type" } */
;
- #pragma acc parallel copyin(m[p:]) /* { dg-error "low bound \[^\n\r]* of array section does not have integral type" } */
+ #pragma acc parallel copyin(m[p: ]) /* { dg-error "low bound \[^\n\r]* of array section does not have integral type" } */
;
- #pragma acc parallel copy(n[:p]) /* { dg-error "length \[^\n\r]* of array section does not have integral type" } */
+ #pragma acc parallel copy(n[ :p]) /* { dg-error "length \[^\n\r]* of array section does not have integral type" } */
;
#pragma acc parallel copyin(o[2:5]) /* { dg-error "does not have pointer or array type" } */
;
;
#pragma acc parallel create(s2) /* { dg-error "'s2' does not have a mappable type in 'map' clause" } */
;
- #pragma acc parallel copyin(a[:][:]) /* { dg-error "array type length expression must be specified" } */
+ #pragma acc parallel copyin(a[ : ][ : ]) /* { dg-error "array type length expression must be specified" } */
bar (&a[0][0]); /* { dg-error "referenced in target region does not have a mappable type" } */
- #pragma acc parallel copy(b[-1:]) /* { dg-error "negative low bound in array section" } */
+ #pragma acc parallel copy(b[-1: ]) /* { dg-error "negative low bound in array section" } */
bar (b);
- #pragma acc parallel copy(c[:-3][:]) /* { dg-error "negative length in array section" } */
+ #pragma acc parallel copy(c[ :-3][ : ]) /* { dg-error "negative length in array section" } */
bar (&c[0][0]);
- #pragma acc parallel copyout(d[11:]) /* { dg-error "low bound \[^\n\r]* above array section size" } */
+ #pragma acc parallel copyout(d[11: ]) /* { dg-error "low bound \[^\n\r]* above array section size" } */
bar (d);
- #pragma acc parallel copyin(e[:11]) /* { dg-error "length \[^\n\r]* above array section size" } */
+ #pragma acc parallel copyin(e[ :11]) /* { dg-error "length \[^\n\r]* above array section size" } */
bar (e);
#pragma acc parallel copyin(f[1:10]) /* { dg-error "high bound \[^\n\r]* above array section size" } */
bar (f);
- #pragma acc parallel copyout(g[:][0:10]) /* { dg-error "for array function parameter length expression must be specified" } */
+ #pragma acc parallel copyout(g[ : ][0:10]) /* { dg-error "for array function parameter length expression must be specified" } */
bar (&g[0][0]);
- #pragma acc parallel copyout(h[2:1][-1:]) /* { dg-error "negative low bound in array section" } */
+ #pragma acc parallel copyout(h[2:1][-1: ]) /* { dg-error "negative low bound in array section" } */
bar (&h[0][0]);
- #pragma acc parallel copy(h[:1][:-3]) /* { dg-error "negative length in array section" } */
+ #pragma acc parallel copy(h[ :1][ :-3]) /* { dg-error "negative length in array section" } */
bar (&h[0][0]);
- #pragma acc parallel copy(i[:1][11:]) /* { dg-error "low bound \[^\n\r]* above array section size" } */
+ #pragma acc parallel copy(i[ :1][11: ]) /* { dg-error "low bound \[^\n\r]* above array section size" } */
bar (&i[0][0]);
- #pragma acc parallel copyout(j[3:1][:10]) /* { dg-error "length \[^\n\r]* above array section size" } */
+ #pragma acc parallel copyout(j[3:1][ :10]) /* { dg-error "length \[^\n\r]* above array section size" } */
bar (&j[0][0]);
#pragma acc parallel copyin(j[30:1][5:5]) /* { dg-error "high bound \[^\n\r]* above array section size" } */
bar (&j[0][0]);
- #pragma acc parallel copyin(a2[:1][2:4])
+ #pragma acc parallel copyin(a2[ :1][2:4])
bar (&a2[0][0]);
- #pragma acc parallel copy(a2[3:5][:])
+ #pragma acc parallel copy(a2[3:5][ : ])
bar (&a2[0][0]);
- #pragma acc parallel copyin(a2[3:5][:10])
+ #pragma acc parallel copyin(a2[3:5][ :10])
bar (&a2[0][0]);
- #pragma acc parallel copy(b2[0:])
+ #pragma acc parallel copy(b2[0: ])
bar (b2);
- #pragma acc parallel copy(c2[:3][:])
+ #pragma acc parallel copy(c2[ :3][ : ])
bar (&c2[0][0]);
- #pragma acc parallel copyout(d2[9:])
+ #pragma acc parallel copyout(d2[9: ])
bar (d2);
- #pragma acc parallel copyin(e2[:10])
+ #pragma acc parallel copyin(e2[ :10])
bar (e2);
#pragma acc parallel copyin(f2[1:9])
bar (f2);
- #pragma acc parallel copy(g2[:1][2:4])
+ #pragma acc parallel copy(g2[ :1][2:4])
bar (&g2[0][0]);
- #pragma acc parallel copyout(h2[2:2][0:])
+ #pragma acc parallel copyout(h2[2:2][0: ])
bar (&h2[0][0]);
- #pragma acc parallel copy(h2[:1][:3])
+ #pragma acc parallel copy(h2[ :1][ :3])
bar (&h2[0][0]);
- #pragma acc parallel copyin(i2[:1][9:])
+ #pragma acc parallel copyin(i2[ :1][9: ])
bar (&i2[0][0]);
- #pragma acc parallel copyout(j2[3:4][:9])
+ #pragma acc parallel copyout(j2[3:4][ :9])
bar (&j2[0][0]);
#pragma acc parallel copyin(j2[30:1][5:4])
bar (&j2[0][0]);
#pragma acc parallel copy(q[1:2])
;
- #pragma acc parallel copy(q[3:5][:10]) /* { dg-error "array section is not contiguous" } */
+ #pragma acc parallel copy(q[3:5][ :10]) /* { dg-error "array section is not contiguous" } */
;
- #pragma acc parallel copy(r[3:][2:1][1:2])
+ #pragma acc parallel copy(r[3: ][2:1][1:2])
;
- #pragma acc parallel copy(r[3:][2:1][1:2][:][0:4])
+ #pragma acc parallel copy(r[3: ][2:1][1:2][ : ][0:4])
;
- #pragma acc parallel copy(r[3:][2:1][1:2][1:][0:4]) /* { dg-error "array section is not contiguous" } */
+ #pragma acc parallel copy(r[3: ][2:1][1:2][1: ][0:4]) /* { dg-error "array section is not contiguous" } */
;
- #pragma acc parallel copy(r[3:][2:1][1:2][:3][0:4]) /* { dg-error "array section is not contiguous" } */
+ #pragma acc parallel copy(r[3: ][2:1][1:2][ :3][0:4]) /* { dg-error "array section is not contiguous" } */
;
- #pragma acc parallel copy(r[3:][2:1][1:2][:][1:]) /* { dg-error "array section is not contiguous" } */
+ #pragma acc parallel copy(r[3: ][2:1][1:2][ : ][1: ]) /* { dg-error "array section is not contiguous" } */
;
- #pragma acc parallel copy(r[3:][2:1][1:2][:][:3]) /* { dg-error "array section is not contiguous" } */
+ #pragma acc parallel copy(r[3: ][2:1][1:2][ : ][ :3]) /* { dg-error "array section is not contiguous" } */
;
}
;
#pragma acc parallel copy (r[-1:2])
;
- #pragma acc parallel copy (s[-1:2][:])
+ #pragma acc parallel copy (s[-1:2][ : ])
;
#pragma acc parallel copy (s[-1:2][-2:10]) /* { dg-error "negative low bound in array section in" } */
;
#pragma acc parallel copy (a[-1:2]) /* { dg-error "negative low bound in array section in" } */
;
- #pragma acc parallel copy (b[-1:2][0:]) /* { dg-error "negative low bound in array section in" } */
+ #pragma acc parallel copy (b[-1:2][0: ]) /* { dg-error "negative low bound in array section in" } */
;
#pragma acc parallel copy (b[1:2][-2:10]) /* { dg-error "negative low bound in array section in" } */
;
#pragma acc parallel copy (p[2:-3]) /* { dg-error "negative length in array section in" } */
;
- #pragma acc parallel copy (q[2:-3][:]) /* { dg-error "negative length in array section in" } */
+ #pragma acc parallel copy (q[2:-3][ : ]) /* { dg-error "negative length in array section in" } */
;
#pragma acc parallel copy (q[2:3][0:-1]) /* { dg-error "negative length in array section in" } */
;
#pragma acc parallel copy (r[2:-5]) /* { dg-error "negative length in array section in" } */
;
- #pragma acc parallel copy (s[2:-5][:]) /* { dg-error "negative length in array section in" } */
+ #pragma acc parallel copy (s[2:-5][ : ]) /* { dg-error "negative length in array section in" } */
;
#pragma acc parallel copy (s[2:5][0:-4]) /* { dg-error "negative length in array section in" } */
;
;
#pragma acc serial present(fp[0:2]) copyin(fp[0:2]) /* { dg-error "'fp' appears more than once in data clauses" } */
;
-#pragma acc data create(fp[:10]) deviceptr(fp) /* { dg-error "'fp' appears more than once in data clauses" } */
+#pragma acc data create(fp[ :10]) deviceptr(fp) /* { dg-error "'fp' appears more than once in data clauses" } */
;
#pragma acc data create(fp) present(fp) /* { dg-error "'fp' appears more than once in data clauses" } */
;
#pragma acc exit data detach(a)
}
-#pragma acc enter data attach(z[:5]) /* { dg-error "expected single pointer in .attach. clause" } */
+#pragma acc enter data attach(z[ :5]) /* { dg-error "expected single pointer in .attach. clause" } */
/* { dg-error "has no data movement clause" "" { target *-*-* } .-1 } */
-#pragma acc exit data detach(z[:5]) /* { dg-error "expected single pointer in .detach. clause" } */
+#pragma acc exit data detach(z[ :5]) /* { dg-error "expected single pointer in .detach. clause" } */
/* { dg-error "has no data movement clause" "" { target *-*-* } .-1 } */
-#pragma acc enter data attach(z[1:]) /* { dg-error "expected single pointer in .attach. clause" } */
+#pragma acc enter data attach(z[1: ]) /* { dg-error "expected single pointer in .attach. clause" } */
/* { dg-error "has no data movement clause" "" { target *-*-* } .-1 } */
-#pragma acc exit data detach(z[1:]) /* { dg-error "expected single pointer in .detach. clause" } */
+#pragma acc exit data detach(z[1: ]) /* { dg-error "expected single pointer in .detach. clause" } */
/* { dg-error "has no data movement clause" "" { target *-*-* } .-1 } */
-#pragma acc enter data attach(z[:]) /* { dg-error "expected single pointer in .attach. clause" } */
+#pragma acc enter data attach(z[ : ]) /* { dg-error "expected single pointer in .attach. clause" } */
/* { dg-error "has no data movement clause" "" { target *-*-* } .-1 } */
-#pragma acc exit data detach(z[:]) /* { dg-error "expected single pointer in .detach. clause" } */
+#pragma acc exit data detach(z[ : ]) /* { dg-error "expected single pointer in .detach. clause" } */
/* { dg-error "has no data movement clause" "" { target *-*-* } .-1 } */
#pragma acc enter data attach(z[3]) /* { dg-error "expected pointer in .attach. clause" } */
/* { dg-error "has no data movement clause" "" { target *-*-* } .-1 } */
int x[32], y[32];
struct S s = {x, 0};
- #pragma acc declare copyin(readonly: x/*[:32]*/, s/*.ptr[:16]*/) copyin(y/*[:32]*/)
+ #pragma acc declare copyin(readonly: x/*[ :32]*/, s/*.ptr[ :16]*/) copyin(y/*[ :32]*/)
- #pragma acc parallel copyin(readonly: x[:32], s.ptr[:16]) copyin(y[:32])
+ #pragma acc parallel copyin(readonly: x[ :32], s.ptr[ :16]) copyin(y[ :32])
{
- #pragma acc cache (readonly: x[:32])
- #pragma acc cache (y[:32])
+ #pragma acc cache (readonly: x[ :32])
+ #pragma acc cache (y[ :32])
}
- #pragma acc kernels copyin(readonly: x[:32], s.ptr[:16]) copyin(y[:32])
+ #pragma acc kernels copyin(readonly: x[ :32], s.ptr[ :16]) copyin(y[ :32])
{
- #pragma acc cache (readonly: x[:32])
- #pragma acc cache (y[:32])
+ #pragma acc cache (readonly: x[ :32])
+ #pragma acc cache (y[ :32])
}
- #pragma acc serial copyin(readonly: x[:32], s.ptr[:16]) copyin(y[:32])
+ #pragma acc serial copyin(readonly: x[ :32], s.ptr[ :16]) copyin(y[ :32])
{
- #pragma acc cache (readonly: x[:32])
- #pragma acc cache (y[:32])
+ #pragma acc cache (readonly: x[ :32])
+ #pragma acc cache (y[ :32])
}
- #pragma acc data copyin(readonly: x[:32], s.ptr[:16]) copyin(y[:32])
+ #pragma acc data copyin(readonly: x[ :32], s.ptr[ :16]) copyin(y[ :32])
{
- #pragma acc cache (readonly: x[:32])
- #pragma acc cache (y[:32])
+ #pragma acc cache (readonly: x[ :32])
+ #pragma acc cache (y[ :32])
}
- #pragma acc enter data copyin(readonly: x[:32], s.ptr[:16]) copyin(y[:32])
+ #pragma acc enter data copyin(readonly: x[ :32], s.ptr[ :16]) copyin(y[ :32])
return 0;
}
-/* { dg-do compile } */
+/* { dg-do compile { target { c || c++23_down } } } */
/* { dg-options "-fopenmp" } */
extern int a[][10], a2[][10];
s[0]++;
#pragma omp parallel reduction (+: s[2:2]) allocate(s)
s[2]++;
-#pragma omp parallel reduction (+: p[:2]) allocate(p)
+#pragma omp parallel reduction (+: p[ :2]) allocate(p)
p[0]++;
#pragma omp parallel reduction (+: p[2:2]) allocate(p)
p[2]++;
#pragma omp teams distribute parallel for reduction (+: s[2:2]) allocate(s)
for (i = 0; i < 64; i++)
s[2]++;
-#pragma omp teams distribute parallel for reduction (+: p[:2]) allocate(p)
+#pragma omp teams distribute parallel for reduction (+: p[ :2]) allocate(p)
for (i = 0; i < 64; i++)
p[0]++;
#pragma omp teams distribute parallel for reduction (+: p[2:2]) allocate(p)
bar (&s.v.a);
#pragma omp target map (s.v.a) map (always, to: s.u) map (s.x)
;
- #pragma omp target map (s.s[0]) map (s.v.b[:3])
+ #pragma omp target map (s.s[0]) map (s.v.b[ :3])
;
- #pragma omp target map (s.s[0]) map (s.v.b[:3])
+ #pragma omp target map (s.s[0]) map (s.v.b[ :3])
baz (s.s);
return 0;
}
{
int N = 1024;
#pragma omp declare mapper (mapN:struct S s) map(to:s.ptr, s.size) \
- map(s.ptr[:N])
+ map(s.ptr[ :N])
struct S s;
s.ptr = (int *) malloc (sizeof (int) * N);
;
#pragma omp task depend(out: t[2:5])
;
- #pragma omp task depend(inout: k[0.5:]) /* { dg-error "low bound \[^\n\r]* of array section does not have integral type" } */
+ #pragma omp task depend(inout: k[0.5: ]) /* { dg-error "low bound \[^\n\r]* of array section does not have integral type" } */
;
- #pragma omp task depend(in: l[:7.5f]) /* { dg-error "length \[^\n\r]* of array section does not have integral type" } */
+ #pragma omp task depend(in: l[ :7.5f]) /* { dg-error "length \[^\n\r]* of array section does not have integral type" } */
;
- #pragma omp task depend(out: m[p:]) /* { dg-error "low bound \[^\n\r]* of array section does not have integral type" } */
+ #pragma omp task depend(out: m[p: ]) /* { dg-error "low bound \[^\n\r]* of array section does not have integral type" } */
;
- #pragma omp task depend(inout: n[:p]) /* { dg-error "length \[^\n\r]* of array section does not have integral type" } */
+ #pragma omp task depend(inout: n[ :p]) /* { dg-error "length \[^\n\r]* of array section does not have integral type" } */
;
#pragma omp task depend(in: o[2:5]) /* { dg-error "does not have pointer or array type" } */
;
- #pragma omp task depend(out: a[:][2:4]) /* { dg-error "array type length expression must be specified" } */
+ #pragma omp task depend(out: a[ : ][2:4]) /* { dg-error "array type length expression must be specified" } */
;
- #pragma omp task depend(inout: b[-1:]) /* { dg-error "negative low bound in array section" } */
+ #pragma omp task depend(inout: b[-1: ]) /* { dg-error "negative low bound in array section" } */
;
- #pragma omp task depend(inout: c[:-3][1:1]) /* { dg-error "negative length in array section" } */
+ #pragma omp task depend(inout: c[ :-3][1:1]) /* { dg-error "negative length in array section" } */
;
- #pragma omp task depend(in: d[11:]) /* { dg-error "low bound \[^\n\r]* above array section size" } */
+ #pragma omp task depend(in: d[11: ]) /* { dg-error "low bound \[^\n\r]* above array section size" } */
;
- #pragma omp task depend(out: e[:11]) /* { dg-error "length \[^\n\r]* above array section size" } */
+ #pragma omp task depend(out: e[ :11]) /* { dg-error "length \[^\n\r]* above array section size" } */
;
#pragma omp task depend(out: f[1:10]) /* { dg-error "high bound \[^\n\r]* above array section size" } */
;
- #pragma omp task depend(in: g[:][2:4]) /* { dg-error "for array function parameter length expression must be specified" } */
+ #pragma omp task depend(in: g[ : ][2:4]) /* { dg-error "for array function parameter length expression must be specified" } */
;
- #pragma omp task depend(in: h[2:2][-1:]) /* { dg-error "negative low bound in array section" } */
+ #pragma omp task depend(in: h[2:2][-1: ]) /* { dg-error "negative low bound in array section" } */
;
- #pragma omp task depend(inout: h[:1][:-3]) /* { dg-error "negative length in array section" } */
+ #pragma omp task depend(inout: h[ :1][ :-3]) /* { dg-error "negative length in array section" } */
;
- #pragma omp task depend(out: i[:1][11:]) /* { dg-error "low bound \[^\n\r]* above array section size" } */
+ #pragma omp task depend(out: i[ :1][11: ]) /* { dg-error "low bound \[^\n\r]* above array section size" } */
;
- #pragma omp task depend(in: j[3:4][:10]) /* { dg-error "length \[^\n\r]* above array section size" } */
+ #pragma omp task depend(in: j[3:4][ :10]) /* { dg-error "length \[^\n\r]* above array section size" } */
;
#pragma omp task depend(out: j[30:10][5:5]) /* { dg-error "high bound \[^\n\r]* above array section size" } */
;
- #pragma omp task depend(out: a2[:3][2:4])
+ #pragma omp task depend(out: a2[ :3][2:4])
;
- #pragma omp task depend(inout: b2[0:])
+ #pragma omp task depend(inout: b2[0: ])
;
- #pragma omp task depend(inout: c2[:3][1:1])
+ #pragma omp task depend(inout: c2[ :3][1:1])
;
- #pragma omp task depend(in: d2[9:])
+ #pragma omp task depend(in: d2[9: ])
;
- #pragma omp task depend(out: e2[:10])
+ #pragma omp task depend(out: e2[ :10])
;
#pragma omp task depend(out: f2[1:9])
;
- #pragma omp task depend(in: g2[:2][2:4])
+ #pragma omp task depend(in: g2[ :2][2:4])
;
- #pragma omp task depend(in: h2[2:2][0:])
+ #pragma omp task depend(in: h2[2:2][0: ])
;
- #pragma omp task depend(inout: h2[:1][:3])
+ #pragma omp task depend(inout: h2[ :1][ :3])
;
- #pragma omp task depend(out: i2[:1][9:])
+ #pragma omp task depend(out: i2[ :1][9: ])
;
- #pragma omp task depend(in: j2[3:4][:9])
+ #pragma omp task depend(in: j2[3:4][ :9])
;
#pragma omp task depend(out: j2[30:10][5:4])
;
foo (int a[10][10][10], int **b)
{
int c[10][10][10];
- #pragma omp task depend(out: a[2:4][3:][:7], b[1:7][2:8])
+ #pragma omp task depend(out: a[2:4][3: ][ :7], b[1:7][2:8])
bar (a);
int i = 1, j = 3, k = 2, l = 6;
- #pragma omp task depend(in: a[++i:++j][++k:][:++l])
+ #pragma omp task depend(in: a[++i:++j][++k: ][ :++l])
bar (a);
- #pragma omp task depend(out: a[7:2][:][:], c[5:2][:][:])
+ #pragma omp task depend(out: a[7:2][ : ][ : ], c[5:2][ : ][ : ])
{
bar (c);
bar (a);
foo (int a[10][10][10], int **b, int x)
{
int c[10][10][10];
- #pragma omp task depend(out: a[2:4][3:0][:7]) /* { dg-error "zero length array section" } */
+ #pragma omp task depend(out: a[2:4][3:0][ :7]) /* { dg-error "zero length array section" } */
bar (a);
- #pragma omp task depend(inout: b[:7][0:0][:0]) /* { dg-error "zero length array section" } */
+ #pragma omp task depend(inout: b[ :7][0:0][ :0]) /* { dg-error "zero length array section" } */
bar (a);
- #pragma omp task depend(in: c[:][:][10:]) /* { dg-error "zero length array section" } */
+ #pragma omp task depend(in: c[ : ][ : ][10: ]) /* { dg-error "zero length array section" } */
bar (c);
- #pragma omp task depend(out: a[2:4][3:0][:x]) /* { dg-error "zero length array section" } */
+ #pragma omp task depend(out: a[2:4][3:0][ :x]) /* { dg-error "zero length array section" } */
bar (a);
- #pragma omp task depend(inout: b[:x][0:0][:0]) /* { dg-error "zero length array section" } */
+ #pragma omp task depend(inout: b[ :x][0:0][ :0]) /* { dg-error "zero length array section" } */
bar (a);
- #pragma omp task depend(in: c[:][x-2:x][10:]) /* { dg-error "zero length array section" } */
+ #pragma omp task depend(in: c[ : ][x-2:x][10: ]) /* { dg-error "zero length array section" } */
bar (c);
}
;
#pragma omp task depend (inout: p[2:-3]) /* { dg-error "negative length in array section in" } */
;
- #pragma omp task depend (inout: q[2:-3][:]) /* { dg-error "negative length in array section in" } */
+ #pragma omp task depend (inout: q[2:-3][ : ]) /* { dg-error "negative length in array section in" } */
;
#pragma omp task depend (inout: q[2:3][0:-1]) /* { dg-error "negative length in array section in" } */
;
#pragma omp task depend (inout: r[2:-5]) /* { dg-error "negative length in array section in" } */
;
- #pragma omp task depend (inout: s[2:-5][:]) /* { dg-error "negative length in array section in" } */
+ #pragma omp task depend (inout: s[2:-5][ : ]) /* { dg-error "negative length in array section in" } */
;
#pragma omp task depend (inout: s[2:5][0:-4]) /* { dg-error "negative length in array section in" } */
;
;
#pragma omp task depend(out: d[2])
;
- #pragma omp task depend(in: d[:])
+ #pragma omp task depend(in: d[ : ])
;
#pragma omp task depend(in: d[2:2])
;
- #pragma omp task depend(in: d[:2])
+ #pragma omp task depend(in: d[ :2])
;
#pragma omp task depend(inout: d[1].b->c[2])
;
void
foo (void)
{
- #pragma omp task depend(in: d[:2].b->c[2]) /* { dg-error "expected" } */
+ #pragma omp task depend(in: d[ :2].b->c[2]) /* { dg-error "expected" } */
;
- #pragma omp task depend(inout: d[1:].b->c[2]) /* { dg-error "expected" } */
+ #pragma omp task depend(inout: d[1: ].b->c[2]) /* { dg-error "expected" } */
;
#pragma omp task depend(out: d[0:1].a) /* { dg-error "expected" } */
;
f2 ();
#pragma omp dispatch depend(inout: sp)
f2 ();
-#pragma omp dispatch depend(inoutset: arr[:2])
+#pragma omp dispatch depend(inoutset: arr[ :2])
f2 ();
#pragma omp dispatch depend(out: arr)
f2 ();
foo (int *a, int *r3)
{
int r = 0, r2[2] = { 0, 0 }, i;
- #pragma omp parallel loop default (none) reduction (+:r, r2[:2], r3[:2]) shared (a) lastprivate (i)
+ #pragma omp parallel loop default (none) reduction (+:r, r2[ :2], r3[ :2]) shared (a) lastprivate (i)
for (i = 0; i < 1024; i++)
{
r += a[i];
;
#pragma omp target map(from: t[2:5]) /* { dg-error "is threadprivate variable" } */
;
- #pragma omp target map(tofrom: k[0.5:]) /* { dg-error "low bound \[^\n\r]* of array section does not have integral type" } */
+ #pragma omp target map(tofrom: k[0.5: ]) /* { dg-error "low bound \[^\n\r]* of array section does not have integral type" } */
;
- #pragma omp target map(from: l[:7.5f]) /* { dg-error "length \[^\n\r]* of array section does not have integral type" } */
+ #pragma omp target map(from: l[ :7.5f]) /* { dg-error "length \[^\n\r]* of array section does not have integral type" } */
;
- #pragma omp target map(to: m[p:]) /* { dg-error "low bound \[^\n\r]* of array section does not have integral type" } */
+ #pragma omp target map(to: m[p: ]) /* { dg-error "low bound \[^\n\r]* of array section does not have integral type" } */
;
- #pragma omp target map(tofrom: n[:p]) /* { dg-error "length \[^\n\r]* of array section does not have integral type" } */
+ #pragma omp target map(tofrom: n[ :p]) /* { dg-error "length \[^\n\r]* of array section does not have integral type" } */
;
#pragma omp target map(to: o[2:5]) /* { dg-error "does not have pointer or array type" } */
;
;
#pragma omp target map(alloc: s2) /* { dg-error "'s2' does not have a mappable type in 'map' clause" } */
;
- #pragma omp target map(to: a[:][:]) /* { dg-error "array type length expression must be specified" } */
+ #pragma omp target map(to: a[ : ][ : ]) /* { dg-error "array type length expression must be specified" } */
bar (&a[0][0]); /* { dg-error "referenced in target region does not have a mappable type" } */
- #pragma omp target map(tofrom: b[-1:]) /* { dg-error "negative low bound in array section" } */
+ #pragma omp target map(tofrom: b[-1: ]) /* { dg-error "negative low bound in array section" } */
bar (b);
- #pragma omp target map(tofrom: c[:-3][:]) /* { dg-error "negative length in array section" } */
+ #pragma omp target map(tofrom: c[ :-3][ : ]) /* { dg-error "negative length in array section" } */
bar (&c[0][0]);
- #pragma omp target map(from: d[11:]) /* { dg-error "low bound \[^\n\r]* above array section size" } */
+ #pragma omp target map(from: d[11: ]) /* { dg-error "low bound \[^\n\r]* above array section size" } */
bar (d);
- #pragma omp target map(to: e[:11]) /* { dg-error "length \[^\n\r]* above array section size" } */
+ #pragma omp target map(to: e[ :11]) /* { dg-error "length \[^\n\r]* above array section size" } */
bar (e);
#pragma omp target map(to: f[1:10]) /* { dg-error "high bound \[^\n\r]* above array section size" } */
bar (f);
- #pragma omp target map(from: g[:][0:10]) /* { dg-error "for array function parameter length expression must be specified" } */
+ #pragma omp target map(from: g[ : ][0:10]) /* { dg-error "for array function parameter length expression must be specified" } */
bar (&g[0][0]);
- #pragma omp target map(from: h[2:1][-1:]) /* { dg-error "negative low bound in array section" } */
+ #pragma omp target map(from: h[2:1][-1: ]) /* { dg-error "negative low bound in array section" } */
bar (&h[0][0]);
- #pragma omp target map(tofrom: h[:1][:-3]) /* { dg-error "negative length in array section" } */
+ #pragma omp target map(tofrom: h[ :1][ :-3]) /* { dg-error "negative length in array section" } */
bar (&h[0][0]);
- #pragma omp target map(i[:1][11:]) /* { dg-error "low bound \[^\n\r]* above array section size" } */
+ #pragma omp target map(i[ :1][11: ]) /* { dg-error "low bound \[^\n\r]* above array section size" } */
bar (&i[0][0]);
- #pragma omp target map(from: j[3:1][:10]) /* { dg-error "length \[^\n\r]* above array section size" } */
+ #pragma omp target map(from: j[3:1][ :10]) /* { dg-error "length \[^\n\r]* above array section size" } */
bar (&j[0][0]);
#pragma omp target map(to: j[30:1][5:5]) /* { dg-error "high bound \[^\n\r]* above array section size" } */
bar (&j[0][0]);
- #pragma omp target map(to: a2[:1][2:4])
+ #pragma omp target map(to: a2[ :1][2:4])
bar (&a2[0][0]);
- #pragma omp target map(a2[3:5][:])
+ #pragma omp target map(a2[3:5][ : ])
bar (&a2[0][0]);
- #pragma omp target map(to: a2[3:5][:10])
+ #pragma omp target map(to: a2[3:5][ :10])
bar (&a2[0][0]);
- #pragma omp target map(tofrom: b2[0:])
+ #pragma omp target map(tofrom: b2[0: ])
bar (b2);
- #pragma omp target map(tofrom: c2[:3][:])
+ #pragma omp target map(tofrom: c2[ :3][ : ])
bar (&c2[0][0]);
- #pragma omp target map(from: d2[9:])
+ #pragma omp target map(from: d2[9: ])
bar (d2);
- #pragma omp target map(to: e2[:10])
+ #pragma omp target map(to: e2[ :10])
bar (e2);
#pragma omp target map(to: f2[1:9])
bar (f2);
- #pragma omp target map(g2[:1][2:4])
+ #pragma omp target map(g2[ :1][2:4])
bar (&g2[0][0]);
- #pragma omp target map(from: h2[2:2][0:])
+ #pragma omp target map(from: h2[2:2][0: ])
bar (&h2[0][0]);
- #pragma omp target map(tofrom: h2[:1][:3])
+ #pragma omp target map(tofrom: h2[ :1][ :3])
bar (&h2[0][0]);
- #pragma omp target map(to: i2[:1][9:])
+ #pragma omp target map(to: i2[ :1][9: ])
bar (&i2[0][0]);
- #pragma omp target map(from: j2[3:4][:9])
+ #pragma omp target map(from: j2[3:4][ :9])
bar (&j2[0][0]);
#pragma omp target map(to: j2[30:1][5:4])
bar (&j2[0][0]);
#pragma omp target map(q[1:2])
;
- #pragma omp target map(tofrom: q[3:5][:10]) /* { dg-error "array section is not contiguous" } */
+ #pragma omp target map(tofrom: q[3:5][ :10]) /* { dg-error "array section is not contiguous" } */
;
- #pragma omp target map(r[3:][2:1][1:2])
+ #pragma omp target map(r[3: ][2:1][1:2])
;
- #pragma omp target map(r[3:][2:1][1:2][:][0:4])
+ #pragma omp target map(r[3: ][2:1][1:2][ : ][0:4])
;
- #pragma omp target map(r[3:][2:1][1:2][1:][0:4]) /* { dg-error "array section is not contiguous" } */
+ #pragma omp target map(r[3: ][2:1][1:2][1: ][0:4]) /* { dg-error "array section is not contiguous" } */
;
- #pragma omp target map(r[3:][2:1][1:2][:3][0:4]) /* { dg-error "array section is not contiguous" } */
+ #pragma omp target map(r[3: ][2:1][1:2][ :3][0:4]) /* { dg-error "array section is not contiguous" } */
;
- #pragma omp target map(r[3:][2:1][1:2][:][1:]) /* { dg-error "array section is not contiguous" } */
+ #pragma omp target map(r[3: ][2:1][1:2][ : ][1: ]) /* { dg-error "array section is not contiguous" } */
;
- #pragma omp target map(r[3:][2:1][1:2][:][:3]) /* { dg-error "array section is not contiguous" } */
+ #pragma omp target map(r[3: ][2:1][1:2][ : ][ :3]) /* { dg-error "array section is not contiguous" } */
;
}
;
#pragma omp target map (tofrom: r[-1:2])
;
- #pragma omp target map (tofrom: s[-1:2][:])
+ #pragma omp target map (tofrom: s[-1:2][ : ])
;
#pragma omp target map (tofrom: s[-1:2][-2:10]) /* { dg-error "negative low bound in array section in" } */
;
#pragma omp target map (tofrom: a[-1:2]) /* { dg-error "negative low bound in array section in" } */
;
- #pragma omp target map (tofrom: b[-1:2][0:]) /* { dg-error "negative low bound in array section in" } */
+ #pragma omp target map (tofrom: b[-1:2][0: ]) /* { dg-error "negative low bound in array section in" } */
;
#pragma omp target map (tofrom: b[1:2][-2:10]) /* { dg-error "negative low bound in array section in" } */
;
#pragma omp target map (tofrom: p[2:-3]) /* { dg-error "negative length in array section in" } */
;
- #pragma omp target map (tofrom: q[2:-3][:]) /* { dg-error "negative length in array section in" } */
+ #pragma omp target map (tofrom: q[2:-3][ : ]) /* { dg-error "negative length in array section in" } */
;
#pragma omp target map (tofrom: q[2:3][0:-1]) /* { dg-error "negative length in array section in" } */
;
#pragma omp target map (tofrom: r[2:-5]) /* { dg-error "negative length in array section in" } */
;
- #pragma omp target map (tofrom: s[2:-5][:]) /* { dg-error "negative length in array section in" } */
+ #pragma omp target map (tofrom: s[2:-5][ : ]) /* { dg-error "negative length in array section in" } */
;
#pragma omp target map (tofrom: s[2:5][0:-4]) /* { dg-error "negative length in array section in" } */
;
void test (Grid src1)
{
- #pragma omp target map(alloc:src1[:]) /* { dg-error "for array function parameter length expression must be specified" } */
+ #pragma omp target map(alloc:src1[ : ]) /* { dg-error "for array function parameter length expression must be specified" } */
{
src1[0] = 5;
}
void test2 (double src2[])
{
- #pragma omp target map(alloc:src2[:]) /* { dg-error "for array function parameter length expression must be specified" } */
+ #pragma omp target map(alloc:src2[ : ]) /* { dg-error "for array function parameter length expression must be specified" } */
{
src2[0] = 5;
}
void test3 (double *src3)
{
- #pragma omp target map(alloc:src3[:]) /* { dg-error "for pointer type length expression must be specified" } */
+ #pragma omp target map(alloc:src3[ : ]) /* { dg-error "for pointer type length expression must be specified" } */
{
src3[0] = 5;
}
int always[N];
int close;
- #pragma omp target map(always[:N])
+ #pragma omp target map(always[ :N])
;
- #pragma omp target map(close, always[:N])
+ #pragma omp target map(close, always[ :N])
;
- #pragma omp target map(always[:N], close)
+ #pragma omp target map(always[ :N], close)
;
}
void
foo (int *ptr)
{
- #pragma omp target map (ptr, ptr[:4])
+ #pragma omp target map (ptr, ptr[ :4])
#pragma omp parallel master
ptr[0] = 1;
}
void
bar (int *ptr)
{
- #pragma omp target parallel map (ptr[:4], ptr)
+ #pragma omp target parallel map (ptr[ :4], ptr)
#pragma omp master
ptr[0] = 1;
}
t.s = (S *) malloc (sizeof (S));
t.s->a = (int *) malloc (sizeof(int) * N);
- #pragma omp target map(from: t.s->a[:N])
+ #pragma omp target map(from: t.s->a[ :N])
{
t.s->a[0] = 1;
}
double *qq;
int i, k, nq;
- #pragma omp metadirective when(user={condition(0)}: target teams distribute parallel for collapse(2) map(qq[:0]) private(i)) \
- when(user={condition(0)}: target teams distribute parallel for map(qq[:0]) private(i)) \
- when(user={condition(1)}: target teams loop collapse(2) map(qq[:0]) private(i))
+ #pragma omp metadirective when(user={condition(0)}: target teams distribute parallel for collapse(2) map(qq[ :0]) private(i)) \
+ when(user={condition(0)}: target teams distribute parallel for map(qq[ :0]) private(i)) \
+ when(user={condition(1)}: target teams loop collapse(2) map(qq[ :0]) private(i))
for(k=0; k<blksize; k++)
{
#pragma omp metadirective when(user={condition(0)}: simd) default()
foo (int *a)
{
int i, j = 0;
- #pragma omp target teams distribute simd linear(i) map(a[:10])
+ #pragma omp target teams distribute simd linear(i) map(a[ :10])
for (i = 0; i < 10; i++)
a[i] = j;
return i;
void foo()
{
- #pragma omp task depend(out: a[:]) /* { dg-error "zero length array section in .depend. clause" } */
+ #pragma omp task depend(out: a[ : ]) /* { dg-error "zero length array section in .depend. clause" } */
{}
}
{
int i;
float f[3] = { 0.0f, 0.0f, 0.0f };
-#pragma omp parallel for default(none) reduction(+:f[:3])
+#pragma omp parallel for default(none) reduction(+:f[ :3])
for (i = 0; i < 1000; i++)
{
int j;
void
foo (int x)
{
- #pragma omp target update to (x, v[:]) /* { dg-error "for pointer type length expression must be specified" } */
+ #pragma omp target update to (x, v[ : ]) /* { dg-error "for pointer type length expression must be specified" } */
}
foo (void)
{
int a[6] = {};
- #pragma omp target simd reduction(+:a[:3])
+ #pragma omp target simd reduction(+:a[ :3])
for (int i = 0; i < 6; i++)
a[0]++;
- #pragma omp target simd reduction(+:a[:3]) map(always, tofrom: a)
+ #pragma omp target simd reduction(+:a[ :3]) map(always, tofrom: a)
for (int i = 0; i < 6; i++)
a[0]++;
- #pragma omp target simd reduction(+:a[:3]) map(always, tofrom: a[:6])
+ #pragma omp target simd reduction(+:a[ :3]) map(always, tofrom: a[ :6])
for (int i = 0; i < 6; i++)
a[0]++;
}
int c[10][10][0];
int d[0];
char e[12];
- #pragma omp parallel reduction(+: a[:4][:0][:7]) /* { dg-error "zero length array section" } */
+ #pragma omp parallel reduction(+: a[ :4][ :0][ :7]) /* { dg-error "zero length array section" } */
bar (a);
- #pragma omp parallel reduction(+: b[:7][0:0][:0]) /* { dg-error "zero length array section" } */
+ #pragma omp parallel reduction(+: b[ :7][0:0][ :0]) /* { dg-error "zero length array section" } */
bar (a);
- #pragma omp parallel reduction(+: c[:][:][0:]) /* { dg-error "zero length array section|for unknown bound array type length expression must be specified" } */
+ #pragma omp parallel reduction(+: c[ : ][ : ][0: ]) /* { dg-error "zero length array section|for unknown bound array type length expression must be specified" } */
bar (a);
- #pragma omp parallel reduction(+: a[:4][:0][:x]) /* { dg-error "zero length array section" } */
+ #pragma omp parallel reduction(+: a[ :4][ :0][ :x]) /* { dg-error "zero length array section" } */
bar (a);
- #pragma omp parallel reduction(+: b[:x][0:0][:0]) /* { dg-error "zero length array section" } */
+ #pragma omp parallel reduction(+: b[ :x][0:0][ :0]) /* { dg-error "zero length array section" } */
bar (a);
- #pragma omp parallel reduction(+: c[:][:x][0:]) /* { dg-error "zero length array section|for unknown bound array type length expression must be specified" } */
+ #pragma omp parallel reduction(+: c[ : ][ :x][0: ]) /* { dg-error "zero length array section|for unknown bound array type length expression must be specified" } */
bar (a);
#pragma omp parallel reduction(+: d) /* { dg-error "is a zero size array" } */
bar (a);
bar (a);
#pragma omp parallel reduction(+: a[0:2.5]) /* { dg-error "length \[^\n\r]* of array section does not have integral type" } */
bar (a);
- #pragma omp parallel reduction(+: f[:][0:2]) /* { dg-error "for unknown bound array type length expression must be specified" } */
+ #pragma omp parallel reduction(+: f[ : ][0:2]) /* { dg-error "for unknown bound array type length expression must be specified" } */
bar (a);
- #pragma omp parallel reduction(+: a[:][0:10]) /* { dg-error "for array function parameter length expression must be specified" } */
+ #pragma omp parallel reduction(+: a[ : ][0:10]) /* { dg-error "for array function parameter length expression must be specified" } */
bar (a);
- #pragma omp parallel reduction(+: a[:10][0:12]) /* { dg-error "above array section size" } */
+ #pragma omp parallel reduction(+: a[ :10][0:12]) /* { dg-error "above array section size" } */
bar (a);
#pragma omp parallel reduction(+: b[0:10][0:10]) /* { dg-error "array section is not contiguous" } */
bar (a);
#pragma omp scan inclusive (b) /* { dg-error "" } */
d[i] = b;
}
- #pragma omp for reduction (inscan, +: e[:2]) /* { dg-error "'inscan' 'reduction' clause with array section" } */
+ #pragma omp for reduction (inscan, +: e[ :2]) /* { dg-error "'inscan' 'reduction' clause with array section" } */
for (i = 0; i < 64; ++i)
{
{ e[0] += c[i]; e[1] += c[i]; }
- #pragma omp scan inclusive (a, e[:2]) /* { dg-error "" } */
+ #pragma omp scan inclusive (a, e[ :2]) /* { dg-error "" } */
{ d[i] = e[0]; f[i] = e[1]; }
}
#pragma omp for reduction (inscan, +: a) ordered /* { dg-error "'ordered' clause specified together with 'inscan' 'reduction' clause" } */
}
#pragma omp scope reduction (inscan, +: a) /* { dg-error "'inscan' 'reduction' clause on 'scope' construct" } */
;
- #pragma omp target parallel for reduction (inscan, +: a) map (c[:64], d[:64]) /* { dg-error "'inscan' 'reduction' clause on construct other than 'for', 'simd', 'for simd', 'parallel for', 'parallel for simd'" } */
+ #pragma omp target parallel for reduction (inscan, +: a) map (c[ :64], d[ :64]) /* { dg-error "'inscan' 'reduction' clause on construct other than 'for', 'simd', 'for simd', 'parallel for', 'parallel for simd'" } */
for (i = 0; i < 64; i++)
{
d[i] = a;
int a[4] = { 1, 2, 3, 4 };
int *p = &a[0];
int x = 5;
- #pragma omp target data map(to:p[:4])
+ #pragma omp target data map(to:p[ :4])
#pragma omp target data use_device_ptr(p)
#pragma omp target is_device_ptr(p)
{
void func (struct foo *f, int n, int m)
{
- #pragma omp target enter data map (to: f->vectors[m][:n])
- #pragma omp target enter data map (to: f->bars[n].vectors[:m])
- #pragma omp target enter data map (to: f->bars[n].vectors[:f->bars[n].num_vectors])
+ #pragma omp target enter data map (to: f->vectors[m][ :n])
+ #pragma omp target enter data map (to: f->bars[n].vectors[ :m])
+ #pragma omp target enter data map (to: f->bars[n].vectors[ :f->bars[n].num_vectors])
}
/* { dg-final { scan-tree-dump-times {map\(struct:\*f \[len: 1\]\) map\(alloc:[a-z0-9\._]+->vectors \[len: 0\]\) map\(to:\*_[0-9]+ \[len: _[0-9]+\]\) map\(attach:[a-z0-9\._]+->vectors \[bias: [^\]]+\]\) map\(attach:\*_[0-9]+ \[bias: [^\]]+\]\)} 1 "gimple" } } */
;
int z[3] = { 2, 5, 7 };
- #pragma omp target data map(z[:3]) use_device_addr(z)
- #pragma omp target has_device_addr(z[1:])
+ #pragma omp target data map(z[ :3]) use_device_addr(z)
+ #pragma omp target has_device_addr(z[1: ])
;
- #pragma omp target data map(z[:3]) use_device_addr(z)
+ #pragma omp target data map(z[ :3]) use_device_addr(z)
#pragma omp target has_device_addr(z[1])
;
- #pragma omp target data map(z[:3]) use_device_addr(z)
+ #pragma omp target data map(z[ :3]) use_device_addr(z)
#pragma omp target has_device_addr(z[1:2])
;
- #pragma omp target data map(z[:3]) use_device_addr(z)
- #pragma omp target has_device_addr(z[:2])
+ #pragma omp target data map(z[ :3]) use_device_addr(z)
+ #pragma omp target has_device_addr(z[ :2])
;
int w[3][4];
;
#pragma omp target data map(w) use_device_addr(w)
- #pragma omp target has_device_addr(w[:1][2:])
+ #pragma omp target has_device_addr(w[ :1][2: ])
;
int u[0];
for (int i = 0; i < N; i++)
a.ptr[i] = 0;
- #pragma omp target enter data map(to: a.ptr, a.ptr[:N])
+ #pragma omp target enter data map(to: a.ptr, a.ptr[ :N])
#pragma omp target
for (int i = 0; i < N; i++)
a.ptr[i] += 1;
- #pragma omp target update from(a.ptr[:N])
+ #pragma omp target update from(a.ptr[ :N])
for (int i = 0; i < N; i++)
if (a.ptr[i] != 1)
abort ();
- #pragma omp target map(a.ptr[:N])
+ #pragma omp target map(a.ptr[ :N])
for (int i = 0; i < N; i++)
a.ptr[i] += 1;
- #pragma omp target update from(a.ptr[:N])
+ #pragma omp target update from(a.ptr[ :N])
for (int i = 0; i < N; i++)
if (a.ptr[i] != 2)
abort ();
- #pragma omp target exit data map(from:a.ptr, a.ptr[:N])
+ #pragma omp target exit data map(from:a.ptr, a.ptr[ :N])
return 0;
}
void f (int **x, int **y)
{
- #pragma omp target map(iterator(i=0:DIM1), to: x[i][:DIM2])
+ #pragma omp target map(iterator(i=0:DIM1), to: x[i][ :DIM2])
;
- #pragma omp target map(iterator(i=0:DIM1), to: x[i][:DIM2], y[i][:DIM2])
+ #pragma omp target map(iterator(i=0:DIM1), to: x[i][ :DIM2], y[i][ :DIM2])
;
- #pragma omp target map(iterator(i=0:DIM1), to: x[i][:DIM2] + 2) /* { dg-message "unsupported map expression" } */
+ #pragma omp target map(iterator(i=0:DIM1), to: x[i][ :DIM2] + 2) /* { dg-message "unsupported map expression" } */
;
#pragma omp target map(iterator(i=0:DIM1), iterator(j=0:DIM2), to: x[i][j]) /* { dg-error "too many 'iterator' modifiers" } */
{
#pragma omp target \
map(to: x, y) \
- map(iterator(i=0:DIM1, j=0:DIM2), to: x[i][j][:DIM3], y[i][j][:DIM3]) \
+ map(iterator(i=0:DIM1, j=0:DIM2), to: x[i][j][ :DIM3], y[i][j][ :DIM3]) \
map(from: z) \
- map(iterator(i=0:DIM1), from: z[i][:DIM2])
+ map(iterator(i=0:DIM1), from: z[i][ :DIM2])
;
}
void f (int **x, float **y)
{
- #pragma omp target update to (iterator(i=0:DIM1): x[i][:DIM2])
+ #pragma omp target update to (iterator(i=0:DIM1): x[i][ :DIM2])
- #pragma omp target update to (iterator(i=0:DIM1): x[i][:DIM2], y[i][:DIM2])
+ #pragma omp target update to (iterator(i=0:DIM1): x[i][ :DIM2], y[i][ :DIM2])
- #pragma omp target update to (iterator(i=0:DIM1), present: x[i][:DIM2])
+ #pragma omp target update to (iterator(i=0:DIM1), present: x[i][ :DIM2])
#pragma omp target update to (iterator(i=0:DIM1), iterator(j=0:DIM2): x[i][j]) /* { dg-error "too many 'iterator' modifiers" } */
/* { dg-error "'#pragma omp target update' must contain at least one 'from' or 'to' clauses" "" { target *-*-* } .-1 } */
void f (int ***x, float ***y, double **z)
{
- #pragma omp target update to (iterator(i=0:DIM1, j=0:DIM2): x[i][j][:DIM3], y[i][j][:DIM3])
- #pragma omp target update from (iterator(i=0:DIM1): z[i][:DIM2])
+ #pragma omp target update to (iterator(i=0:DIM1, j=0:DIM2): x[i][j][ :DIM3], y[i][j][ :DIM3])
+ #pragma omp target update from (iterator(i=0:DIM1): z[i][ :DIM2])
}
/* { dg-final { scan-tree-dump-times "if \\(i <= 9\\) goto <D\.\[0-9\]+>; else goto <D\.\[0-9\]+>;" 2 "gimple" } } */
;
#pragma acc cache(t[2:5]) /* { dg-error "is threadprivate variable" } */
;
- #pragma acc cache(k[0.5:]) /* { dg-error "low bound \[^\n\r]* of array section does not have integral type" } */
+ #pragma acc cache(k[0.5: ]) /* { dg-error "low bound \[^\n\r]* of array section does not have integral type" } */
;
- #pragma acc cache(l[:7.5f]) /* { dg-error "length \[^\n\r]* of array section does not have integral type" } */
+ #pragma acc cache(l[ :7.5f]) /* { dg-error "length \[^\n\r]* of array section does not have integral type" } */
;
- #pragma acc cache(m[p:]) /* { dg-error "low bound \[^\n\r]* of array section does not have integral type" } */
+ #pragma acc cache(m[p: ]) /* { dg-error "low bound \[^\n\r]* of array section does not have integral type" } */
;
- #pragma acc cache(n[:p]) /* { dg-error "length \[^\n\r]* of array section does not have integral type" } */
+ #pragma acc cache(n[ :p]) /* { dg-error "length \[^\n\r]* of array section does not have integral type" } */
;
#pragma acc cache(o[2:5]) /* { dg-error "does not have pointer or array type" } */
;
;
#pragma acc cache(s2) /* { dg-error "expected '\\\['" } */
;
- #pragma acc cache(a[:][:]) /* { dg-error "array type length expression must be specified" } */
+ #pragma acc cache(a[ : ][ : ]) /* { dg-error "array type length expression must be specified" } */
bar (&a[0][0]);
- #pragma acc cache(b[-1:]) /* { dg-error "negative low bound in array section" } */
+ #pragma acc cache(b[-1: ]) /* { dg-error "negative low bound in array section" } */
bar (b);
- #pragma acc cache(c[:-3][:]) /* { dg-error "negative length in array section" } */
+ #pragma acc cache(c[ :-3][ : ]) /* { dg-error "negative length in array section" } */
bar (&c[0][0]);
- #pragma acc cache(d[11:]) /* { dg-error "low bound \[^\n\r]* above array section size" } */
+ #pragma acc cache(d[11: ]) /* { dg-error "low bound \[^\n\r]* above array section size" } */
bar (d);
- #pragma acc cache(e[:11]) /* { dg-error "length \[^\n\r]* above array section size" } */
+ #pragma acc cache(e[ :11]) /* { dg-error "length \[^\n\r]* above array section size" } */
bar (e);
#pragma acc cache(f[1:10]) /* { dg-error "high bound \[^\n\r]* above array section size" } */
bar (f);
- #pragma acc cache(g[:][0:10]) /* { dg-error "for array function parameter length expression must be specified" } */
+ #pragma acc cache(g[ : ][0:10]) /* { dg-error "for array function parameter length expression must be specified" } */
bar (&g[0][0]);
- #pragma acc cache(h[2:1][-1:]) /* { dg-error "negative low bound in array section" } */
+ #pragma acc cache(h[2:1][-1: ]) /* { dg-error "negative low bound in array section" } */
bar (&h[0][0]);
- #pragma acc cache(h[:1][:-3]) /* { dg-error "negative length in array section" } */
+ #pragma acc cache(h[ :1][ :-3]) /* { dg-error "negative length in array section" } */
bar (&h[0][0]);
- #pragma acc cache(i[:1][11:]) /* { dg-error "low bound \[^\n\r]* above array section size" } */
+ #pragma acc cache(i[ :1][11: ]) /* { dg-error "low bound \[^\n\r]* above array section size" } */
bar (&i[0][0]);
- #pragma acc cache(j[3:1][:10]) /* { dg-error "length \[^\n\r]* above array section size" } */
+ #pragma acc cache(j[3:1][ :10]) /* { dg-error "length \[^\n\r]* above array section size" } */
bar (&j[0][0]);
#pragma acc cache(j[30:1][5:5]) /* { dg-error "high bound \[^\n\r]* above array section size" } */
bar (&j[0][0]);
- #pragma acc cache(a2[:1][2:4])
+ #pragma acc cache(a2[ :1][2:4])
bar (&a2[0][0]);
- #pragma acc cache(a2[3:5][:])
+ #pragma acc cache(a2[3:5][ : ])
bar (&a2[0][0]);
- #pragma acc cache(a2[3:5][:10])
+ #pragma acc cache(a2[3:5][ :10])
bar (&a2[0][0]);
- #pragma acc cache(b2[0:])
+ #pragma acc cache(b2[0: ])
bar (b2);
- #pragma acc cache(c2[:3][:])
+ #pragma acc cache(c2[ :3][ : ])
bar (&c2[0][0]);
- #pragma acc cache(d2[9:])
+ #pragma acc cache(d2[9: ])
bar (d2);
- #pragma acc cache(e2[:10])
+ #pragma acc cache(e2[ :10])
bar (e2);
#pragma acc cache(f2[1:9])
bar (f2);
- #pragma acc cache(g2[:1][2:4])
+ #pragma acc cache(g2[ :1][2:4])
bar (&g2[0][0]);
- #pragma acc cache(h2[2:2][0:])
+ #pragma acc cache(h2[2:2][0: ])
bar (&h2[0][0]);
- #pragma acc cache(h2[:1][:3])
+ #pragma acc cache(h2[ :1][ :3])
bar (&h2[0][0]);
- #pragma acc cache(i2[:1][9:])
+ #pragma acc cache(i2[ :1][9: ])
bar (&i2[0][0]);
- #pragma acc cache(j2[3:4][:9])
+ #pragma acc cache(j2[3:4][ :9])
bar (&j2[0][0]);
#pragma acc cache(j2[30:1][5:4])
bar (&j2[0][0]);
#pragma acc cache(q[1:2])
;
- #pragma acc cache(q[3:5][:10]) /* { dg-error "array section is not contiguous" } */
+ #pragma acc cache(q[3:5][ :10]) /* { dg-error "array section is not contiguous" } */
;
- #pragma acc cache(r[3:][2:1][1:2])
+ #pragma acc cache(r[3: ][2:1][1:2])
;
- #pragma acc cache(r[3:][2:1][1:2][:][0:4])
+ #pragma acc cache(r[3: ][2:1][1:2][ : ][0:4])
;
- #pragma acc cache(r[3:][2:1][1:2][1:][0:4]) /* { dg-error "array section is not contiguous" } */
+ #pragma acc cache(r[3: ][2:1][1:2][1: ][0:4]) /* { dg-error "array section is not contiguous" } */
;
- #pragma acc cache(r[3:][2:1][1:2][:3][0:4]) /* { dg-error "array section is not contiguous" } */
+ #pragma acc cache(r[3: ][2:1][1:2][ :3][0:4]) /* { dg-error "array section is not contiguous" } */
;
- #pragma acc cache(r[3:][2:1][1:2][:][1:]) /* { dg-error "array section is not contiguous" } */
+ #pragma acc cache(r[3: ][2:1][1:2][ : ][1: ]) /* { dg-error "array section is not contiguous" } */
;
- #pragma acc cache(r[3:][2:1][1:2][:][:3]) /* { dg-error "array section is not contiguous" } */
+ #pragma acc cache(r[3: ][2:1][1:2][ : ][ :3]) /* { dg-error "array section is not contiguous" } */
;
}
;
#pragma acc cache (r[-1:2])
;
- #pragma acc cache (s[-1:2][:])
+ #pragma acc cache (s[-1:2][ : ])
;
#pragma acc cache (s[-1:2][-2:10]) /* { dg-error "negative low bound in array section in" } */
;
#pragma acc cache (a[-1:2]) /* { dg-error "negative low bound in array section in" } */
;
- #pragma acc cache (b[-1:2][0:]) /* { dg-error "negative low bound in array section in" } */
+ #pragma acc cache (b[-1:2][0: ]) /* { dg-error "negative low bound in array section in" } */
;
#pragma acc cache (b[1:2][-2:10]) /* { dg-error "negative low bound in array section in" } */
;
#pragma acc cache (p[2:-3]) /* { dg-error "negative length in array section in" } */
;
- #pragma acc cache (q[2:-3][:]) /* { dg-error "negative length in array section in" } */
+ #pragma acc cache (q[2:-3][ : ]) /* { dg-error "negative length in array section in" } */
;
#pragma acc cache (q[2:3][0:-1]) /* { dg-error "negative length in array section in" } */
;
#pragma acc cache (r[2:-5]) /* { dg-error "negative length in array section in" } */
;
- #pragma acc cache (s[2:-5][:]) /* { dg-error "negative length in array section in" } */
+ #pragma acc cache (s[2:-5][ : ]) /* { dg-error "negative length in array section in" } */
;
#pragma acc cache (s[2:5][0:-4]) /* { dg-error "negative length in array section in" } */
;
;
#pragma acc parallel copyout(t[2:5]) /* { dg-error "is threadprivate variable" } */
;
- #pragma acc parallel copy(k[0.5:]) /* { dg-error "low bound \[^\n\r]* of array section does not have integral type" } */
+ #pragma acc parallel copy(k[0.5: ]) /* { dg-error "low bound \[^\n\r]* of array section does not have integral type" } */
;
- #pragma acc parallel copyout(l[:7.5f]) /* { dg-error "length \[^\n\r]* of array section does not have integral type" } */
+ #pragma acc parallel copyout(l[ :7.5f]) /* { dg-error "length \[^\n\r]* of array section does not have integral type" } */
;
- #pragma acc parallel copyin(m[p:]) /* { dg-error "low bound \[^\n\r]* of array section does not have integral type" } */
+ #pragma acc parallel copyin(m[p: ]) /* { dg-error "low bound \[^\n\r]* of array section does not have integral type" } */
;
- #pragma acc parallel copy(n[:p]) /* { dg-error "length \[^\n\r]* of array section does not have integral type" } */
+ #pragma acc parallel copy(n[ :p]) /* { dg-error "length \[^\n\r]* of array section does not have integral type" } */
;
#pragma acc parallel copyin(o[2:5]) /* { dg-error "does not have pointer or array type" } */
;
;
#pragma acc parallel create(s2) /* { dg-error "'s2' does not have a mappable type in 'map' clause" } */
;
- #pragma acc parallel copyin(a[:][:]) /* { dg-error "array type length expression must be specified" } */
+ #pragma acc parallel copyin(a[ : ][ : ]) /* { dg-error "array type length expression must be specified" } */
bar (&a[0][0]); /* { dg-error "referenced in target region does not have a mappable type" "PR97996" { xfail *-*-* } } */
- #pragma acc parallel copy(b[-1:]) /* { dg-error "negative low bound in array section" } */
+ #pragma acc parallel copy(b[-1: ]) /* { dg-error "negative low bound in array section" } */
bar (b);
- #pragma acc parallel copy(c[:-3][:]) /* { dg-error "negative length in array section" } */
+ #pragma acc parallel copy(c[ :-3][ : ]) /* { dg-error "negative length in array section" } */
bar (&c[0][0]);
- #pragma acc parallel copyout(d[11:]) /* { dg-error "low bound \[^\n\r]* above array section size" } */
+ #pragma acc parallel copyout(d[11: ]) /* { dg-error "low bound \[^\n\r]* above array section size" } */
bar (d);
- #pragma acc parallel copyin(e[:11]) /* { dg-error "length \[^\n\r]* above array section size" } */
+ #pragma acc parallel copyin(e[ :11]) /* { dg-error "length \[^\n\r]* above array section size" } */
bar (e);
#pragma acc parallel copyin(f[1:10]) /* { dg-error "high bound \[^\n\r]* above array section size" } */
bar (f);
- #pragma acc parallel copyout(g[:][0:10]) /* { dg-error "for array function parameter length expression must be specified" } */
+ #pragma acc parallel copyout(g[ : ][0:10]) /* { dg-error "for array function parameter length expression must be specified" } */
bar (&g[0][0]);
- #pragma acc parallel copyout(h[2:1][-1:]) /* { dg-error "negative low bound in array section" } */
+ #pragma acc parallel copyout(h[2:1][-1: ]) /* { dg-error "negative low bound in array section" } */
bar (&h[0][0]);
- #pragma acc parallel copy(h[:1][:-3]) /* { dg-error "negative length in array section" } */
+ #pragma acc parallel copy(h[ :1][ :-3]) /* { dg-error "negative length in array section" } */
bar (&h[0][0]);
- #pragma acc parallel copy(i[:1][11:]) /* { dg-error "low bound \[^\n\r]* above array section size" } */
+ #pragma acc parallel copy(i[ :1][11: ]) /* { dg-error "low bound \[^\n\r]* above array section size" } */
bar (&i[0][0]);
- #pragma acc parallel copyout(j[3:1][:10]) /* { dg-error "length \[^\n\r]* above array section size" } */
+ #pragma acc parallel copyout(j[3:1][ :10]) /* { dg-error "length \[^\n\r]* above array section size" } */
bar (&j[0][0]);
#pragma acc parallel copyin(j[30:1][5:5]) /* { dg-error "high bound \[^\n\r]* above array section size" } */
bar (&j[0][0]);
- #pragma acc parallel copyin(a2[:1][2:4])
+ #pragma acc parallel copyin(a2[ :1][2:4])
bar (&a2[0][0]);
- #pragma acc parallel copy(a2[3:5][:])
+ #pragma acc parallel copy(a2[3:5][ : ])
bar (&a2[0][0]);
- #pragma acc parallel copyin(a2[3:5][:10])
+ #pragma acc parallel copyin(a2[3:5][ :10])
bar (&a2[0][0]);
- #pragma acc parallel copy(b2[0:])
+ #pragma acc parallel copy(b2[0: ])
bar (b2);
- #pragma acc parallel copy(c2[:3][:])
+ #pragma acc parallel copy(c2[ :3][ : ])
bar (&c2[0][0]);
- #pragma acc parallel copyout(d2[9:])
+ #pragma acc parallel copyout(d2[9: ])
bar (d2);
- #pragma acc parallel copyin(e2[:10])
+ #pragma acc parallel copyin(e2[ :10])
bar (e2);
#pragma acc parallel copyin(f2[1:9])
bar (f2);
- #pragma acc parallel copy(g2[:1][2:4])
+ #pragma acc parallel copy(g2[ :1][2:4])
bar (&g2[0][0]);
- #pragma acc parallel copyout(h2[2:2][0:])
+ #pragma acc parallel copyout(h2[2:2][0: ])
bar (&h2[0][0]);
- #pragma acc parallel copy(h2[:1][:3])
+ #pragma acc parallel copy(h2[ :1][ :3])
bar (&h2[0][0]);
- #pragma acc parallel copyin(i2[:1][9:])
+ #pragma acc parallel copyin(i2[ :1][9: ])
bar (&i2[0][0]);
- #pragma acc parallel copyout(j2[3:4][:9])
+ #pragma acc parallel copyout(j2[3:4][ :9])
bar (&j2[0][0]);
#pragma acc parallel copyin(j2[30:1][5:4])
bar (&j2[0][0]);
#pragma acc parallel copy(q[1:2])
;
- #pragma acc parallel copy(q[3:5][:10]) /* { dg-error "array section is not contiguous" } */
+ #pragma acc parallel copy(q[3:5][ :10]) /* { dg-error "array section is not contiguous" } */
;
- #pragma acc parallel copy(r[3:][2:1][1:2])
+ #pragma acc parallel copy(r[3: ][2:1][1:2])
;
- #pragma acc parallel copy(r[3:][2:1][1:2][:][0:4])
+ #pragma acc parallel copy(r[3: ][2:1][1:2][ : ][0:4])
;
- #pragma acc parallel copy(r[3:][2:1][1:2][1:][0:4]) /* { dg-error "array section is not contiguous" } */
+ #pragma acc parallel copy(r[3: ][2:1][1:2][1: ][0:4]) /* { dg-error "array section is not contiguous" } */
;
- #pragma acc parallel copy(r[3:][2:1][1:2][:3][0:4]) /* { dg-error "array section is not contiguous" } */
+ #pragma acc parallel copy(r[3: ][2:1][1:2][ :3][0:4]) /* { dg-error "array section is not contiguous" } */
;
- #pragma acc parallel copy(r[3:][2:1][1:2][:][1:]) /* { dg-error "array section is not contiguous" } */
+ #pragma acc parallel copy(r[3: ][2:1][1:2][ : ][1: ]) /* { dg-error "array section is not contiguous" } */
;
- #pragma acc parallel copy(r[3:][2:1][1:2][:][:3]) /* { dg-error "array section is not contiguous" } */
+ #pragma acc parallel copy(r[3: ][2:1][1:2][ : ][ :3]) /* { dg-error "array section is not contiguous" } */
;
}
/* See also corresponding OpenMP variant: '../gomp/map-2.C'. */
+/* Array sections without spaces between [ and : or : and ] are incompatible
+ with C++26. */
+/* { dg-skip-if "array sections vs. C++26" { c++26 } } */
+
template <int N>
void
foo (int *p, int (*q)[10], int r[10], int s[10][10])
#pragma acc exit data detach(ra)
}
-#pragma acc enter data attach(rz[:5]) /* { dg-error "expected single pointer in .attach. clause" } */
+#pragma acc enter data attach(rz[ :5]) /* { dg-error "expected single pointer in .attach. clause" } */
/* { dg-error "has no data movement clause" "" { target *-*-* } .-1 } */
-#pragma acc exit data detach(rz[:5]) /* { dg-error "expected single pointer in .detach. clause" } */
+#pragma acc exit data detach(rz[ :5]) /* { dg-error "expected single pointer in .detach. clause" } */
/* { dg-error "has no data movement clause" "" { target *-*-* } .-1 } */
-#pragma acc enter data attach(rz[1:]) /* { dg-error "expected single pointer in .attach. clause" } */
+#pragma acc enter data attach(rz[1: ]) /* { dg-error "expected single pointer in .attach. clause" } */
/* { dg-error "has no data movement clause" "" { target *-*-* } .-1 } */
-#pragma acc exit data detach(rz[1:]) /* { dg-error "expected single pointer in .detach. clause" } */
+#pragma acc exit data detach(rz[1: ]) /* { dg-error "expected single pointer in .detach. clause" } */
/* { dg-error "has no data movement clause" "" { target *-*-* } .-1 } */
-#pragma acc enter data attach(rz[:]) /* { dg-error "expected single pointer in .attach. clause" } */
+#pragma acc enter data attach(rz[ : ]) /* { dg-error "expected single pointer in .attach. clause" } */
/* { dg-error "has no data movement clause" "" { target *-*-* } .-1 } */
-#pragma acc exit data detach(rz[:]) /* { dg-error "expected single pointer in .detach. clause" } */
+#pragma acc exit data detach(rz[ : ]) /* { dg-error "expected single pointer in .detach. clause" } */
/* { dg-error "has no data movement clause" "" { target *-*-* } .-1 } */
#pragma acc enter data attach(rz[3]) /* { dg-error "expected pointer in .attach. clause" } */
/* { dg-error "has no data movement clause" "" { target *-*-* } .-1 } */
+// Array sections without spaces between [ and : or : and ] are incompatible
+// with C++26.
+// { dg-skip-if "array sections vs. C++26" { c++26 } }
+
template <typename T>
void
foo (T &x, T (&y)[4], T *&z, int &u, int (&v)[4], int *&w)
#pragma omp target map(arr1[::x: ::y])
// { dg-final { scan-tree-dump {map\(tofrom:arr1\[SAVE_EXPR <x>\] \[len: \(sizetype\) y \* [0-9]+\]\) map\(firstprivate:arr1 \[pointer assign, bias: \((?:long )?int\) &arr1\[SAVE_EXPR <x>\] - \((?:long )?int\) &arr1\]\)} "original" } }
{ }
-#pragma omp target map(arr1[::x:])
+#pragma omp target map(arr1[::x: ])
// { dg-final { scan-tree-dump {map\(tofrom:arr1\[SAVE_EXPR <x>\] \[len: \(40 - \(sizetype\) SAVE_EXPR <x>\) \* [0-9]+\]\) map\(firstprivate:arr1 \[pointer assign, bias: \((?:long )?int\) &arr1\[SAVE_EXPR <x>\] - \((?:long )?int\) &arr1\]\)} "original" } }
{ }
-#pragma omp target map(arr1[: ::y])
+#pragma omp target map(arr1[ : ::y])
// { dg-final { scan-tree-dump {map\(tofrom:arr1\[0\] \[len: \(sizetype\) y \* [0-9]+\]\) map\(firstprivate:arr1 \[pointer assign, bias: 0\]\)} "original" } }
{ }
return ::x + ::y;
#pragma omp target map(arr1[::x: ::y])
// { dg-final { scan-tree-dump {map\(tofrom:arr1\[SAVE_EXPR <x>\] \[len: \(sizetype\) y \* [0-9]+\]\) map\(firstprivate:arr1 \[pointer assign, bias: \((?:long )?int\) &arr1\[SAVE_EXPR <x>\] - \((?:long )?int\) &arr1\]\)} "original" } }
{ }
-#pragma omp target map(arr1[::x:])
+#pragma omp target map(arr1[::x: ])
// { dg-final { scan-tree-dump {map\(tofrom:arr1\[SAVE_EXPR <x>\] \[len: \(40 - \(sizetype\) SAVE_EXPR <x>\) \* [0-9]+\]\) map\(firstprivate:arr1 \[pointer assign, bias: \((?:long )?int\) &arr1\[SAVE_EXPR <x>\] - \((?:long )?int\) &arr1\]\)} "original" } }
{ }
-#pragma omp target map(arr1[: ::y])
+#pragma omp target map(arr1[ : ::y])
// { dg-final { scan-tree-dump {map\(tofrom:arr1\[0\] \[len: \(sizetype\) y \* [0-9]+\]\) map\(firstprivate:arr1 \[pointer assign, bias: 0\]\)} "original" } }
{ }
}
void foo()
{
int arr1[40];
-#pragma omp target map(arr1[4,C:])
+#pragma omp target map(arr1[4,C: ])
// { dg-warning "top-level comma expression in array subscript is deprecated" "" { target c++20_only } .-1 }
// { dg-error "cannot use multidimensional subscript in OpenMP array section" "" { target c++23 } .-2 }
{ }
// { dg-warning "top-level comma expression in array subscript is deprecated" "" { target c++20_only } .-1 }
// { dg-error "cannot use multidimensional subscript in OpenMP array section" "" { target c++23 } .-2 }
{ }
-#pragma omp target map(arr1[:8,C,10])
+#pragma omp target map(arr1[ :8,C,10])
// { dg-warning "top-level comma expression in array subscript is deprecated" "" { target c++20_only } .-1 }
// { dg-error "cannot use multidimensional subscript in OpenMP array section" "" { target c++23 } .-2 }
{ }
int main()
{
int arr1[40];
-#pragma omp target map(arr1[4,5:])
+#pragma omp target map(arr1[4,5: ])
// { dg-warning "top-level comma expression in array subscript is deprecated" "" { target c++20_only } .-1 }
// { dg-error "cannot use multidimensional subscript in OpenMP array section" "" { target c++23 } .-2 }
{ }
// { dg-warning "top-level comma expression in array subscript is deprecated" "" { target c++20_only } .-1 }
// { dg-error "cannot use multidimensional subscript in OpenMP array section" "" { target c++23 } .-2 }
{ }
-#pragma omp target map(arr1[:8,9,10])
+#pragma omp target map(arr1[ :8,9,10])
// { dg-warning "top-level comma expression in array subscript is deprecated" "" { target c++20_only } .-1 }
// { dg-error "cannot use multidimensional subscript in OpenMP array section" "" { target c++23 } .-2 }
{ }
void foo()
{
int arr1[40];
-#pragma omp target map(arr1[4,C:])
+#pragma omp target map(arr1[4,C: ])
// { dg-error "cannot use multidimensional subscript in OpenMP array section" "" { target *-*-* } .-1 }
{ }
#pragma omp target map(arr1[4,5:C,7])
// { dg-error "cannot use multidimensional subscript in OpenMP array section" "" { target *-*-* } .-1 }
{ }
-#pragma omp target map(arr1[:8,C,10])
+#pragma omp target map(arr1[ :8,C,10])
// { dg-error "cannot use multidimensional subscript in OpenMP array section" "" { target *-*-* } .-1 }
{ }
}
int main()
{
int arr1[40];
-#pragma omp target map(arr1[4,5:])
+#pragma omp target map(arr1[4,5: ])
// { dg-error "cannot use multidimensional subscript in OpenMP array section" "" { target *-*-* } .-1 }
{ }
#pragma omp target map(arr1[4,5:6,7])
// { dg-error "cannot use multidimensional subscript in OpenMP array section" "" { target *-*-* } .-1 }
{ }
-#pragma omp target map(arr1[:8,9,10])
+#pragma omp target map(arr1[ :8,9,10])
// { dg-error "cannot use multidimensional subscript in OpenMP array section" "" { target *-*-* } .-1 }
{ }
#pragma omp target map(arr1[arr2[4:5]:arr2[6:7]])
// { dg-error {low bound 'arr2\[4:5\]' of array section does not have integral type} "" { target *-*-* } .-1 }
{ }
-#pragma omp target map(arr1[arr2[:1]:arr2[6:1]])
+#pragma omp target map(arr1[arr2[ :1]:arr2[6:1]])
// { dg-error {low bound 'arr2\[:1\]' of array section does not have integral type} "" { target *-*-* } .-1 }
{ }
#pragma omp target map(arr1[x:arr2[6:1]])
#pragma omp target map(arr1[arr2[4:5]:arr2[6:7]])
// { dg-error {low bound 'arr2\[4:5\]' of array section does not have integral type} "" { target *-*-* } .-1 }
{ }
-#pragma omp target map(arr1[arr2[:1]:arr2[6:1]])
+#pragma omp target map(arr1[arr2[ :1]:arr2[6:1]])
// { dg-error {low bound 'arr2\[:1\]' of array section does not have integral type} "" { target *-*-* } .-1 }
{ }
#pragma omp target map(arr1[x:arr2[6:1]])
#define N 64
-#pragma omp declare mapper (S w) map(w.size, w.ptr, w.ptr[:w.size])
-#pragma omp declare mapper (foo:S w) map(to:w.size, w.ptr) map(w.ptr[:w.size])
+#pragma omp declare mapper (S w) map(w.size, w.ptr, w.ptr[ :w.size])
+#pragma omp declare mapper (foo:S w) map(to:w.size, w.ptr) map(w.ptr[ :w.size])
int main (int argc, char *argv[])
{
s.ptr = new int[N];
s.size = N;
-#pragma omp declare mapper (bar:S w) map(w.size, w.ptr, w.ptr[:w.size])
+#pragma omp declare mapper (bar:S w) map(w.size, w.ptr, w.ptr[ :w.size])
#pragma omp target
{
int main (int argc, char *argv[])
{
-#pragma omp declare mapper (S v) map(v.size, v.ptr[:v.size]) // { dg-note "'#pragma omp declare mapper \\(S\\)' previously declared here" }
+#pragma omp declare mapper (S v) map(v.size, v.ptr[ :v.size]) // { dg-note "'#pragma omp declare mapper \\(S\\)' previously declared here" }
/* This one's a duplicate. */
#pragma omp declare mapper (default: S v) map (to: v.size) map (v) // { dg-error "redeclaration of '#pragma omp declare mapper \\(S\\)'" }
{
#pragma omp task depend(out: t[2:5])
;
- #pragma omp task depend(inout: k[0.5:]) // { dg-error "low bound \[^\n\r]* of array section does not have integral type" }
+ #pragma omp task depend(inout: k[0.5: ]) // { dg-error "low bound \[^\n\r]* of array section does not have integral type" }
;
- #pragma omp task depend(in: l[:7.5f]) // { dg-error "length \[^\n\r]* of array section does not have integral type" }
+ #pragma omp task depend(in: l[ :7.5f]) // { dg-error "length \[^\n\r]* of array section does not have integral type" }
;
- #pragma omp task depend(out: m[p:]) // { dg-error "low bound \[^\n\r]* of array section does not have integral type" }
+ #pragma omp task depend(out: m[p: ]) // { dg-error "low bound \[^\n\r]* of array section does not have integral type" }
;
- #pragma omp task depend(inout: n[:p]) // { dg-error "length \[^\n\r]* of array section does not have integral type" }
+ #pragma omp task depend(inout: n[ :p]) // { dg-error "length \[^\n\r]* of array section does not have integral type" }
;
#pragma omp task depend(in: o[2:5]) // { dg-error "does not have pointer or array type" }
;
- #pragma omp task depend(out: a[:][2:4]) // { dg-error "array type length expression must be specified" }
+ #pragma omp task depend(out: a[ : ][2:4]) // { dg-error "array type length expression must be specified" }
;
- #pragma omp task depend(in: d[11:]) // { dg-error "low bound \[^\n\r]* above array section size" }
+ #pragma omp task depend(in: d[11: ]) // { dg-error "low bound \[^\n\r]* above array section size" }
;
- #pragma omp task depend(out: e[:11]) // { dg-error "length \[^\n\r]* above array section size" }
+ #pragma omp task depend(out: e[ :11]) // { dg-error "length \[^\n\r]* above array section size" }
;
#pragma omp task depend(out: f[1:10]) // { dg-error "high bound \[^\n\r]* above array section size" }
;
- #pragma omp task depend(in: g[:][2:4]) // { dg-error "for array function parameter length expression must be specified" }
+ #pragma omp task depend(in: g[ : ][2:4]) // { dg-error "for array function parameter length expression must be specified" }
;
- #pragma omp task depend(out: i[:1][11:]) // { dg-error "low bound \[^\n\r]* above array section size" }
+ #pragma omp task depend(out: i[ :1][11: ]) // { dg-error "low bound \[^\n\r]* above array section size" }
;
- #pragma omp task depend(in: j[3:4][:10]) // { dg-error "length \[^\n\r]* above array section size" }
+ #pragma omp task depend(in: j[3:4][ :10]) // { dg-error "length \[^\n\r]* above array section size" }
;
#pragma omp task depend(out: j[30:10][5:5]) // { dg-error "high bound \[^\n\r]* above array section size" }
;
- #pragma omp task depend(out: a2[:3][2:4])
+ #pragma omp task depend(out: a2[ :3][2:4])
;
- #pragma omp task depend(inout: b2[0:])
+ #pragma omp task depend(inout: b2[0: ])
;
- #pragma omp task depend(inout: c2[:3][1:1])
+ #pragma omp task depend(inout: c2[ :3][1:1])
;
- #pragma omp task depend(in: d2[9:])
+ #pragma omp task depend(in: d2[9: ])
;
- #pragma omp task depend(out: e2[:10])
+ #pragma omp task depend(out: e2[ :10])
;
#pragma omp task depend(out: f2[1:9])
;
- #pragma omp task depend(in: g2[:2][2:4])
+ #pragma omp task depend(in: g2[ :2][2:4])
;
- #pragma omp task depend(in: h2[2:2][0:])
+ #pragma omp task depend(in: h2[2:2][0: ])
;
- #pragma omp task depend(inout: h2[:1][:3])
+ #pragma omp task depend(inout: h2[ :1][ :3])
;
- #pragma omp task depend(out: i2[:1][9:])
+ #pragma omp task depend(out: i2[ :1][9: ])
;
- #pragma omp task depend(in: j2[3:4][:9])
+ #pragma omp task depend(in: j2[3:4][ :9])
;
#pragma omp task depend(out: j2[30:10][5:4])
;
;
#pragma omp task depend(out: t[2:5])
;
- #pragma omp task depend(inout: k[0.5:]) // { dg-error "low bound \[^\n\r]* of array section does not have integral type" }
+ #pragma omp task depend(inout: k[0.5: ]) // { dg-error "low bound \[^\n\r]* of array section does not have integral type" }
;
- #pragma omp task depend(in: l[:7.5f]) // { dg-error "length \[^\n\r]* of array section does not have integral type" }
+ #pragma omp task depend(in: l[ :7.5f]) // { dg-error "length \[^\n\r]* of array section does not have integral type" }
;
- #pragma omp task depend(out: m[p:]) // { dg-error "low bound \[^\n\r]* of array section does not have integral type" }
+ #pragma omp task depend(out: m[p: ]) // { dg-error "low bound \[^\n\r]* of array section does not have integral type" }
;
- #pragma omp task depend(inout: n[:p]) // { dg-error "length \[^\n\r]* of array section does not have integral type" }
+ #pragma omp task depend(inout: n[ :p]) // { dg-error "length \[^\n\r]* of array section does not have integral type" }
;
#pragma omp task depend(in: o[2:5]) // { dg-error "does not have pointer or array type" }
;
- #pragma omp task depend(out: a[:][2:4]) // { dg-error "array type length expression must be specified" }
+ #pragma omp task depend(out: a[ : ][2:4]) // { dg-error "array type length expression must be specified" }
;
- #pragma omp task depend(inout: b[-1:]) // { dg-error "negative low bound in array section" }
+ #pragma omp task depend(inout: b[-1: ]) // { dg-error "negative low bound in array section" }
;
- #pragma omp task depend(inout: c[:-3][1:1]) // { dg-error "negative length in array section" }
+ #pragma omp task depend(inout: c[ :-3][1:1]) // { dg-error "negative length in array section" }
;
- #pragma omp task depend(in: d[11:]) // { dg-error "low bound \[^\n\r]* above array section size" }
+ #pragma omp task depend(in: d[11: ]) // { dg-error "low bound \[^\n\r]* above array section size" }
;
- #pragma omp task depend(out: e[:11]) // { dg-error "length \[^\n\r]* above array section size" }
+ #pragma omp task depend(out: e[ :11]) // { dg-error "length \[^\n\r]* above array section size" }
;
#pragma omp task depend(out: f[1:10]) // { dg-error "high bound \[^\n\r]* above array section size" }
;
- #pragma omp task depend(in: g[:][2:4]) // { dg-error "for array function parameter length expression must be specified" }
+ #pragma omp task depend(in: g[ : ][2:4]) // { dg-error "for array function parameter length expression must be specified" }
;
- #pragma omp task depend(in: h[2:2][-1:]) // { dg-error "negative low bound in array section" }
+ #pragma omp task depend(in: h[2:2][-1: ]) // { dg-error "negative low bound in array section" }
;
- #pragma omp task depend(inout: h[:1][:-3]) // { dg-error "negative length in array section" }
+ #pragma omp task depend(inout: h[ :1][ :-3]) // { dg-error "negative length in array section" }
;
- #pragma omp task depend(out: i[:1][11:]) // { dg-error "low bound \[^\n\r]* above array section size" }
+ #pragma omp task depend(out: i[ :1][11: ]) // { dg-error "low bound \[^\n\r]* above array section size" }
;
- #pragma omp task depend(in: j[3:4][:10]) // { dg-error "length \[^\n\r]* above array section size" }
+ #pragma omp task depend(in: j[3:4][ :10]) // { dg-error "length \[^\n\r]* above array section size" }
;
#pragma omp task depend(out: j[30:10][5:5]) // { dg-error "high bound \[^\n\r]* above array section size" }
;
- #pragma omp task depend(out: a2[:3][2:4])
+ #pragma omp task depend(out: a2[ :3][2:4])
;
- #pragma omp task depend(inout: b2[0:])
+ #pragma omp task depend(inout: b2[0: ])
;
- #pragma omp task depend(inout: c2[:3][1:1])
+ #pragma omp task depend(inout: c2[ :3][1:1])
;
- #pragma omp task depend(in: d2[9:])
+ #pragma omp task depend(in: d2[9: ])
;
- #pragma omp task depend(out: e2[:10])
+ #pragma omp task depend(out: e2[ :10])
;
#pragma omp task depend(out: f2[1:9])
;
- #pragma omp task depend(in: g2[:2][2:4])
+ #pragma omp task depend(in: g2[ :2][2:4])
;
- #pragma omp task depend(in: h2[2:2][0:])
+ #pragma omp task depend(in: h2[2:2][0: ])
;
- #pragma omp task depend(inout: h2[:1][:3])
+ #pragma omp task depend(inout: h2[ :1][ :3])
;
- #pragma omp task depend(out: i2[:1][9:])
+ #pragma omp task depend(out: i2[ :1][9: ])
;
- #pragma omp task depend(in: j2[3:4][:9])
+ #pragma omp task depend(in: j2[3:4][ :9])
;
#pragma omp task depend(out: j2[30:10][5:4])
;
for (int i = 0; i < 10; i++)
{
-#pragma omp target map(choose(&a, &b, i)->x[:10])
+#pragma omp target map(choose(&a, &b, i)->x[ :10])
/* { dg-message {sorry, unimplemented: unsupported map expression 'choose\(\(& a\), \(& b\), i\)->S::x\[0\]'} "" { target *-*-* } .-1 } */
for (int j = 0; j < 10; j++)
choose (&a, &b, i)->x[j]++;
;
#pragma omp target map(from: t[2:5]) /* { dg-error "is threadprivate variable" } */
;
- #pragma omp target map(tofrom: k[0.5:]) /* { dg-error "low bound \[^\n\r]* of array section does not have integral type" } */
+ #pragma omp target map(tofrom: k[0.5: ]) /* { dg-error "low bound \[^\n\r]* of array section does not have integral type" } */
;
- #pragma omp target map(from: l[:7.5f]) /* { dg-error "length \[^\n\r]* of array section does not have integral type" } */
+ #pragma omp target map(from: l[ :7.5f]) /* { dg-error "length \[^\n\r]* of array section does not have integral type" } */
;
- #pragma omp target map(to: m[p:]) /* { dg-error "low bound \[^\n\r]* of array section does not have integral type" } */
+ #pragma omp target map(to: m[p: ]) /* { dg-error "low bound \[^\n\r]* of array section does not have integral type" } */
;
- #pragma omp target map(tofrom: n[:p]) /* { dg-error "length \[^\n\r]* of array section does not have integral type" } */
+ #pragma omp target map(tofrom: n[ :p]) /* { dg-error "length \[^\n\r]* of array section does not have integral type" } */
;
#pragma omp target map(to: o[2:5]) /* { dg-error "does not have pointer or array type" } */
;
;
#pragma omp target map(alloc: s2) /* { dg-error "'s2' does not have a mappable type in 'map' clause" } */
;
- #pragma omp target map(to: a[:][:]) /* { dg-error "array type length expression must be specified" } */
+ #pragma omp target map(to: a[ : ][ : ]) /* { dg-error "array type length expression must be specified" } */
bar (&a[0][0]); /* { dg-error "referenced in target region does not have a mappable type" "PR97996" { xfail *-*-* } } */
- #pragma omp target map(tofrom: b[-1:]) /* { dg-error "negative low bound in array section" } */
+ #pragma omp target map(tofrom: b[-1: ]) /* { dg-error "negative low bound in array section" } */
bar (b);
- #pragma omp target map(tofrom: c[:-3][:]) /* { dg-error "negative length in array section" } */
+ #pragma omp target map(tofrom: c[ :-3][ : ]) /* { dg-error "negative length in array section" } */
bar (&c[0][0]);
- #pragma omp target map(from: d[11:]) /* { dg-error "low bound \[^\n\r]* above array section size" } */
+ #pragma omp target map(from: d[11: ]) /* { dg-error "low bound \[^\n\r]* above array section size" } */
bar (d);
- #pragma omp target map(to: e[:11]) /* { dg-error "length \[^\n\r]* above array section size" } */
+ #pragma omp target map(to: e[ :11]) /* { dg-error "length \[^\n\r]* above array section size" } */
bar (e);
#pragma omp target map(to: f[1:10]) /* { dg-error "high bound \[^\n\r]* above array section size" } */
bar (f);
- #pragma omp target map(from: g[:][0:10]) /* { dg-error "for array function parameter length expression must be specified" } */
+ #pragma omp target map(from: g[ : ][0:10]) /* { dg-error "for array function parameter length expression must be specified" } */
bar (&g[0][0]);
- #pragma omp target map(from: h[2:1][-1:]) /* { dg-error "negative low bound in array section" } */
+ #pragma omp target map(from: h[2:1][-1: ]) /* { dg-error "negative low bound in array section" } */
bar (&h[0][0]);
- #pragma omp target map(tofrom: h[:1][:-3]) /* { dg-error "negative length in array section" } */
+ #pragma omp target map(tofrom: h[ :1][ :-3]) /* { dg-error "negative length in array section" } */
bar (&h[0][0]);
- #pragma omp target map(i[:1][11:]) /* { dg-error "low bound \[^\n\r]* above array section size" } */
+ #pragma omp target map(i[ :1][11: ]) /* { dg-error "low bound \[^\n\r]* above array section size" } */
bar (&i[0][0]);
- #pragma omp target map(from: j[3:1][:10]) /* { dg-error "length \[^\n\r]* above array section size" } */
+ #pragma omp target map(from: j[3:1][ :10]) /* { dg-error "length \[^\n\r]* above array section size" } */
bar (&j[0][0]);
#pragma omp target map(to: j[30:1][5:5]) /* { dg-error "high bound \[^\n\r]* above array section size" } */
bar (&j[0][0]);
- #pragma omp target map(to: a2[:1][2:4])
+ #pragma omp target map(to: a2[ :1][2:4])
bar (&a2[0][0]);
- #pragma omp target map(a2[3:5][:])
+ #pragma omp target map(a2[3:5][ : ])
bar (&a2[0][0]);
- #pragma omp target map(to: a2[3:5][:10])
+ #pragma omp target map(to: a2[3:5][ :10])
bar (&a2[0][0]);
- #pragma omp target map(tofrom: b2[0:])
+ #pragma omp target map(tofrom: b2[0: ])
bar (b2);
- #pragma omp target map(tofrom: c2[:3][:])
+ #pragma omp target map(tofrom: c2[ :3][ : ])
bar (&c2[0][0]);
- #pragma omp target map(from: d2[9:])
+ #pragma omp target map(from: d2[9: ])
bar (d2);
- #pragma omp target map(to: e2[:10])
+ #pragma omp target map(to: e2[ :10])
bar (e2);
#pragma omp target map(to: f2[1:9])
bar (f2);
- #pragma omp target map(g2[:1][2:4])
+ #pragma omp target map(g2[ :1][2:4])
bar (&g2[0][0]);
- #pragma omp target map(from: h2[2:2][0:])
+ #pragma omp target map(from: h2[2:2][0: ])
bar (&h2[0][0]);
- #pragma omp target map(tofrom: h2[:1][:3])
+ #pragma omp target map(tofrom: h2[ :1][ :3])
bar (&h2[0][0]);
- #pragma omp target map(to: i2[:1][9:])
+ #pragma omp target map(to: i2[ :1][9: ])
bar (&i2[0][0]);
- #pragma omp target map(from: j2[3:4][:9])
+ #pragma omp target map(from: j2[3:4][ :9])
bar (&j2[0][0]);
#pragma omp target map(to: j2[30:1][5:4])
bar (&j2[0][0]);
#pragma omp target map(q[1:2])
;
- #pragma omp target map(tofrom: q[3:5][:10]) /* { dg-error "array section is not contiguous" } */
+ #pragma omp target map(tofrom: q[3:5][ :10]) /* { dg-error "array section is not contiguous" } */
;
- #pragma omp target map(r[3:][2:1][1:2])
+ #pragma omp target map(r[3: ][2:1][1:2])
;
- #pragma omp target map(r[3:][2:1][1:2][:][0:4])
+ #pragma omp target map(r[3: ][2:1][1:2][ : ][0:4])
;
- #pragma omp target map(r[3:][2:1][1:2][1:][0:4]) /* { dg-error "array section is not contiguous" } */
+ #pragma omp target map(r[3: ][2:1][1:2][1: ][0:4]) /* { dg-error "array section is not contiguous" } */
;
- #pragma omp target map(r[3:][2:1][1:2][:3][0:4]) /* { dg-error "array section is not contiguous" } */
+ #pragma omp target map(r[3: ][2:1][1:2][ :3][0:4]) /* { dg-error "array section is not contiguous" } */
;
- #pragma omp target map(r[3:][2:1][1:2][:][1:]) /* { dg-error "array section is not contiguous" } */
+ #pragma omp target map(r[3: ][2:1][1:2][ : ][1: ]) /* { dg-error "array section is not contiguous" } */
;
- #pragma omp target map(r[3:][2:1][1:2][:][:3]) /* { dg-error "array section is not contiguous" } */
+ #pragma omp target map(r[3: ][2:1][1:2][ : ][ :3]) /* { dg-error "array section is not contiguous" } */
;
}
;
#pragma omp target map (tofrom: r[-1:2])
;
- #pragma omp target map (tofrom: s[-1:2][:])
+ #pragma omp target map (tofrom: s[-1:2][ : ])
;
#pragma omp target map (tofrom: s[-1:2][-2:10]) /* { dg-error "negative low bound in array section in" } */
;
#pragma omp target map (tofrom: a[-1:2]) /* { dg-error "negative low bound in array section in" } */
;
- #pragma omp target map (tofrom: b[-1:2][0:]) /* { dg-error "negative low bound in array section in" } */
+ #pragma omp target map (tofrom: b[-1:2][0: ]) /* { dg-error "negative low bound in array section in" } */
;
#pragma omp target map (tofrom: b[1:2][-2:10]) /* { dg-error "negative low bound in array section in" } */
;
#pragma omp target map (tofrom: p[2:-3]) /* { dg-error "negative length in array section in" } */
;
- #pragma omp target map (tofrom: q[2:-3][:]) /* { dg-error "negative length in array section in" } */
+ #pragma omp target map (tofrom: q[2:-3][ : ]) /* { dg-error "negative length in array section in" } */
;
#pragma omp target map (tofrom: q[2:3][0:-1]) /* { dg-error "negative length in array section in" } */
;
#pragma omp target map (tofrom: r[2:-5]) /* { dg-error "negative length in array section in" } */
;
- #pragma omp target map (tofrom: s[2:-5][:]) /* { dg-error "negative length in array section in" } */
+ #pragma omp target map (tofrom: s[2:-5][ : ]) /* { dg-error "negative length in array section in" } */
;
#pragma omp target map (tofrom: s[2:5][0:-4]) /* { dg-error "negative length in array section in" } */
;
for (int i = 0; i < 64; i++)
(s.*ptrp)[i] = i;
-#pragma omp target map(s.*xp, s.*ptrp, (s.*ptrp)[:64])
+#pragma omp target map(s.*xp, s.*ptrp, (s.*ptrp)[ :64])
/* { dg-message {sorry, unimplemented: pointer-to-member mapping '\*\(\*\(\(\(int\*\*\)\(& s\)\) \+ \(\(sizetype\)ptrp\)\)\)' not supported} "" { target *-*-* } .-1 } */
/* { dg-message {sorry, unimplemented: pointer-to-member mapping '\*\(\(\(int\*\*\)\(& s\)\) \+ \(\(sizetype\)ptrp\)\)' not supported} "" { target *-*-* } .-2 } */
/* { dg-message {sorry, unimplemented: pointer-to-member mapping '\*\(\(\(int\*\)\(& s\)\) \+ \(\(sizetype\)xp\)\)' not supported} "" { target *-*-* } .-3 } */
for (int i = 0; i < 64; i++)
(s->*ptrp)[i] = i;
-#pragma omp target map(s->*xp, s->*ptrp, (s->*ptrp)[:64])
+#pragma omp target map(s->*xp, s->*ptrp, (s->*ptrp)[ :64])
/* { dg-message {sorry, unimplemented: pointer-to-member mapping '\*\(\(\(int\*\*\)s\) \+ \(\(sizetype\)ptrp\)\)' not supported} "" { target *-*-* } .-1 } */
/* { dg-message {sorry, unimplemented: pointer-to-member mapping '\*\(\(\(int\*\)s\) \+ \(\(sizetype\)xp\)\)' not supported} "" { target *-*-* } .-2 } */
/* { dg-message {sorry, unimplemented: pointer-to-member mapping '\*\(\*\(\(\(int\*\*\)s\) \+ \(\(sizetype\)ptrp\)\)\)' not supported} "" { target *-*-* } .-3 } */
void
C::do_operation ()
{
-#pragma omp target map(arr, ptr, ptr[:100])
+#pragma omp target map(arr, ptr, ptr[ :100])
#pragma omp teams distribute parallel for
for (int i = 0; i < 100; i++)
{
/* It might sort of make sense to be able to do this, but we don't support
it for now. */
- #pragma omp target map(c.get_arr()[:100])
+ #pragma omp target map(c.get_arr()[ :100])
/* { dg-message {sorry, unimplemented: unsupported map expression 'c\.C::get_arr\(\)\[0\]'} "" { target *-*-* } .-1 } */
#pragma omp teams distribute parallel for
for (int i = 0; i < 100; i++)
c.check (5, 5);
/* Same for this. */
- #pragma omp target map(c.get_ptr(), c.get_ptr()[:100])
+ #pragma omp target map(c.get_ptr(), c.get_ptr()[ :100])
/* { dg-message {sorry, unimplemented: unsupported map expression 'c\.C::get_ptr\(\)'} "" { target *-*-* } .-1 } */
/* { dg-message {sorry, unimplemented: unsupported map expression '\* c\.C::get_ptr\(\)'} "" { target *-*-* } .-2 } */
#pragma omp teams distribute parallel for
if (ptr2[i] != 0)
abort ();
- #pragma omp target data map(ptr1[:N])
+ #pragma omp target data map(ptr1[ :N])
mapped = s.set_ptr (val);
if (!mapped)
if (ptr1[i] != val)
abort ();
- #pragma omp target data map(ptr2[:N])
+ #pragma omp target data map(ptr2[ :N])
mapped = s.set_refptr (val);
if (!mapped)
if (ptr2[i] != 0)
abort ();
- #pragma omp target data map(ptr1[:N], ptr2[:N])
+ #pragma omp target data map(ptr1[ :N], ptr2[ :N])
{
if (!p1 ())
abort ();
if ((fl & 1) && (((uintptr_t) &l2[0] | (uintptr_t) &l3) & 63) != 0)
abort ();
}
- #pragma omp for reduction(+:p[2:px], q[:3], r2) allocate(h: p, q, r2)
+ #pragma omp for reduction(+:p[2:px], q[ :3], r2) allocate(h: p, q, r2)
for (i = 0; i < 32; i++)
{
p[2] += i;
memset (my_c.a.ptr, 0, sizeof (int) * 10);
- #pragma omp target map (my_c.a.ptr, my_c.a.ptr[:10])
+ #pragma omp target map (my_c.a.ptr, my_c.a.ptr[ :10])
{
for (int i = 0; i < 10; i++)
my_c.a.ptr[i] = i;
memset (my_c.b.arr, 0, sizeof (int) * 10);
- #pragma omp target map (my_c.b.arr[:10])
+ #pragma omp target map (my_c.b.arr[ :10])
{
for (int i = 0; i < 10; i++)
my_c.b.arr[i] = i;
memset (my_c.a.ptr, 0, sizeof (int) * 10);
- #pragma omp target map (my_c.a.ptr, my_c.a.ptr[:10])
+ #pragma omp target map (my_c.a.ptr, my_c.a.ptr[ :10])
{
for (int i = 0; i < 10; i++)
my_c.a.ptr[i] = i;
memset (my_c.b.arr, 0, sizeof (int) * 10);
- #pragma omp target map (my_c.b.arr[:10])
+ #pragma omp target map (my_c.b.arr[ :10])
{
for (int i = 0; i < 10; i++)
my_c.b.arr[i] = i;
memset (my_cref.a.ptr, 0, sizeof (int) * 10);
- #pragma omp target map (my_cref.a.ptr, my_cref.a.ptr[:10])
+ #pragma omp target map (my_cref.a.ptr, my_cref.a.ptr[ :10])
{
for (int i = 0; i < 10; i++)
my_cref.a.ptr[i] = i;
memset (my_cref.b.arr, 0, sizeof (int) * 10);
- #pragma omp target map (my_cref.b.arr[:10])
+ #pragma omp target map (my_cref.b.arr[ :10])
{
for (int i = 0; i < 10; i++)
my_cref.b.arr[i] = i;
memset (my_c->a->ptr, 0, sizeof (int) * 10);
- #pragma omp target map (my_c->a, my_c->a[:1], my_c->a->ptr, my_c->a->ptr[:10])
+ #pragma omp target map (my_c->a, my_c->a[ :1], my_c->a->ptr, my_c->a->ptr[ :10])
{
for (int i = 0; i < 10; i++)
my_c->a->ptr[i] = i;
memset (my_c->b->arr, 0, sizeof (int) * 10);
- #pragma omp target map (my_c->b, my_c->b[:1], my_c->b->arr[:10])
+ #pragma omp target map (my_c->b, my_c->b[ :1], my_c->b->arr[ :10])
{
for (int i = 0; i < 10; i++)
my_c->b->arr[i] = i;
memset (my_c->a->ptr, 0, sizeof (int) * 10);
- #pragma omp target map (my_c->a, my_c->a[:1], my_c->a->ptr, my_c->a->ptr[:10])
+ #pragma omp target map (my_c->a, my_c->a[ :1], my_c->a->ptr, my_c->a->ptr[ :10])
{
for (int i = 0; i < 10; i++)
my_c->a->ptr[i] = i;
memset (my_c->b->arr, 0, sizeof (int) * 10);
- #pragma omp target map (my_c->b, my_c->b[:1], my_c->b->arr[:10])
+ #pragma omp target map (my_c->b, my_c->b[ :1], my_c->b->arr[ :10])
{
for (int i = 0; i < 10; i++)
my_c->b->arr[i] = i;
memset (my_cref->a->ptr, 0, sizeof (int) * 10);
- #pragma omp target map (my_cref->a, my_cref->a[:1], my_cref->a->ptr, \
- my_cref->a->ptr[:10])
+ #pragma omp target map (my_cref->a, my_cref->a[ :1], my_cref->a->ptr, \
+ my_cref->a->ptr[ :10])
{
for (int i = 0; i < 10; i++)
my_cref->a->ptr[i] = i;
memset (my_cref->b->arr, 0, sizeof (int) * 10);
- #pragma omp target map (my_cref->b, my_cref->b[:1], my_cref->b->arr[:10])
+ #pragma omp target map (my_cref->b, my_cref->b[ :1], my_cref->b->arr[ :10])
{
for (int i = 0; i < 10; i++)
my_cref->b->arr[i] = i;
memset (my_c->a->ptr2, 0, sizeof (int) * 10);
#pragma omp target map (my_c->a, \
- my_c->a->ptr, my_c->a->ptr[:10], \
- my_c->a->ptr2, my_c->a->ptr2[:10])
+ my_c->a->ptr, my_c->a->ptr[ :10], \
+ my_c->a->ptr2, my_c->a->ptr2[ :10])
{
for (int i = 0; i < 10; i++)
{
void incr_with_this (int c)
{
-#pragma omp target map(this->array[:N])
+#pragma omp target map(this->array[ :N])
for (int i = 0; i < N; i++)
array[i] += c;
}
void incr_without_this (int c)
{
-#pragma omp target map(array[:N])
+#pragma omp target map(array[ :N])
for (int i = 0; i < N; i++)
array[i] += c;
}
void vec_mult (float *&p, float *&v1, float *&v2, int n)
{
- #pragma omp target map(to: v1[0:n], v2[:n]) map(from: p[0:n])
+ #pragma omp target map(to: v1[0:n], v2[ :n]) map(from: p[0:n])
#pragma omp parallel for
for (int i = 0; i < n; i++)
p[i] = v1[i] * v2[i];
for (int i = 0; i < aw.length; i++)
aw.data[i] = i;
-#pragma omp target update from(aw.data[:aw.length])
+#pragma omp target update from(aw.data[ :aw.length])
#pragma omp target exit data map(delete: aw.data, aw.length, \
aw.data[0:aw.length])
for (int i = 0; i < aw.length; i++)
aw.data[i] = i;
-#pragma omp target update from(aw.data[:aw.length])
+#pragma omp target update from(aw.data[ :aw.length])
#pragma omp target exit data map(delete: aw.data, aw.length, \
aw.data[0:aw.length])
double* inptr = in.data();
double* outptr = out.data();
-#pragma omp target teams distribute parallel for map(inptr[:10], outptr[:10]) is_device_ptr(devPtr)
-#pragma acc parallel loop copy(inptr[:10], outptr[:10]) deviceptr(devPtr)
+#pragma omp target teams distribute parallel for map(inptr[ :10], outptr[ :10]) is_device_ptr(devPtr)
+#pragma acc parallel loop copy(inptr[ :10], outptr[ :10]) deviceptr(devPtr)
for(int i = 0; i < 10; i++) {
outptr[i] = devPtr->sag(inptr[i], inptr[i]);
}
foo ()
{
int res = 0;
-#pragma omp target map(size, ptr[:size], res) nowait
+#pragma omp target map(size, ptr[ :size], res) nowait
res = ptr[size - 1];
#pragma omp taskwait
return res;
short (&b)[p7] = bb;
for (int i = 0; i < p7; i++)
bb[i] = -6;
- #pragma omp parallel for reduction(+:x[0:p1 + 1][:p2 + N - 2], z[:p3]) \
- reduction(*:y[:p4]) reduction(|:a[:p5 - N + 2]) \
- reduction(&:w[0:p6 - 3 + N][:p6]) reduction(maxb:b)
+ #pragma omp parallel for reduction(+:x[0:p1 + 1][ :p2 + N - 2], z[ :p3]) \
+ reduction(*:y[ :p4]) reduction(|:a[ :p5 - N + 2]) \
+ reduction(&:w[0:p6 - 3 + N][ :p6]) reduction(maxb:b)
for (int i = 0; i < 128; i++)
{
x[i / 64][i % 3][(i / 4) & 1].t += i;
void
S<N>::foo (int p1, long p2, long p3, int p4, int p5, long p6, short p7)
{
- #pragma omp parallel for reduction(+:x[0:p1 + 1][:p2][0:N], z[:p3 + N - 2]) \
- reduction(*:y[:p4]) reduction(|:a[:p5]) \
- reduction(&:w[0:p6 - 3 + N][:p6]) reduction(maxb:b)
+ #pragma omp parallel for reduction(+:x[0:p1 + 1][ :p2][0:N], z[ :p3 + N - 2]) \
+ reduction(*:y[ :p4]) reduction(|:a[ :p5]) \
+ reduction(&:w[0:p6 - 3 + N][ :p6]) reduction(maxb:b)
for (int i = 0; i < 128; i++)
{
x[i / 64][i % 3][(i / 4) & 1].t += i;
{
unsigned long long a[9] = {};
short b[5] = {};
- #pragma omp parallel for reduction(+:x[-1:2][:][0:2], z[t + 2:4]) \
+ #pragma omp parallel for reduction(+:x[-1:2][ : ][0:2], z[t + 2:4]) \
reduction(*:y[-s:3]) reduction(|:a[s + 3:4]) \
- reduction(&:w[s + 1:][t:2]) reduction(max:b[2:])
+ reduction(&:w[s + 1: ][t:2]) reduction(max:b[2: ])
for (int i = 0; i < 128; i++)
{
x[i / 64 - 1][i % 3][(i / 4) & 1] += i;
void
S::foo (int s, int t)
{
- #pragma omp parallel for reduction(+:x[-1:2][:][0:2], z[t + 2:4]) \
+ #pragma omp parallel for reduction(+:x[-1:2][ : ][0:2], z[t + 2:4]) \
reduction(*:y[-s:3]) reduction(|:a[s + 3:4]) \
- reduction(&:w[s + 1:][t:2]) reduction(max:b[2:])
+ reduction(&:w[s + 1: ][t:2]) reduction(max:b[2: ])
for (int i = 0; i < 128; i++)
{
x[i / 64 - 1][i % 3][(i / 4) & 1] += i;
short (&b)[p7] = bb;
for (int i = 0; i < p7; i++)
bb[i] = -6;
- #pragma omp parallel for reduction(+:x[-1:p1 + 1][:p2 + N - 2], z[t + N:p3]) \
+ #pragma omp parallel for reduction(+:x[-1:p1 + 1][ :p2 + N - 2], z[t + N:p3]) \
reduction(*:y[-s:p4]) reduction(|:a[s + 3:p5 - N + 2]) \
- reduction(&:w[s + 1:p6 - 3 + N][t:p6]) reduction(maxb:b[N:])
+ reduction(&:w[s + 1:p6 - 3 + N][t:p6]) reduction(maxb:b[N: ])
for (int i = 0; i < 128; i++)
{
x[i / 64 - 1][i % 3][(i / 4) & 1].t += i;
void
S<N>::foo (int p1, long p2, long p3, int p4, int p5, long p6, short p7, int s, int t)
{
- #pragma omp parallel for reduction(+:x[-1:p1 + 1][:p2][0:N], z[t + N:p3 + N - 2]) \
+ #pragma omp parallel for reduction(+:x[-1:p1 + 1][ :p2][0:N], z[t + N:p3 + N - 2]) \
reduction(*:y[-s:p4]) reduction(|:a[s + 3:p5]) \
- reduction(&:w[s + 1:p6 - 3 + N][t:p6]) reduction(maxb:b[N:])
+ reduction(&:w[s + 1:p6 - 3 + N][t:p6]) reduction(maxb:b[N: ])
for (int i = 0; i < 128; i++)
{
x[i / 64 - 1][i % 3][(i / 4) & 1].t += i;
{
unsigned long long a[9] = {};
short b[5] = {};
- #pragma omp parallel for reduction(+:x[0:2][:][0:2], z[:4]) \
- reduction(*:y[:3]) reduction(|:a[:4]) \
- reduction(&:w[0:][:2]) reduction(max:b)
+ #pragma omp parallel for reduction(+:x[0:2][ : ][0:2], z[ :4]) \
+ reduction(*:y[ :3]) reduction(|:a[ :4]) \
+ reduction(&:w[0: ][ :2]) reduction(max:b)
for (int i = 0; i < 128; i++)
{
x[i / 64][i % 3][(i / 4) & 1] += i;
void
S::foo ()
{
- #pragma omp parallel for reduction(+:x[0:2][:][0:2], z[:4]) \
- reduction(*:y[:3]) reduction(|:a[:4]) \
- reduction(&:w[0:][:2]) reduction(max:b)
+ #pragma omp parallel for reduction(+:x[0:2][ : ][0:2], z[ :4]) \
+ reduction(*:y[ :3]) reduction(|:a[ :4]) \
+ reduction(&:w[0: ][ :2]) reduction(max:b)
for (int i = 0; i < 128; i++)
{
x[i / 64][i % 3][(i / 4) & 1] += i;
A<unsigned long long> a[9];
short bb[5] = {};
short (&b)[5] = bb;
- #pragma omp parallel for reduction(+:x[0:2][:][0:2], z[:4]) \
- reduction(*:y[:3]) reduction(|:a[:4]) \
- reduction(&:w[0:][:2]) reduction(maxb:b)
+ #pragma omp parallel for reduction(+:x[0:2][ : ][0:2], z[ :4]) \
+ reduction(*:y[ :3]) reduction(|:a[ :4]) \
+ reduction(&:w[0: ][ :2]) reduction(maxb:b)
for (int i = 0; i < 128; i++)
{
x[i / 64][i % 3][(i / 4) & 1].t += i;
void
S::foo ()
{
- #pragma omp parallel for reduction(+:x[0:2][:][0:2], z[:4]) \
- reduction(*:y[:3]) reduction(|:a[:4]) \
- reduction(&:w[0:][:2]) reduction(maxb:b)
+ #pragma omp parallel for reduction(+:x[0:2][ : ][0:2], z[ :4]) \
+ reduction(*:y[ :3]) reduction(|:a[ :4]) \
+ reduction(&:w[0: ][ :2]) reduction(maxb:b)
for (int i = 0; i < 128; i++)
{
x[i / 64][i % 3][(i / 4) & 1].t += i;
b[i] = -6;
a[i] = 0;
}
- #pragma omp parallel for reduction(+:x[0:p1 + 1][:p2], z[:p3]) \
- reduction(*:y[:p4]) reduction(|:a[:p5]) \
- reduction(&:w[0:p6 - 1][:p6]) reduction(max:b)
+ #pragma omp parallel for reduction(+:x[0:p1 + 1][ :p2], z[ :p3]) \
+ reduction(*:y[ :p4]) reduction(|:a[ :p5]) \
+ reduction(&:w[0:p6 - 1][ :p6]) reduction(max:b)
for (int i = 0; i < 128; i++)
{
x[i / 64][i % 3][(i / 4) & 1] += i;
void
S::foo (int p1, long p2, long p3, int p4, int p5, long p6, short p7)
{
- #pragma omp parallel for reduction(+:x[0:p1 + 1][:p2], z[:p3]) \
- reduction(*:y[:p4]) reduction(|:a[:p5]) \
- reduction(&:w[0:p6 - 1][:p6]) reduction(max:b[0:p7])
+ #pragma omp parallel for reduction(+:x[0:p1 + 1][ :p2], z[ :p3]) \
+ reduction(*:y[ :p4]) reduction(|:a[ :p5]) \
+ reduction(&:w[0:p6 - 1][ :p6]) reduction(max:b[0:p7])
for (int i = 0; i < 128; i++)
{
x[i / 64][i % 3][(i / 4) & 1] += i;
short (&b)[p7] = bb;
for (int i = 0; i < p7; i++)
bb[i] = -6;
- #pragma omp parallel for reduction(+:x[0:p1 + 1][:p2], z[:p3]) \
- reduction(*:y[:p4]) reduction(|:a[:p5]) \
- reduction(&:w[0:p6 - 1][:p6]) reduction(maxb:b)
+ #pragma omp parallel for reduction(+:x[0:p1 + 1][ :p2], z[ :p3]) \
+ reduction(*:y[ :p4]) reduction(|:a[ :p5]) \
+ reduction(&:w[0:p6 - 1][ :p6]) reduction(maxb:b)
for (int i = 0; i < 128; i++)
{
x[i / 64][i % 3][(i / 4) & 1].t += i;
void
S::foo (int p1, long p2, long p3, int p4, int p5, long p6, short p7)
{
- #pragma omp parallel for reduction(+:x[0:p1 + 1][:p2][0:2], z[:p3]) \
- reduction(*:y[:p4]) reduction(|:a[:p5]) \
- reduction(&:w[0:p6 - 1][:p6]) reduction(maxb:b)
+ #pragma omp parallel for reduction(+:x[0:p1 + 1][ :p2][0:2], z[ :p3]) \
+ reduction(*:y[ :p4]) reduction(|:a[ :p5]) \
+ reduction(&:w[0:p6 - 1][ :p6]) reduction(maxb:b)
for (int i = 0; i < 128; i++)
{
x[i / 64][i % 3][(i / 4) & 1].t += i;
{
unsigned long long a[9] = {};
short b[5] = {};
- #pragma omp parallel for reduction(+:x[0:N][:][0:N], z[:4]) \
- reduction(*:y[:3]) reduction(|:a[:4]) \
- reduction(&:w[0:][:N]) reduction(max:b)
+ #pragma omp parallel for reduction(+:x[0:N][ : ][0:N], z[ :4]) \
+ reduction(*:y[ :3]) reduction(|:a[ :4]) \
+ reduction(&:w[0: ][ :N]) reduction(max:b)
for (int i = 0; i < 128; i++)
{
x[i / 64][i % 3][(i / 4) & 1] += i;
void
S<N>::foo ()
{
- #pragma omp parallel for reduction(+:x[0:N][:][0:N], z[:4]) \
- reduction(*:y[:3]) reduction(|:a[:4]) \
- reduction(&:w[0:][:N]) reduction(max:b)
+ #pragma omp parallel for reduction(+:x[0:N][ : ][0:N], z[ :4]) \
+ reduction(*:y[ :3]) reduction(|:a[ :4]) \
+ reduction(&:w[0: ][ :N]) reduction(max:b)
for (int i = 0; i < 128; i++)
{
x[i / 64][i % 3][(i / 4) & 1] += i;
/* For zero length array sections, p points to the start of
already mapped range, q to the end of it (with nothing mapped
after it), and r does not point to an mapped range. */
- #pragma omp target map(alloc:p[:0]) map(to:q[:0]) map(from:r[:0]) private(i) map(from:err) firstprivate (s)
+ #pragma omp target map(alloc:p[ :0]) map(to:q[ :0]) map(from:r[ :0]) private(i) map(from:err) firstprivate (s)
{
err = 0;
for (i = 0; i < 8; i++)
abort ();
/* And zero-length array sections, though not known at compile
time, behave the same. */
- #pragma omp target map(p[:n]) map(tofrom:q[:n]) map(alloc:r[:n]) private(i) map(from:err) firstprivate (s)
+ #pragma omp target map(p[ :n]) map(tofrom:q[ :n]) map(alloc:r[ :n]) private(i) map(from:err) firstprivate (s)
{
err = 0;
for (i = 0; i < 8; i++)
abort ();
/* Non-zero length array sections, though not known at compile,
behave differently. */
- #pragma omp target map(p[:m]) map(tofrom:q[:m]) map(to:r[:m]) private(i) map(from:err)
+ #pragma omp target map(p[ :m]) map(tofrom:q[ :m]) map(to:r[ :m]) private(i) map(from:err)
{
err = 0;
for (i = 0; i < 8; i++)
/* For zero length array sections, p points to the start of
already mapped range, q points to the start of another one,
and r to the end of the second one. */
- #pragma omp target map(to:p[:0]) map(from:q[:0]) map(tofrom:r[:0]) private(i) map(from:err)
+ #pragma omp target map(to:p[ :0]) map(from:q[ :0]) map(tofrom:r[ :0]) private(i) map(from:err)
{
err = 0;
for (i = 0; i < 8; i++)
abort ();
/* And zero-length array sections, though not known at compile
time, behave the same. */
- #pragma omp target map(p[:n]) map(alloc:q[:n]) map(from:r[:n]) private(i) map(from:err)
+ #pragma omp target map(p[ :n]) map(alloc:q[ :n]) map(from:r[ :n]) private(i) map(from:err)
{
err = 0;
for (i = 0; i < 8; i++)
abort ();
/* Non-zero length array sections, though not known at compile,
behave differently. */
- #pragma omp target map(p[:m]) map(alloc:q[:m]) map(tofrom:r[:m]) private(i) map(from:err)
+ #pragma omp target map(p[ :m]) map(alloc:q[ :m]) map(tofrom:r[ :m]) private(i) map(from:err)
{
err = 0;
for (i = 0; i < 8; i++)
}
if (err) abort ();
// But explicit zero length array section mapping does.
- #pragma omp target map(from: err) map(tofrom: s.r[:0], t[:0])
+ #pragma omp target map(from: err) map(tofrom: s.r[ :0], t[ :0])
{
if (sep)
/* Since OpenMP 5.2, if no matching mapped list it has been found,
}
if (err) abort ();
// Similarly zero length array section, but unknown at compile time.
- #pragma omp target map(from: err) map(tofrom: s.r[:z], t[:z])
+ #pragma omp target map(from: err) map(tofrom: s.r[ :z], t[ :z])
{
if (sep)
/* Since OpenMP 5.2, if no matching mapped list it has been found,
if (err) abort ();
#pragma omp target enter data map (to: s.r, t)
// But when already mapped, it binds to existing mappings.
- #pragma omp target map(from: err) map(tofrom: s.r[:0], t[:0])
+ #pragma omp target map(from: err) map(tofrom: s.r[ :0], t[ :0])
{
err = t[0] != 1 || t[1] != 2 || t[2] != 3 || s.r[0] != 6 || s.r[1] != 7;
sep = 0;
}
if (err) abort ();
- #pragma omp target map(from: err) map(tofrom: s.r[:z], t[:z])
+ #pragma omp target map(from: err) map(tofrom: s.r[ :z], t[ :z])
{
err = t[0] != 1 || t[1] != 2 || t[2] != 3 || s.r[0] != 6 || s.r[1] != 7;
sep = 0;
double *&ir = i;
int j;
fn1 (hr + 2 * x, ir + 2 * x, x);
- #pragma omp target map(to: br[:x], cr[0:x], dr[x:x], er[x:x]) \
+ #pragma omp target map(to: br[ :x], cr[0:x], dr[x:x], er[x:x]) \
map(to: fr[0:x], gr[0:x], hr[2 * x:x], ir[2 * x:x]) \
map(tofrom: s)
#pragma omp parallel for reduction(+:s)
}
if (err)
abort ();
- #pragma omp target data use_device_ptr(p) map(from:err) map(to:q[:4])
+ #pragma omp target data use_device_ptr(p) map(from:err) map(to:q[ :4])
#pragma omp target is_device_ptr(p) private(i) map(from:err)
{
err = 0;
}
if (err)
abort ();
- #pragma omp target data map(to:s[:5]) use_device_addr(s) map(from:err)
+ #pragma omp target data map(to:s[ :5]) use_device_addr(s) map(from:err)
#pragma omp target is_device_ptr(s) private(i) map(from:err)
{
err = 0;
s->data[i] = 0;
#pragma omp target enter data map(to: s)
- #pragma omp target enter data map(to: s->data, s->data[:SZ])
+ #pragma omp target enter data map(to: s->data, s->data[ :SZ])
#pragma omp target
{
for (int i = 0; i < SZ; i++)
s->data[i] = i;
}
- #pragma omp target exit data map(from: s->data, s->data[:SZ])
+ #pragma omp target exit data map(from: s->data, s->data[ :SZ])
#pragma omp target exit data map(from: s)
for (int i = 0; i < SZ; i++)
}
if (err)
abort ();
- #pragma omp target data map(to:q[:4])
+ #pragma omp target data map(to:q[ :4])
#pragma omp target data use_device_ptr(p) map(from:err)
#pragma omp target is_device_ptr(p) private(i) map(from:err)
{
}
if (err)
abort ();
- #pragma omp target data map(to:s[:5])
+ #pragma omp target data map(to:s[ :5])
#pragma omp target data use_device_addr(s) map(from:err)
#pragma omp target is_device_ptr(s) private(i) map(from:err)
{
bool test_stack(T (&arr)[Size])
{
bool ok;
- #pragma omp target map(from: ok) map(to: arr[:Size])
+ #pragma omp target map(from: ok) map(to: arr[ :Size])
{
bool inner_ok = true;
const std::size_t half_size = Size / 2;
bool test_queue(T (&arr)[Size])
{
bool ok;
- #pragma omp target map(from: ok) map(to: arr[:Size])
+ #pragma omp target map(from: ok) map(to: arr[ :Size])
{
bool inner_ok = true;
const std::size_t half_size = Size / 2;
bool test_priority_queue(T (&arr)[Size], const T min_value, const T max_value)
{
bool ok;
- #pragma omp target map(from: ok) map(to: arr[:Size])
+ #pragma omp target map(from: ok) map(to: arr[ :Size])
{
bool inner_ok = true;
typedef std::priority_queue<T, std::vector<T> > priority_queue_type;
bool test_flat_map(std::pair<K, V> (&arr)[Size])
{
bool ok;
- #pragma omp target map(from: ok) map(to: arr[:Size])
+ #pragma omp target map(from: ok) map(to: arr[ :Size])
{
bool inner_ok = true;
{
bool test_flat_multimap(std::pair<K, V> (&arr)[Size])
{
bool ok;
- #pragma omp target map(from: ok) map(to: arr[:Size])
+ #pragma omp target map(from: ok) map(to: arr[ :Size])
{
bool inner_ok = true;
{
bool test_flat_set(T (&arr)[Size])
{
bool ok;
- #pragma omp target map(from: ok) map(to: arr[:Size])
+ #pragma omp target map(from: ok) map(to: arr[ :Size])
{
bool inner_ok = true;
{
bool test_flat_multiset(T (&arr)[Size])
{
bool ok;
- #pragma omp target map(from: ok) map(to: arr[:Size])
+ #pragma omp target map(from: ok) map(to: arr[ :Size])
{
bool inner_ok = true;
{
bool ok;
T out_arr[Size];
T out_mut_arr[Size];
- #pragma omp target map(from: ok, out_arr[:Size], out_mut_arr[:Size]) \
- map(to: arr[:Size])
+ #pragma omp target map(from: ok, out_arr[ :Size], out_mut_arr[ :Size]) \
+ map(to: arr[ :Size])
{
bool inner_ok = true;
{
bool ok;
T out_arr[Size];
T out_mut_arr[Size];
- #pragma omp target map(from: ok, out_arr[:Size], out_mut_arr[:Size]) \
- map(to: arr[:Size])
+ #pragma omp target map(from: ok, out_arr[ :Size], out_mut_arr[ :Size]) \
+ map(to: arr[ :Size])
{
bool inner_ok = true;
{
bool ok;
T out_arr[Size];
T out_mut_arr[Size];
- #pragma omp target map(from: ok, out_arr[:Size], out_mut_arr[:Size]) \
- map(to: arr[:Size])
+ #pragma omp target map(from: ok, out_arr[ :Size], out_mut_arr[ :Size]) \
+ map(to: arr[ :Size])
{
bool inner_ok = true;
{
std::size_t out_size;
std::pair<K, V> out_pairs_mut[Size];
std::size_t out_size_mut;
- #pragma omp target map(from: ok, out_pairs[:Size], out_size, \
- out_pairs_mut[:Size], out_size_mut) \
- map(to: arr[:Size])
+ #pragma omp target map(from: ok, out_pairs[ :Size], out_size, \
+ out_pairs_mut[ :Size], out_size_mut) \
+ map(to: arr[ :Size])
{
bool inner_ok = true;
{
/* Both sizes should be the same. */
T out_arr[Size];
std::size_t out_size;
- #pragma omp target map(from: ok, out_arr[:Size], out_size) \
- map(to: arr[:Size])
+ #pragma omp target map(from: ok, out_arr[ :Size], out_size) \
+ map(to: arr[ :Size])
{
bool inner_ok = true;
{
bool ok;
std::pair<K, V> out_pairs[Size];
std::pair<K, V> out_pairs_mut[Size];
- #pragma omp target map(from: ok, out_pairs[:Size], out_pairs_mut[:Size]) \
- map(to: arr[:Size])
+ #pragma omp target map(from: ok, out_pairs[ :Size], out_pairs_mut[ :Size]) \
+ map(to: arr[ :Size])
{
bool inner_ok = true;
{
std::multiset<T> reference_multiset(arr, arr + Size);
bool ok;
T out_arr[Size];
- #pragma omp target map(from: ok, out_arr[:Size]) \
- map(to: arr[:Size])
+ #pragma omp target map(from: ok, out_arr[ :Size]) \
+ map(to: arr[ :Size])
{
bool inner_ok = true;
{
bool ok;
T out_arr[Size];
T out_mut_arr[Size];
- #pragma omp target map(from: ok, out_arr[:Size], out_mut_arr[:Size]) \
- map(to: arr[:Size])
+ #pragma omp target map(from: ok, out_arr[ :Size], out_mut_arr[ :Size]) \
+ map(to: arr[ :Size])
{
bool inner_ok = true;
{
bool ok;
T out_arr[Size];
T out_mut_arr[Size];
- #pragma omp target map(from: ok, out_arr[:Size], out_mut_arr[:Size]) \
- map(to: arr[:Size])
+ #pragma omp target map(from: ok, out_arr[ :Size], out_mut_arr[ :Size]) \
+ map(to: arr[ :Size])
{
bool inner_ok = true;
{
std::size_t out_size;
std::pair<K, V> out_pairs_mut[Size];
std::size_t out_size_mut;
- #pragma omp target map(from: ok, out_pairs[:Size], out_size, \
- out_pairs_mut[:Size], out_size_mut) \
- map(to: arr[:Size])
+ #pragma omp target map(from: ok, out_pairs[ :Size], out_size, \
+ out_pairs_mut[ :Size], out_size_mut) \
+ map(to: arr[ :Size])
{
bool inner_ok = true;
{
/* Both sizes should be the same. */
T out_arr[Size];
std::size_t out_size;
- #pragma omp target map(from: ok, out_arr[:Size], out_size) \
- map(to: arr[:Size])
+ #pragma omp target map(from: ok, out_arr[ :Size], out_size) \
+ map(to: arr[ :Size])
{
bool inner_ok = true;
{
bool ok;
std::pair<K, V> out_pairs[Size];
std::pair<K, V> out_pairs_mut[Size];
- #pragma omp target map(from: ok, out_pairs[:Size], out_pairs_mut[:Size]) \
- map(to: arr[:Size])
+ #pragma omp target map(from: ok, out_pairs[ :Size], out_pairs_mut[ :Size]) \
+ map(to: arr[ :Size])
{
bool inner_ok = true;
{
std::unordered_multiset<T> reference_multiset(arr, arr + Size);
bool ok;
T out_arr[Size];
- #pragma omp target map(from: ok, out_arr[:Size]) \
- map(to: arr[:Size])
+ #pragma omp target map(from: ok, out_arr[ :Size]) \
+ map(to: arr[ :Size])
{
bool inner_ok = true;
{
{
bool ok;
Extendable2 e2_out;
- #pragma omp target map(from: ok, e2_out) map(to: arg, nums[:nums_size], nums_size)
+ #pragma omp target map(from: ok, e2_out) map(to: arg, nums[ :nums_size], nums_size)
{
bool inner_ok = true;
{
static constexpr std::size_t out_arr_size = 7;
int out_arr[out_arr_size];
bool ok;
- #pragma omp target map(from: ok, out_arr[:out_arr_size]) map(to: arg)
+ #pragma omp target map(from: ok, out_arr[ :out_arr_size]) map(to: arg)
{
bool inner_ok = true;
{
std::vector<int> vec(arg);
int *data = vec.data();
std::size_t size = vec.size();
- #pragma omp target defaultmap(none) map(from: ok, midpoint_out) map(tofrom: data[:size]) map(to: arg, size)
+ #pragma omp target defaultmap(none) map(from: ok, midpoint_out) map(tofrom: data[ :size]) map(to: arg, size)
{
std::span span = {data, size};
bool inner_ok = true;
static constexpr std::size_t out_arr_size = 7;
int out_arr[out_arr_size];
bool ok;
- #pragma omp target map(from: ok, out_arr[:out_arr_size]) map(to: arg)
+ #pragma omp target map(from: ok, out_arr[ :out_arr_size]) map(to: arg)
{
bool inner_ok = true;
{
static constexpr std::size_t out_arr_size = 7;
int out_arr[out_arr_size];
bool ok;
- #pragma omp target map(from: ok, out_arr[:out_arr_size]) map(to: arg)
+ #pragma omp target map(from: ok, out_arr[ :out_arr_size]) map(to: arg)
{
bool inner_ok = true;
{
T out_fwd_arr[Size];
T out_first_half_arr[Size / 2];
#pragma omp target defaultmap(none) \
- map(from: ok, out_rev_arr[:Size], out_fwd_arr[:Size], \
- out_first_half_arr[:Size / 2]) \
- map(to: arr[:Size])
+ map(from: ok, out_rev_arr[ :Size], out_fwd_arr[ :Size], \
+ out_first_half_arr[ :Size / 2]) \
+ map(to: arr[ :Size])
{
bool inner_ok = true;
{
bool ok;
T out_2x_arr[Size];
T out_shifted_arr[Size];
- #pragma omp target map(from: ok, out_2x_arr[:Size], out_shifted_arr[:Size]) \
- map(to: arr[:Size])
+ #pragma omp target map(from: ok, out_2x_arr[ :Size], out_shifted_arr[ :Size]) \
+ map(to: arr[ :Size])
{
std::vector<T> vec(Size);
std::vector<T> mutated(Size);
T out_2x_arr[Size];
T out_shifted_arr[Size];
#pragma omp target defaultmap(none) \
- map(from: ok, out_2x_arr[:Size], out_shifted_arr[:Size]) \
- map(to: arr[:Size])
+ map(from: ok, out_2x_arr[ :Size], out_shifted_arr[ :Size]) \
+ map(to: arr[ :Size])
{
std::vector<T> vec(Size);
std::vector<T> mutated(Size);
const int arr_rev[8] = {7, 6, 5, 4, 3, 2, 1, 0};
bool ok;
- #pragma omp target defaultmap(none) map(from: ok) map(to: arr_fwd[:8], arr_rev[:8])
+ #pragma omp target defaultmap(none) map(from: ok) map(to: arr_fwd[ :8], arr_rev[ :8])
{
std::span<const int> fwd = {arr_fwd, 8};
std::span<const int> rev = {arr_rev, 8};
{
bool ok;
T out_arr[Size];
- #pragma omp target map(from: ok) map(to: arr[:Size])
+ #pragma omp target map(from: ok) map(to: arr[ :Size])
{
std::span span = {arr, Size};
bool inner_ok = true;
value_type *data = vec.data();
std::size_t size = vec.size();
bool ok;
- #pragma omp target map(from: ok) map(tofrom: data[:size]) map(to: size)
+ #pragma omp target map(from: ok) map(tofrom: data[ :size]) map(to: size)
{
std::vector<value_type> orig = {data, data + size};
std::span<value_type> span = {data, size};
bar (T (&x)[])
{
x[0] = 24;
- #pragma omp target data map(x[:2]) use_device_addr(x)
- #pragma omp target has_device_addr(x[:2])
+ #pragma omp target data map(x[ :2]) use_device_addr(x)
+ #pragma omp target has_device_addr(x[ :2])
x[0] = 42;
if (x[0] != 42)
int (&w)[n] = wu;
for (i = 0; i < n; i++)
w[i] = u[i] = n + i;
- #pragma omp taskgroup task_reduction (+: x, y[:2], z[1:2], u, w[1:v])
+ #pragma omp taskgroup task_reduction (+: x, y[ :2], z[1:2], u, w[1:v])
{
- #pragma omp task in_reduction (+: x, y[:2], z[1:2], u, w[1:v])
+ #pragma omp task in_reduction (+: x, y[ :2], z[1:2], u, w[1:v])
{
x++;
y[0] += 2;
u[0] += 5;
w[1] += 6;
}
- #pragma omp target in_reduction (+: x, y[:2], z[1:2], u, w[1:v])
+ #pragma omp target in_reduction (+: x, y[ :2], z[1:2], u, w[1:v])
{
x += 4;
y[0] += 5;
u[1] += 8;
w[2] += 7;
}
- #pragma omp target in_reduction (+: x, y[:v], z[1:v], u, w[1:2])
+ #pragma omp target in_reduction (+: x, y[ :v], z[1:v], u, w[1:2])
{
x += 9;
y[0] += 10;
for (i = 0; i < n; i++)
w[i] = u[i] = n + i;
#pragma omp parallel master
- #pragma omp taskgroup task_reduction (+: x, y[:2], z[1:2], u, w[1:v])
+ #pragma omp taskgroup task_reduction (+: x, y[ :2], z[1:2], u, w[1:v])
{
- #pragma omp task in_reduction (+: x, y[:2], z[1:2], u, w[1:v])
+ #pragma omp task in_reduction (+: x, y[ :2], z[1:2], u, w[1:v])
{
x++;
y[0] += 2;
u[0] += 5;
w[1] += 6;
}
- #pragma omp target in_reduction (+: x, y[:2], z[1:2], u, w[1:v])
+ #pragma omp target in_reduction (+: x, y[ :2], z[1:2], u, w[1:v])
{
x += 4;
y[0] += 5;
u[1] += 8;
w[2] += 7;
}
- #pragma omp target in_reduction (+: x, y[:v], z[1:v], u, w[1:2])
+ #pragma omp target in_reduction (+: x, y[ :v], z[1:v], u, w[1:2])
{
x += 9;
y[0] += 10;
w[i].c[0] = u[i].c[0] = 0;
w[i].c[1] = u[i].c[1] = 0;
}
- #pragma omp taskgroup task_reduction (+: x, y[:2], z[1:2], u, w[1:v])
+ #pragma omp taskgroup task_reduction (+: x, y[ :2], z[1:2], u, w[1:v])
{
- #pragma omp task in_reduction (+: x, y[:2], z[1:2], u, w[1:v])
+ #pragma omp task in_reduction (+: x, y[ :2], z[1:2], u, w[1:v])
{
x.a++;
x.b++;
w[1].a += 6;
w[1].b += 16;
}
- #pragma omp target in_reduction (+: x, y[:2], z[1:2], u, w[1:v])
+ #pragma omp target in_reduction (+: x, y[ :2], z[1:2], u, w[1:v])
{
x.a += 4;
x.b += 14;
w[2].a += 7;
w[2].b += 17;
}
- #pragma omp target in_reduction (+: x, y[:v], z[1:v], u, w[1:2])
+ #pragma omp target in_reduction (+: x, y[ :v], z[1:v], u, w[1:2])
{
x.a += 9;
x.b += 19;
w[i].c[1] = u[i].c[1] = 0;
}
#pragma omp parallel master
- #pragma omp taskgroup task_reduction (+: x, y[:2], z[1:2], u, w[1:v])
+ #pragma omp taskgroup task_reduction (+: x, y[ :2], z[1:2], u, w[1:v])
{
- #pragma omp task in_reduction (+: x, y[:2], z[1:2], u, w[1:v])
+ #pragma omp task in_reduction (+: x, y[ :2], z[1:2], u, w[1:v])
{
x.a++;
x.b++;
w[1].a += 6;
w[1].b += 16;
}
- #pragma omp target in_reduction (+: x, y[:2], z[1:2], u, w[1:v])
+ #pragma omp target in_reduction (+: x, y[ :2], z[1:2], u, w[1:v])
{
x.a += 4;
x.b += 14;
w[2].a += 7;
w[2].b += 17;
}
- #pragma omp target in_reduction (+: x, y[:v], z[1:v], u, w[1:2])
+ #pragma omp target in_reduction (+: x, y[ :v], z[1:v], u, w[1:2])
{
x.a += 9;
x.b += 19;
int val = 1;
int &valref = val;
- #pragma omp target enter data map(alloc: data1[:N], data2[:N])
+ #pragma omp target enter data map(alloc: data1[ :N], data2[ :N])
omp_target_loop (0, N, [=](int i) { data1[i] = val; });
omp_target_loop (0, N, [=](int i) { data2[i] = valref + 1; });
- #pragma omp target update from(data1[:N], data2[:N])
+ #pragma omp target update from(data1[ :N], data2[ :N])
for (int i = 0; i < N; i++)
{
if (data2[i] != 2) abort ();
}
- #pragma omp target exit data map(delete: data1[:N], data2[:N])
+ #pragma omp target exit data map(delete: data1[ :N], data2[ :N])
int b = 8;
S s = { 4, N, data1 };
if (f ()) abort ();
- #pragma omp target enter data map(to: data1[:N])
+ #pragma omp target enter data map(to: data1[ :N])
if (f ()) abort ();
- #pragma omp target enter data map(to: data2[:N])
+ #pragma omp target enter data map(to: data2[ :N])
if (!f () && !shared_mem) abort ();
- #pragma omp target exit data map(from: data1[:N], data2[:N])
+ #pragma omp target exit data map(from: data1[ :N], data2[ :N])
if (!shared_mem)
for (int i = 0; i < N; i++)
&& omp_target_is_present (data2, dev));
int val = 1;
int &valref = val;
- #pragma omp target enter data map(alloc: data1[:N], data2[:N]) device(dev)
+ #pragma omp target enter data map(alloc: data1[ :N], data2[ :N]) device(dev)
omp_target_loop (0, N, [=](int i) { data1[i] = val; }, dev);
omp_target_loop (0, N, [=](int i) { data2[i] = valref + 1; }, dev);
- #pragma omp target update from(data1[:N], data2[:N]) device(dev)
+ #pragma omp target update from(data1[ :N], data2[ :N]) device(dev)
for (int i = 0; i < N; i++)
{
if (data2[i] != 2) abort ();
}
- #pragma omp target exit data map(delete: data1[:N], data2[:N]) device(dev)
+ #pragma omp target exit data map(delete: data1[ :N], data2[ :N]) device(dev)
int b = 8;
S s = { 4, N, data1 };
auto f = s.merge_data_func (data2, b, dev);
if (f () ^ shared_mem) abort ();
- #pragma omp target enter data map(to: data1[:N]) device(dev)
+ #pragma omp target enter data map(to: data1[ :N]) device(dev)
if (f () ^ shared_mem) abort ();
- #pragma omp target enter data map(to: data2[:N]) device(dev)
+ #pragma omp target enter data map(to: data2[ :N]) device(dev)
if (!f ()) abort ();
- #pragma omp target exit data map(from: data1[:N], data2[:N]) device(dev)
+ #pragma omp target exit data map(from: data1[ :N], data2[ :N]) device(dev)
for (int i = 0; i < N; i++)
{
int *array = new int[N];
A *obj = new A (array, N);
- #pragma omp target map(from: array[:N]) map(tofrom: obj[:1])
+ #pragma omp target map(from: array[ :N]) map(tofrom: obj[ :1])
{
int *tmp_h_array = obj->h_array;
obj->h_array = array;
int array[N];
A obj(array, N);
- #pragma omp target map(from: array[:N]) map(tofrom: obj)
+ #pragma omp target map(from: array[ :N]) map(tofrom: obj)
{
int *tmp_h_array = obj.h_array;
obj.h_array = array;
init (data);
#ifndef MEM_SHARED
- #pragma omp target data map (to: data[:N]) map (alloc: arr)
+ #pragma omp target data map (to: data[ :N]) map (alloc: arr)
#endif
{
#pragma omp target
init (data);
#ifndef MEM_SHARED
- #pragma omp target data map (to: data[:N]) map (alloc: _set)
+ #pragma omp target data map (to: data[ :N]) map (alloc: _set)
#endif
{
#pragma omp target
#endif
#ifndef MEM_SHARED
- #pragma omp target data map (to: data[:N]) map (alloc: _deque)
+ #pragma omp target data map (to: data[ :N]) map (alloc: _deque)
#endif
{
#ifndef MEM_SHARED
init (keys, true);
init (data, false);
- #pragma omp target enter data map (to: keys[:N], data[:N]) map (alloc: _map)
+ #pragma omp target enter data map (to: keys[ :N], data[ :N]) map (alloc: _map)
#pragma omp target
{
init (keys, KEY_MAX);
init (data, RAND_MAX);
- #pragma omp target enter data map (to: keys[:N], data[:N]) map (alloc: _map)
+ #pragma omp target enter data map (to: keys[ :N], data[ :N]) map (alloc: _map)
#pragma omp target
{
srand (time (NULL));
init (data);
- #pragma omp target data map (to: data[:N]) map (alloc: set)
+ #pragma omp target data map (to: data[ :N]) map (alloc: set)
{
#pragma omp target
{
srand (time (NULL));
init (data);
- #pragma omp target data map (to: data[:N]) map (alloc: _set)
+ #pragma omp target data map (to: data[ :N]) map (alloc: _set)
{
#pragma omp target
{
#endif
#ifndef MEM_SHARED
- #pragma omp target data map (to: data[:N]) map (alloc: list)
+ #pragma omp target data map (to: data[ :N]) map (alloc: list)
#endif
{
#ifndef MEM_SHARED
#endif
#ifndef MEM_SHARED
- #pragma omp target data map (to: data[:N]) map (alloc: _list)
+ #pragma omp target data map (to: data[ :N]) map (alloc: _list)
#endif
{
#ifndef MEM_SHARED
init (data, false);
#ifndef MEM_SHARED
- #pragma omp target enter data map (to: keys[:N], data[:N]) map (alloc: _map)
+ #pragma omp target enter data map (to: keys[ :N], data[ :N]) map (alloc: _map)
#endif
#pragma omp target
init (data, RAND_MAX);
#ifndef MEM_SHARED
- #pragma omp target enter data map (to: keys[:N], data[:N]) map (alloc: _map)
+ #pragma omp target enter data map (to: keys[ :N], data[ :N]) map (alloc: _map)
#endif
#pragma omp target
init (data);
#ifndef MEM_SHARED
- #pragma omp target data map (to: data[:N]) map (alloc: set)
+ #pragma omp target data map (to: data[ :N]) map (alloc: set)
#endif
{
#pragma omp target
init (data);
#ifndef MEM_SHARED
- #pragma omp target data map (to: data[:N]) map (alloc: _set)
+ #pragma omp target data map (to: data[ :N]) map (alloc: _set)
#endif
{
#pragma omp target
init (data);
#ifndef MEM_SHARED
- #pragma omp target enter data map (to: data[:N]) map (alloc: elements, span)
+ #pragma omp target enter data map (to: data[ :N]) map (alloc: elements, span)
#endif
#pragma omp target
init (keys, true);
init (data, false);
- #pragma omp target enter data map (to: keys[:N], data[:N]) map (alloc: _map)
+ #pragma omp target enter data map (to: keys[ :N], data[ :N]) map (alloc: _map)
#pragma omp target
{
init (keys, KEY_MAX);
init (data, RAND_MAX);
- #pragma omp target enter data map (to: keys[:N], data[:N]) map (alloc: _map)
+ #pragma omp target enter data map (to: keys[ :N], data[ :N]) map (alloc: _map)
#pragma omp target
{
srand (time (NULL));
init (data);
- #pragma omp target data map (to: data[:N]) map (alloc: set)
+ #pragma omp target data map (to: data[ :N]) map (alloc: set)
{
#pragma omp target
{
srand (time (NULL));
init (data);
- #pragma omp target data map (to: data[:N]) map (alloc: _set)
+ #pragma omp target data map (to: data[ :N]) map (alloc: _set)
{
#pragma omp target
{
size_t shiftData_i_size = shiftData_i.size();
#pragma omp target \
defaultmap(none) \
- map(to: v1_i_data[:v1_i_size], v1_i_size, \
- v2_i_data[:v2_i_size], v2_i_size, \
- shiftData_i_data[:shiftData_i_size], shiftData_i_size)
+ map(to: v1_i_data[ :v1_i_size], v1_i_size, \
+ v2_i_data[ :v2_i_size], v2_i_size, \
+ shiftData_i_data[ :shiftData_i_size], shiftData_i_size)
{
/* Manually set up a buffer we can stream into, similar to 'cout << [...]', and print it at the end of region. */
std::stringbuf out_b;
#endif
#ifndef MEM_SHARED
- #pragma omp target data map (to: data[:N]) map (alloc: arr)
+ #pragma omp target data map (to: data[ :N]) map (alloc: arr)
#endif
{
#pragma omp target
#endif
#ifndef MEM_SHARED
- #pragma omp target data map (to: data[:N]) map (alloc: vec)
+ #pragma omp target data map (to: data[ :N]) map (alloc: vec)
#endif
{
#ifndef MEM_SHARED
if (ptr2[i] != 0)
abort ();
- #pragma omp target data map(ptr1[:N])
+ #pragma omp target data map(ptr1[ :N])
mapped = s.set_ptr (val);
if (!mapped)
if (ptr1[i] != val)
abort ();
- #pragma omp target data map(ptr2[:N])
+ #pragma omp target data map(ptr2[ :N])
mapped = s.set_refptr (val);
if (!mapped)
if (ptr2[i] != 0)
abort ();
- #pragma omp target data map(ptr1[:N], ptr2[:N])
+ #pragma omp target data map(ptr1[ :N], ptr2[ :N])
{
if (!p1 ())
abort ();
void do_work ()
{
int error = 0;
- #pragma omp target map (tofrom: this[:1], error)
+ #pragma omp target map (tofrom: this[ :1], error)
{
if (scalar != 42 || this->array[0] != 123 || array[4] != 555)
error = 1;
{
T i;
for (i = 0; i < 2; i++)
- #pragma omp task in_reduction (+: a, c[:2]) in_reduction (*: b[2 * n:3 * n], d[0:2]) \
- in_reduction (+: o[n:n*2], m[1], k[1:2][:], p[0], f[2:2]) \
- in_reduction (+: q[1:2][:], g[n:n*2], e[1], h[0], r[2:2]) \
- in_reduction (*: s[1:2], t[2:2][:])
+ #pragma omp task in_reduction (+: a, c[ :2]) in_reduction (*: b[2 * n:3 * n], d[0:2]) \
+ in_reduction (+: o[n:n*2], m[1], k[1:2][ : ], p[0], f[2:2]) \
+ in_reduction (+: q[1:2][ : ], g[n:n*2], e[1], h[0], r[2:2]) \
+ in_reduction (*: s[1:2], t[2:2][ : ])
{
a[0] += 7;
a[1] += 17;
T (&o)[4] = os;
#pragma omp parallel reduction (task,+: a, c) reduction (task,*: b[2 * n:3 * n], d) \
reduction (task,+: e[1], f[2:2], g[n:n*2], h[0], k[1:2][0:2]) \
- reduction (task,+: o[n:n*2], m[1], q[1:2][:], p[0], r[2:2]) \
- reduction (task,*: t[2:2][:], s[1:n + 1])
+ reduction (task,+: o[n:n*2], m[1], q[1:2][ : ], p[0], r[2:2]) \
+ reduction (task,*: t[2:2][ : ], s[1:n + 1])
{
#pragma omp for
for (int i = 0; i < 4; i++)
#pragma omp task in_reduction (+: a, c) in_reduction (*: b[2 * n:3 * n], d) \
- in_reduction (+: o[n:n*2], q[1:2][:], p[0], m[1], r[2:2]) \
- in_reduction (+: g[n:n * 2], e[1], k[1:2][:], h[0], f[2:2]) \
- in_reduction (*: s[1:2], t[2:2][:])
+ in_reduction (+: o[n:n*2], q[1:2][ : ], p[0], m[1], r[2:2]) \
+ in_reduction (+: g[n:n * 2], e[1], k[1:2][ : ], h[0], f[2:2]) \
+ in_reduction (*: s[1:2], t[2:2][ : ])
{
T j;
a[0] += 2;
t[2][1] *= 2;
t[3][1] *= 2;
for (j = 0; j < 2; j++)
- #pragma omp task in_reduction (+: a, c[:2]) \
+ #pragma omp task in_reduction (+: a, c[ :2]) \
in_reduction (*: b[2 * n:3 * n], d[n - 1:n + 1]) \
- in_reduction (+: e[1], f[2:2], g[n:n*2], h[0], k[1:2][:2]) \
- in_reduction (+: m[1], r[2:2], o[n:n*2], p[0], q[1:2][:2]) \
- in_reduction (*: s[n:2], t[2:2][:])
+ in_reduction (+: e[1], f[2:2], g[n:n*2], h[0], k[1:2][ :2]) \
+ in_reduction (+: m[1], r[2:2], o[n:n*2], p[0], q[1:2][ :2]) \
+ in_reduction (*: s[n:2], t[2:2][ : ])
{
m[1] += 6;
r[2] += 7;
{
int i;
for (i = 0; i < 2; i++)
- #pragma omp task in_reduction (+: a, c[:2]) in_reduction (*: b[2 * n:3 * n], d[0:2]) \
- in_reduction (+: o[n:n*2], m[1], k[1:2][:], p[0], f[2:2]) \
- in_reduction (+: q[1:2][:], g[n:n*2], e[1], h[0], r[2:2]) \
- in_reduction (*: s[1:2], t[2:2][:])
+ #pragma omp task in_reduction (+: a, c[ :2]) in_reduction (*: b[2 * n:3 * n], d[0:2]) \
+ in_reduction (+: o[n:n*2], m[1], k[1:2][ : ], p[0], f[2:2]) \
+ in_reduction (+: q[1:2][ : ], g[n:n*2], e[1], h[0], r[2:2]) \
+ in_reduction (*: s[1:2], t[2:2][ : ])
{
a[0].s += 7;
a[1].s += 17;
S o[4] = { { 1, 7 }, { 0, 7 }, { 0, 7 }, { 2, 7 } };
#pragma omp parallel reduction (task, +: a, c) reduction (task, *: b[2 * n:3 * n], d) \
reduction (task, +: e[1], f[2:2], g[n:n*2], h[0], k[1:2][0:2]) \
- reduction (task, +: o[n:n*2], m[1], q[1:2][:], p[0], r[2:2]) \
- reduction (task, *: t[2:2][:], s[1:n + 1])
+ reduction (task, +: o[n:n*2], m[1], q[1:2][ : ], p[0], r[2:2]) \
+ reduction (task, *: t[2:2][ : ], s[1:n + 1])
{
#pragma omp for
for (int i = 0; i < 4; i++)
#pragma omp task in_reduction (+: a, c) in_reduction (*: b[2 * n:3 * n], d) \
- in_reduction (+: o[n:n*2], q[1:2][:], p[0], m[1], r[2:2]) \
- in_reduction (+: g[n:n * 2], e[1], k[1:2][:], h[0], f[2:2]) \
- in_reduction (*: s[1:2], t[2:2][:])
+ in_reduction (+: o[n:n*2], q[1:2][ : ], p[0], m[1], r[2:2]) \
+ in_reduction (+: g[n:n * 2], e[1], k[1:2][ : ], h[0], f[2:2]) \
+ in_reduction (*: s[1:2], t[2:2][ : ])
{
int j;
a[0].s += 2;
if (b[z + 2].t != 5 && b[z + 2].t != 9)
abort ();
for (j = 0; j < 2; j++)
- #pragma omp task in_reduction (+: a, c[:2]) \
+ #pragma omp task in_reduction (+: a, c[ :2]) \
in_reduction (*: b[2 * n:3 * n], d[n - 1:n + 1]) \
- in_reduction (+: e[1], f[2:2], g[n:n*2], h[0], k[1:2][:2]) \
- in_reduction (+: m[1], r[2:2], o[n:n*2], p[0], q[1:2][:2]) \
- in_reduction (*: s[n:2], t[2:2][:])
+ in_reduction (+: e[1], f[2:2], g[n:n*2], h[0], k[1:2][ :2]) \
+ in_reduction (+: m[1], r[2:2], o[n:n*2], p[0], q[1:2][ :2]) \
+ in_reduction (*: s[n:2], t[2:2][ : ])
{
m[1].s += 6;
r[2].s += 7;
{
T i;
for (i = 0; i < 2; i++)
- #pragma omp task in_reduction (+: a, c[:2]) in_reduction (*: b[2 * n:3 * n], d[0:2]) \
- in_reduction (+: o[n:n*2], m[1], k[1:2][:], p[0], f[2:2]) \
- in_reduction (+: q[1:2][:], g[n:n*2], e[1], h[0], r[2:2]) \
- in_reduction (*: s[1:2], t[2:2][:])
+ #pragma omp task in_reduction (+: a, c[ :2]) in_reduction (*: b[2 * n:3 * n], d[0:2]) \
+ in_reduction (+: o[n:n*2], m[1], k[1:2][ : ], p[0], f[2:2]) \
+ in_reduction (+: q[1:2][ : ], g[n:n*2], e[1], h[0], r[2:2]) \
+ in_reduction (*: s[1:2], t[2:2][ : ])
{
a[0].s += 7;
a[1].s += 17;
S (&o)[4] = os;
#pragma omp parallel reduction (task, +: a, c) reduction (task, *: b[2 * n:3 * n], d) \
reduction (task, +: e[1], f[2:2], g[n:n*2], h[0], k[1:2][0:2]) \
- reduction (task, +: o[n:n*2], m[1], q[1:2][:], p[0], r[2:2]) \
- reduction (task, *: t[2:2][:], s[1:n + 1])
+ reduction (task, +: o[n:n*2], m[1], q[1:2][ : ], p[0], r[2:2]) \
+ reduction (task, *: t[2:2][ : ], s[1:n + 1])
{
#pragma omp for
for (T i = 0; i < 4; i++)
#pragma omp task in_reduction (+: a, c) in_reduction (*: b[2 * n:3 * n], d) \
- in_reduction (+: o[n:n*2], q[1:2][:], p[0], m[1], r[2:2]) \
- in_reduction (+: g[n:n * 2], e[1], k[1:2][:], h[0], f[2:2]) \
- in_reduction (*: s[1:2], t[2:2][:])
+ in_reduction (+: o[n:n*2], q[1:2][ : ], p[0], m[1], r[2:2]) \
+ in_reduction (+: g[n:n * 2], e[1], k[1:2][ : ], h[0], f[2:2]) \
+ in_reduction (*: s[1:2], t[2:2][ : ])
{
T j;
a[0].s += 2;
if (b[z + 2].t != 5 && b[z + 2].t != 9)
abort ();
for (j = 0; j < 2; j++)
- #pragma omp task in_reduction (+: a, c[:2]) \
+ #pragma omp task in_reduction (+: a, c[ :2]) \
in_reduction (*: b[2 * n:3 * n], d[n - 1:n + 1]) \
- in_reduction (+: e[1], f[2:2], g[n:n*2], h[0], k[1:2][:2]) \
- in_reduction (+: m[1], r[2:2], o[n:n*2], p[0], q[1:2][:2]) \
- in_reduction (*: s[n:2], t[2:2][:])
+ in_reduction (+: e[1], f[2:2], g[n:n*2], h[0], k[1:2][ :2]) \
+ in_reduction (+: m[1], r[2:2], o[n:n*2], p[0], q[1:2][ :2]) \
+ in_reduction (*: s[n:2], t[2:2][ : ])
{
m[1].s += 6;
r[2].s += 7;
{
T i;
for (i = 0; i < 2; i++)
- #pragma omp task in_reduction (+: a, c[:2]) in_reduction (*: b[2 * n:3 * n], d[0:2]) \
- in_reduction (+: o[n:n*2], m[1], k[1:2][:], p[0], f[2:2]) \
- in_reduction (+: q[1:2][:], g[n:n*2], e[1], h[0], r[2:2]) \
- in_reduction (*: s[1:2], t[2:2][:])
+ #pragma omp task in_reduction (+: a, c[ :2]) in_reduction (*: b[2 * n:3 * n], d[0:2]) \
+ in_reduction (+: o[n:n*2], m[1], k[1:2][ : ], p[0], f[2:2]) \
+ in_reduction (+: q[1:2][ : ], g[n:n*2], e[1], h[0], r[2:2]) \
+ in_reduction (*: s[1:2], t[2:2][ : ])
{
a[0] += 7;
a[1] += 17;
{
#pragma omp for reduction (task,+: a, c) reduction (task,*: b[2 * n:3 * n], d) \
reduction (task,+: e[1], f[2:2], g[n:n*2], h[0], k[1:2][0:2]) \
- reduction (task,+: o[n:n*2], m[1], q[1:2][:], p[0], r[2:2]) \
- reduction (task,*: t[2:2][:], s[1:n + 1]) schedule (dynamic)
+ reduction (task,+: o[n:n*2], m[1], q[1:2][ : ], p[0], r[2:2]) \
+ reduction (task,*: t[2:2][ : ], s[1:n + 1]) schedule (dynamic)
for (I i = x; i != y; i++)
#pragma omp task in_reduction (+: a, c) in_reduction (*: b[2 * n:3 * n], d) \
- in_reduction (+: o[n:n*2], q[1:2][:], p[0], m[1], r[2:2]) \
- in_reduction (+: g[n:n * 2], e[1], k[1:2][:], h[0], f[2:2]) \
- in_reduction (*: s[1:2], t[2:2][:])
+ in_reduction (+: o[n:n*2], q[1:2][ : ], p[0], m[1], r[2:2]) \
+ in_reduction (+: g[n:n * 2], e[1], k[1:2][ : ], h[0], f[2:2]) \
+ in_reduction (*: s[1:2], t[2:2][ : ])
{
T j;
a[0] += 2;
t[2][1] *= 2;
t[3][1] *= 2;
for (j = 0; j < 2; j++)
- #pragma omp task in_reduction (+: a, c[:2]) \
+ #pragma omp task in_reduction (+: a, c[ :2]) \
in_reduction (*: b[2 * n:3 * n], d[n - 1:n + 1]) \
- in_reduction (+: e[1], f[2:2], g[n:n*2], h[0], k[1:2][:2]) \
- in_reduction (+: m[1], r[2:2], o[n:n*2], p[0], q[1:2][:2]) \
- in_reduction (*: s[n:2], t[2:2][:])
+ in_reduction (+: e[1], f[2:2], g[n:n*2], h[0], k[1:2][ :2]) \
+ in_reduction (+: m[1], r[2:2], o[n:n*2], p[0], q[1:2][ :2]) \
+ in_reduction (*: s[n:2], t[2:2][ : ])
{
m[1] += 6;
r[2] += 7;
{
int i;
for (i = 0; i < 2; i++)
- #pragma omp task in_reduction (+: a, c[:2]) in_reduction (*: b[2 * n:3 * n], d[0:2]) \
- in_reduction (+: o[n:n*2], m[1], k[1:2][:], p[0], f[2:2]) \
- in_reduction (+: q[1:2][:], g[n:n*2], e[1], h[0], r[2:2]) \
- in_reduction (*: s[1:2], t[2:2][:])
+ #pragma omp task in_reduction (+: a, c[ :2]) in_reduction (*: b[2 * n:3 * n], d[0:2]) \
+ in_reduction (+: o[n:n*2], m[1], k[1:2][ : ], p[0], f[2:2]) \
+ in_reduction (+: q[1:2][ : ], g[n:n*2], e[1], h[0], r[2:2]) \
+ in_reduction (*: s[1:2], t[2:2][ : ])
{
a[0].s += 7;
a[1].s += 17;
{
#pragma omp for reduction (task, +: a, c) reduction (task, *: b[2 * n:3 * n], d) \
reduction (task, +: e[1], f[2:2], g[n:n*2], h[0], k[1:2][0:2]) \
- reduction (task, +: o[n:n*2], m[1], q[1:2][:], p[0], r[2:2]) \
- reduction (task, *: t[2:2][:], s[1:n + 1]) \
+ reduction (task, +: o[n:n*2], m[1], q[1:2][ : ], p[0], r[2:2]) \
+ reduction (task, *: t[2:2][ : ], s[1:n + 1]) \
schedule (nonmonotonic: guided, 1)
for (unsigned long long i = x; i < y; i += z)
#pragma omp task in_reduction (+: a, c) in_reduction (*: b[2 * n:3 * n], d) \
- in_reduction (+: o[n:n*2], q[1:2][:], p[0], m[1], r[2:2]) \
- in_reduction (+: g[n:n * 2], e[1], k[1:2][:], h[0], f[2:2]) \
- in_reduction (*: s[1:2], t[2:2][:])
+ in_reduction (+: o[n:n*2], q[1:2][ : ], p[0], m[1], r[2:2]) \
+ in_reduction (+: g[n:n * 2], e[1], k[1:2][ : ], h[0], f[2:2]) \
+ in_reduction (*: s[1:2], t[2:2][ : ])
{
int j;
a[0].s += 2;
if (b[z + 2].t != 5 && b[z + 2].t != 9)
abort ();
for (j = 0; j < 2; j++)
- #pragma omp task in_reduction (+: a, c[:2]) \
+ #pragma omp task in_reduction (+: a, c[ :2]) \
in_reduction (*: b[2 * n:3 * n], d[n - 1:n + 1]) \
- in_reduction (+: e[1], f[2:2], g[n:n*2], h[0], k[1:2][:2]) \
- in_reduction (+: m[1], r[2:2], o[n:n*2], p[0], q[1:2][:2]) \
- in_reduction (*: s[n:2], t[2:2][:])
+ in_reduction (+: e[1], f[2:2], g[n:n*2], h[0], k[1:2][ :2]) \
+ in_reduction (+: m[1], r[2:2], o[n:n*2], p[0], q[1:2][ :2]) \
+ in_reduction (*: s[n:2], t[2:2][ : ])
{
m[1].s += 6;
r[2].s += 7;
{
T i;
for (i = 0; i < 2; i++)
- #pragma omp task in_reduction (+: a, c[:2]) in_reduction (*: b[2 * n:3 * n], d[0:2]) \
- in_reduction (+: o[n:n*2], m[1], k[1:2][:], p[0], f[2:2]) \
- in_reduction (+: q[1:2][:], g[n:n*2], e[1], h[0], r[2:2]) \
- in_reduction (*: s[1:2], t[2:2][:])
+ #pragma omp task in_reduction (+: a, c[ :2]) in_reduction (*: b[2 * n:3 * n], d[0:2]) \
+ in_reduction (+: o[n:n*2], m[1], k[1:2][ : ], p[0], f[2:2]) \
+ in_reduction (+: q[1:2][ : ], g[n:n*2], e[1], h[0], r[2:2]) \
+ in_reduction (*: s[1:2], t[2:2][ : ])
{
a[0].s += 7;
a[1].s += 17;
{
#pragma omp for reduction (task, +: a, c) reduction (task, *: b[2 * n:3 * n], d) \
reduction (task, +: e[1], f[2:2], g[n:n*2], h[0], k[1:2][0:2]) \
- reduction (task, +: o[n:n*2], m[1], q[1:2][:], p[0], r[2:2]) \
- reduction (task, *: t[2:2][:], s[1:n + 1]) \
+ reduction (task, +: o[n:n*2], m[1], q[1:2][ : ], p[0], r[2:2]) \
+ reduction (task, *: t[2:2][ : ], s[1:n + 1]) \
schedule (monotonic: runtime)
for (T i = 0; i < 4; i++)
#pragma omp task in_reduction (+: a, c) in_reduction (*: b[2 * n:3 * n], d) \
- in_reduction (+: o[n:n*2], q[1:2][:], p[0], m[1], r[2:2]) \
- in_reduction (+: g[n:n * 2], e[1], k[1:2][:], h[0], f[2:2]) \
- in_reduction (*: s[1:2], t[2:2][:])
+ in_reduction (+: o[n:n*2], q[1:2][ : ], p[0], m[1], r[2:2]) \
+ in_reduction (+: g[n:n * 2], e[1], k[1:2][ : ], h[0], f[2:2]) \
+ in_reduction (*: s[1:2], t[2:2][ : ])
{
T j;
a[0].s += 2;
if (b[z + 2].t != 5 && b[z + 2].t != 9)
abort ();
for (j = 0; j < 2; j++)
- #pragma omp task in_reduction (+: a, c[:2]) \
+ #pragma omp task in_reduction (+: a, c[ :2]) \
in_reduction (*: b[2 * n:3 * n], d[n - 1:n + 1]) \
- in_reduction (+: e[1], f[2:2], g[n:n*2], h[0], k[1:2][:2]) \
- in_reduction (+: m[1], r[2:2], o[n:n*2], p[0], q[1:2][:2]) \
- in_reduction (*: s[n:2], t[2:2][:])
+ in_reduction (+: e[1], f[2:2], g[n:n*2], h[0], k[1:2][ :2]) \
+ in_reduction (+: m[1], r[2:2], o[n:n*2], p[0], q[1:2][ :2]) \
+ in_reduction (*: s[n:2], t[2:2][ : ])
{
m[1].s += 6;
r[2].s += 7;
{
T i;
for (i = 0; i < 2; i++)
- #pragma omp task in_reduction (+: a, c[:2]) in_reduction (*: b[2 * n:3 * n], d[0:2]) \
- in_reduction (+: o[n:n*2], m[1], k[1:2][:], p[0], f[2:2]) \
- in_reduction (+: q[1:2][:], g[n:n*2], e[1], h[0], r[2:2]) \
- in_reduction (*: s[1:2], t[2:2][:])
+ #pragma omp task in_reduction (+: a, c[ :2]) in_reduction (*: b[2 * n:3 * n], d[0:2]) \
+ in_reduction (+: o[n:n*2], m[1], k[1:2][ : ], p[0], f[2:2]) \
+ in_reduction (+: q[1:2][ : ], g[n:n*2], e[1], h[0], r[2:2]) \
+ in_reduction (*: s[1:2], t[2:2][ : ])
{
a[0] += 7;
a[1] += 17;
T (&o)[4] = os;
#pragma omp taskgroup task_reduction (+: a, c) task_reduction (*: b[2 * n:3 * n], d) \
task_reduction (+: e[1], f[2:2], g[n:n*2], h[0], k[1:2][0:2]) \
- task_reduction (+: o[n:n*2], m[1], q[1:2][:], p[0], r[2:2]) \
- task_reduction (*: t[2:2][:], s[1:n + 1])
+ task_reduction (+: o[n:n*2], m[1], q[1:2][ : ], p[0], r[2:2]) \
+ task_reduction (*: t[2:2][ : ], s[1:n + 1])
{
T i;
for (i = 0; i < 4; i++)
#pragma omp task in_reduction (+: a, c) in_reduction (*: b[2 * n:3 * n], d) \
- in_reduction (+: o[n:n*2], q[1:2][:], p[0], m[1], r[2:2]) \
- in_reduction (+: g[n:n * 2], e[1], k[1:2][:], h[0], f[2:2]) \
- in_reduction (*: s[1:2], t[2:2][:])
+ in_reduction (+: o[n:n*2], q[1:2][ : ], p[0], m[1], r[2:2]) \
+ in_reduction (+: g[n:n * 2], e[1], k[1:2][ : ], h[0], f[2:2]) \
+ in_reduction (*: s[1:2], t[2:2][ : ])
{
T j;
a[0] += 2;
t[2][1] *= 2;
t[3][1] *= 2;
for (j = 0; j < 2; j++)
- #pragma omp task in_reduction (+: a, c[:2]) \
+ #pragma omp task in_reduction (+: a, c[ :2]) \
in_reduction (*: b[2 * n:3 * n], d[n - 1:n + 1]) \
- in_reduction (+: e[1], f[2:2], g[n:n*2], h[0], k[1:2][:2]) \
- in_reduction (+: m[1], r[2:2], o[n:n*2], p[0], q[1:2][:2]) \
- in_reduction (*: s[n:2], t[2:2][:])
+ in_reduction (+: e[1], f[2:2], g[n:n*2], h[0], k[1:2][ :2]) \
+ in_reduction (+: m[1], r[2:2], o[n:n*2], p[0], q[1:2][ :2]) \
+ in_reduction (*: s[n:2], t[2:2][ : ])
{
m[1] += 6;
r[2] += 7;
{
int i;
for (i = 0; i < 2; i++)
- #pragma omp task in_reduction (+: a, c[:2]) in_reduction (*: b[2 * n:3 * n], d[0:2]) \
- in_reduction (+: o[n:n*2], m[1], k[1:2][:], p[0], f[2:2]) \
- in_reduction (+: q[1:2][:], g[n:n*2], e[1], h[0], r[2:2]) \
- in_reduction (*: s[1:2], t[2:2][:])
+ #pragma omp task in_reduction (+: a, c[ :2]) in_reduction (*: b[2 * n:3 * n], d[0:2]) \
+ in_reduction (+: o[n:n*2], m[1], k[1:2][ : ], p[0], f[2:2]) \
+ in_reduction (+: q[1:2][ : ], g[n:n*2], e[1], h[0], r[2:2]) \
+ in_reduction (*: s[1:2], t[2:2][ : ])
{
a[0].s += 7;
a[1].s += 17;
S o[4] = { { 1, 7 }, { 0, 7 }, { 0, 7 }, { 2, 7 } };
#pragma omp taskgroup task_reduction (+: a, c) task_reduction (*: b[2 * n:3 * n], d) \
task_reduction (+: e[1], f[2:2], g[n:n*2], h[0], k[1:2][0:2]) \
- task_reduction (+: o[n:n*2], m[1], q[1:2][:], p[0], r[2:2]) \
- task_reduction (*: t[2:2][:], s[1:n + 1])
+ task_reduction (+: o[n:n*2], m[1], q[1:2][ : ], p[0], r[2:2]) \
+ task_reduction (*: t[2:2][ : ], s[1:n + 1])
{
int i;
for (i = 0; i < 4; i++)
#pragma omp task in_reduction (+: a, c) in_reduction (*: b[2 * n:3 * n], d) \
- in_reduction (+: o[n:n*2], q[1:2][:], p[0], m[1], r[2:2]) \
- in_reduction (+: g[n:n * 2], e[1], k[1:2][:], h[0], f[2:2]) \
- in_reduction (*: s[1:2], t[2:2][:])
+ in_reduction (+: o[n:n*2], q[1:2][ : ], p[0], m[1], r[2:2]) \
+ in_reduction (+: g[n:n * 2], e[1], k[1:2][ : ], h[0], f[2:2]) \
+ in_reduction (*: s[1:2], t[2:2][ : ])
{
int j;
a[0].s += 2;
if (b[z + 2].t != 5 && b[z + 2].t != 9)
abort ();
for (j = 0; j < 2; j++)
- #pragma omp task in_reduction (+: a, c[:2]) \
+ #pragma omp task in_reduction (+: a, c[ :2]) \
in_reduction (*: b[2 * n:3 * n], d[n - 1:n + 1]) \
- in_reduction (+: e[1], f[2:2], g[n:n*2], h[0], k[1:2][:2]) \
- in_reduction (+: m[1], r[2:2], o[n:n*2], p[0], q[1:2][:2]) \
- in_reduction (*: s[n:2], t[2:2][:])
+ in_reduction (+: e[1], f[2:2], g[n:n*2], h[0], k[1:2][ :2]) \
+ in_reduction (+: m[1], r[2:2], o[n:n*2], p[0], q[1:2][ :2]) \
+ in_reduction (*: s[n:2], t[2:2][ : ])
{
m[1].s += 6;
r[2].s += 7;
{
int i;
for (i = 0; i < 2; i++)
- #pragma omp task in_reduction (+: a, c[:2]) in_reduction (*: b[2 * n:3 * n], d[0:2]) \
- in_reduction (+: o[n:n*2], m[1], k[1:2][:], p[0], f[2:2]) \
- in_reduction (+: q[1:2][:], g[n:n*2], e[1], h[0], r[2:2]) \
- in_reduction (*: s[1:2], t[2:2][:])
+ #pragma omp task in_reduction (+: a, c[ :2]) in_reduction (*: b[2 * n:3 * n], d[0:2]) \
+ in_reduction (+: o[n:n*2], m[1], k[1:2][ : ], p[0], f[2:2]) \
+ in_reduction (+: q[1:2][ : ], g[n:n*2], e[1], h[0], r[2:2]) \
+ in_reduction (*: s[1:2], t[2:2][ : ])
{
a[0].s += 7;
a[1].s += 17;
S (&o)[4] = os;
#pragma omp taskgroup task_reduction (+: a, c) task_reduction (*: b[2 * n:3 * n], d) \
task_reduction (+: e[1], f[2:2], g[n:n*2], h[0], k[1:2][0:2]) \
- task_reduction (+: o[n:n*2], m[1], q[1:2][:], p[0], r[2:2]) \
- task_reduction (*: t[2:2][:], s[1:n + 1])
+ task_reduction (+: o[n:n*2], m[1], q[1:2][ : ], p[0], r[2:2]) \
+ task_reduction (*: t[2:2][ : ], s[1:n + 1])
{
int i;
for (i = 0; i < 4; i++)
#pragma omp task in_reduction (+: a, c) in_reduction (*: b[2 * n:3 * n], d) \
- in_reduction (+: o[n:n*2], q[1:2][:], p[0], m[1], r[2:2]) \
- in_reduction (+: g[n:n * 2], e[1], k[1:2][:], h[0], f[2:2]) \
- in_reduction (*: s[1:2], t[2:2][:])
+ in_reduction (+: o[n:n*2], q[1:2][ : ], p[0], m[1], r[2:2]) \
+ in_reduction (+: g[n:n * 2], e[1], k[1:2][ : ], h[0], f[2:2]) \
+ in_reduction (*: s[1:2], t[2:2][ : ])
{
int j;
a[0].s += 2;
if (b[z + 2].t != 5 && b[z + 2].t != 9)
abort ();
for (j = 0; j < 2; j++)
- #pragma omp task in_reduction (+: a, c[:2]) \
+ #pragma omp task in_reduction (+: a, c[ :2]) \
in_reduction (*: b[2 * n:3 * n], d[n - 1:n + 1]) \
- in_reduction (+: e[1], f[2:2], g[n:n*2], h[0], k[1:2][:2]) \
- in_reduction (+: m[1], r[2:2], o[n:n*2], p[0], q[1:2][:2]) \
- in_reduction (*: s[n:2], t[2:2][:])
+ in_reduction (+: e[1], f[2:2], g[n:n*2], h[0], k[1:2][ :2]) \
+ in_reduction (+: m[1], r[2:2], o[n:n*2], p[0], q[1:2][ :2]) \
+ in_reduction (*: s[n:2], t[2:2][ : ])
{
m[1].s += 6;
r[2].s += 7;
void
bar (int *a, int *b, int *c, int (*d)[2], int (*e)[4], int *f, int *g, size_t n)
{
- #pragma omp task in_reduction (*: a[:n], b[3:n], c[n:n], d[0][:n], e[0][1:n], f[:n], g[1:n])
+ #pragma omp task in_reduction (*: a[ :n], b[3:n], c[n:n], d[0][ :n], e[0][1:n], f[ :n], g[1:n])
{
a[0] *= 12;
a[1] *= 13;
f[i] = 1;
g[i + 1] = 1;
}
- #pragma omp taskgroup task_reduction (*: a, b[3:n], c[n:n], d[0][:n], e[0][1:n], f, g[1:n])
+ #pragma omp taskgroup task_reduction (*: a, b[3:n], c[n:n], d[0][ :n], e[0][1:n], f, g[1:n])
{
bar (a, b, c, (int (*)[2]) d, (int (*)[4]) e, &f[0], &g[0], n);
- #pragma omp task in_reduction (*: a, b[3:n], c[n:n], d[0][:n], e[0][1:n], f, g[1:n])
+ #pragma omp task in_reduction (*: a, b[3:n], c[n:n], d[0][ :n], e[0][1:n], f, g[1:n])
{
a[0] *= 2;
a[1] *= 3;
{
int (&f)[n] = fb;
int (&g)[n * 2] = gb;
- #pragma omp taskgroup task_reduction (*: a, b[3:n], c[n:n], d[0][:n], e[0][1:n], f, g[1:n])
+ #pragma omp taskgroup task_reduction (*: a, b[3:n], c[n:n], d[0][ :n], e[0][1:n], f, g[1:n])
{
bar (a, b, c, (int (*)[2]) d, (int (*)[4]) e, &f[0], &g[0], n);
- #pragma omp task in_reduction (*: a, b[3:n], c[n:n], d[0][:n], e[0][1:n], f, g[1:n])
+ #pragma omp task in_reduction (*: a, b[3:n], c[n:n], d[0][ :n], e[0][1:n], f, g[1:n])
{
a[0] *= 2;
a[1] *= 3;
int i;
U u;
u.u[2] = 8;
- #pragma omp taskloop in_reduction (+: a, c[:2]) in_reduction (*: b[2 * n:3 * n], d[0:2]) \
- in_reduction (+: o[n:n*2], m[1], k[1:2][:], p[0], f[2:2]) \
- in_reduction (+: q[1:2][:], g[n:n*2], e[1], h[0], r[2:2]) \
- in_reduction (*: s[1:2], t[2:2][:]) firstprivate (u) nogroup
+ #pragma omp taskloop in_reduction (+: a, c[ :2]) in_reduction (*: b[2 * n:3 * n], d[0:2]) \
+ in_reduction (+: o[n:n*2], m[1], k[1:2][ : ], p[0], f[2:2]) \
+ in_reduction (+: q[1:2][ : ], g[n:n*2], e[1], h[0], r[2:2]) \
+ in_reduction (*: s[1:2], t[2:2][ : ]) firstprivate (u) nogroup
for (i = 0; i < 2; i++)
{
a[0] += 7;
int i;
#pragma omp taskloop reduction (+: a, c) reduction (*: b[2 * n:3 * n], d) \
reduction (+: e[1], f[2:2], g[n:n*2], h[0], k[1:2][0:2]) \
- reduction (+: o[n:n*2], m[1], q[1:2][:], p[0], r[2:2]) \
- reduction (*: t[2:2][:], s[1:n + 1]) firstprivate (u)
+ reduction (+: o[n:n*2], m[1], q[1:2][ : ], p[0], r[2:2]) \
+ reduction (*: t[2:2][ : ], s[1:n + 1]) firstprivate (u)
for (i = 0; i < 4; i++)
{
int j;
if (u.u[2] != 10)
abort ();
for (j = 0; j < 2; j++)
- #pragma omp task in_reduction (+: a, c[:2]) \
+ #pragma omp task in_reduction (+: a, c[ :2]) \
in_reduction (*: b[2 * n:3 * n], d[n - 1:n + 1]) \
- in_reduction (+: e[1], f[2:2], g[n:n*2], h[0], k[1:2][:2]) \
- in_reduction (+: m[1], r[2:2], o[n:n*2], p[0], q[1:2][:2]) \
- in_reduction (*: s[n:2], t[2:2][:]) firstprivate (u)
+ in_reduction (+: e[1], f[2:2], g[n:n*2], h[0], k[1:2][ :2]) \
+ in_reduction (+: m[1], r[2:2], o[n:n*2], p[0], q[1:2][ :2]) \
+ in_reduction (*: s[n:2], t[2:2][ : ]) firstprivate (u)
{
m[1] += 6;
r[2] += 7;
foo (int n, S *c, S *d, S m[3], S *r, S o[4], S *p, S q[4][2])
{
int i;
- #pragma omp taskloop in_reduction (+: a, c[:2]) in_reduction (*: b[2 * n:3 * n], d[0:2]) \
- in_reduction (+: o[n:n*2], m[1], k[1:2][:], p[0], f[2:2]) \
- in_reduction (+: q[1:2][:], g[n:n*2], e[1], h[0], r[2:2]) \
- in_reduction (*: s[1:2], t[2:2][:]) nogroup
+ #pragma omp taskloop in_reduction (+: a, c[ :2]) in_reduction (*: b[2 * n:3 * n], d[0:2]) \
+ in_reduction (+: o[n:n*2], m[1], k[1:2][ : ], p[0], f[2:2]) \
+ in_reduction (+: q[1:2][ : ], g[n:n*2], e[1], h[0], r[2:2]) \
+ in_reduction (*: s[1:2], t[2:2][ : ]) nogroup
for (i = 0; i < 2; i++)
{
a[0].s += 7;
int i;
#pragma omp taskloop reduction (+: a, c) reduction (*: b[2 * n:3 * n], d) \
reduction (+: e[1], f[2:2], g[n:n*2], h[0], k[1:2][0:2]) \
- reduction (+: o[n:n*2], m[1], q[1:2][:], p[0], r[2:2]) \
- reduction (*: t[2:2][:], s[1:n + 1])
+ reduction (+: o[n:n*2], m[1], q[1:2][ : ], p[0], r[2:2]) \
+ reduction (*: t[2:2][ : ], s[1:n + 1])
for (i = 0; i < 4; i++)
{
int j;
for (int z = 0; z < 3; z++)
if (b[z + 2].t != 5 && b[z + 2].t != 9)
abort ();
- #pragma omp taskloop in_reduction (+: a, c[:2]) \
+ #pragma omp taskloop in_reduction (+: a, c[ :2]) \
in_reduction (*: b[2 * n:3 * n], d[n - 1:n + 1]) \
- in_reduction (+: e[1], f[2:2], g[n:n*2], h[0], k[1:2][:2]) \
- in_reduction (+: m[1], r[2:2], o[n:n*2], p[0], q[1:2][:2]) \
- in_reduction (*: s[n:2], t[2:2][:]) nogroup
+ in_reduction (+: e[1], f[2:2], g[n:n*2], h[0], k[1:2][ :2]) \
+ in_reduction (+: m[1], r[2:2], o[n:n*2], p[0], q[1:2][ :2]) \
+ in_reduction (*: s[n:2], t[2:2][ : ]) nogroup
for (j = 0; j < 2; j++)
{
m[1].s += 6;
foo (int n, S *c, S *d, S m[3], S *r, S o[4], S *p, S q[4][2])
{
int i;
- #pragma omp taskloop in_reduction (+: a, c[:2]) in_reduction (*: b[2 * n:3 * n], d[0:2]) \
- reduction (default, +: o[n:n*2], m[1], p[0]) in_reduction (+: k[1:2][:], f[2:2]) \
- reduction (+: q[1:2][:], r[2:2]) in_reduction (+: g[n:n*2], e[1], h[0]) \
- in_reduction (*: s[1:2], t[2:2][:])
+ #pragma omp taskloop in_reduction (+: a, c[ :2]) in_reduction (*: b[2 * n:3 * n], d[0:2]) \
+ reduction (default, +: o[n:n*2], m[1], p[0]) in_reduction (+: k[1:2][ : ], f[2:2]) \
+ reduction (+: q[1:2][ : ], r[2:2]) in_reduction (+: g[n:n*2], e[1], h[0]) \
+ in_reduction (*: s[1:2], t[2:2][ : ])
for (i = 0; i < 2; i++)
{
a[0].s += 7;
int i;
#pragma omp taskloop reduction (+: a, c) reduction (default, *: b[2 * n:3 * n], d) \
reduction (+: e[1], f[2:2], g[n:n*2], h[0], k[1:2][0:2]) \
- reduction (+: o[n:n*2], m[1], q[1:2][:], p[0], r[2:2]) \
- reduction (*: t[2:2][:], s[1:n + 1])
+ reduction (+: o[n:n*2], m[1], q[1:2][ : ], p[0], r[2:2]) \
+ reduction (*: t[2:2][ : ], s[1:n + 1])
for (i = 0; i < 4; i++)
{
int j;
for (int z = 0; z < 3; z++)
if (b[z + 2].t != 5 && b[z + 2].t != 9)
abort ();
- #pragma omp taskloop in_reduction (+: a, c[:2]) \
+ #pragma omp taskloop in_reduction (+: a, c[ :2]) \
in_reduction (*: b[2 * n:3 * n], d[n - 1:n + 1]) \
- in_reduction (+: e[1], f[2:2], g[n:n*2], h[0], k[1:2][:2]) \
- in_reduction (+: m[1], r[2:2], o[n:n*2], p[0], q[1:2][:2]) \
- in_reduction (*: s[n:2], t[2:2][:]) nogroup
+ in_reduction (+: e[1], f[2:2], g[n:n*2], h[0], k[1:2][ :2]) \
+ in_reduction (+: m[1], r[2:2], o[n:n*2], p[0], q[1:2][ :2]) \
+ in_reduction (*: s[n:2], t[2:2][ : ]) nogroup
for (j = 0; j < 2; j++)
{
m[1].s += 6;
if ((fl & 2) && (((uintptr_t) &i5) & 63) != 0)
abort ();
}
- #pragma omp for reduction(+:p[2:px], q[:3], r2) allocate(h: p, q, r2)
+ #pragma omp for reduction(+:p[2:px], q[ :3], r2) allocate(h: p, q, r2)
for (i = 0; i < 32; i++)
{
p[2] += i;
if ((((uintptr_t) &i5) & 31) != 0)
abort ();
}
- #pragma omp for reduction(+:p[2:px], q[:3], r2) allocate(align (16), allocator (h): p, q, r2)
+ #pragma omp for reduction(+:p[2:px], q[ :3], r2) allocate(align (16), allocator (h): p, q, r2)
for (i = 0; i < 32; i++)
{
p[2] += i;
#pragma omp target map(to: p->b, p->b[0], p->c, p->c[0], p->b->c, p->b->c[0]) \
map(to: p->b->c->ptr, p->c->ptr) \
- map(tofrom: p->b->c->ptr[:N], p->c->ptr[:N])
+ map(tofrom: p->b->c->ptr[ :N], p->c->ptr[ :N])
{
for (int i = 0; i < N; i++)
{
}
int f, last_dev = omp_get_num_devices () - 1;
-#pragma omp target data map(to: av[:n]) map(from: d_bv[:n]) device(last_dev) if (n == 1024)
+#pragma omp target data map(to: av[ :n]) map(from: d_bv[ :n]) device(last_dev) if (n == 1024)
{
#pragma omp dispatch nocontext(n > 1024) novariants(n < 1024) device(last_dev)
f = foo (d_bv, av, n);
}
int f, last_dev = omp_get_num_devices () - 1;
-#pragma omp target data map(to: av[:n]) map(from: d_bv[:n]) device(last_dev) if (n == 1024)
+#pragma omp target data map(to: av[ :n]) map(from: d_bv[ :n]) device(last_dev) if (n == 1024)
{
#pragma omp dispatch nocontext(n > 1024) novariants(n < 1024) device(last_dev)
f = foo (d_bv, av, n);
As OpenMP_VV's Issue #863 shows, the overhead is high enough to
fail even when only doing an atomic integer increment. */
- #pragma omp target device(dev) map(A) depend(out: A[:N]) nowait
+ #pragma omp target device(dev) map(A) depend(out: A[ :N]) nowait
for (int i = 0; i < N; i++)
#pragma omp atomic update
A[i] += __builtin_sin (2*i*M_PI/N);
if (obj1 == omp_interop_none)
{
// Same as below as 'nowait' is ignored.
- #pragma omp interop destroy(obj1) depend(in: A[:N]) nowait
+ #pragma omp interop destroy(obj1) depend(in: A[ :N]) nowait
}
else
{
- #pragma omp interop destroy(obj1) depend(in: A[:N])
+ #pragma omp interop destroy(obj1) depend(in: A[ :N])
}
/* ... this code is only executed once the dependency as been fulfilled. */
/* Integer */
- #pragma omp target device(dev) map(B) depend(out: B[:N]) nowait
+ #pragma omp target device(dev) map(B) depend(out: B[ :N]) nowait
for (int i = 0; i < N; i++)
#pragma omp atomic update
B[i] += 42;
if (obj2 == omp_interop_none)
{
// Same as below as 'nowait' is ignored.
- #pragma omp interop use(obj2) depend(in: B[:N]) nowait
+ #pragma omp interop use(obj2) depend(in: B[ :N]) nowait
}
else
{
- #pragma omp interop use(obj2) depend(in: B[:N])
+ #pragma omp interop use(obj2) depend(in: B[ :N])
}
for (int i = 0; i < N; i++)
/* { dg-do run { target { offload_device } } } */
/* { dg-additional-options "-Wall -Wno-unknown-pragmas" } */
-#define COMMON_DIRECTIVE omp target teams distribute parallel for map(tofrom:result[:dim0 * dim1]) map(to:matrix1[0:dim0 * dim1], matrix2[0:dim0 * dim1])
+#define COMMON_DIRECTIVE omp target teams distribute parallel for map(tofrom:result[ :dim0 * dim1]) map(to:matrix1[0:dim0 * dim1], matrix2[0:dim0 * dim1])
#define COLLAPSE_1 collapse(1)
#define COLLAPSE_2 collapse(2)
#define COLLAPSE_3
int *ptr = (int *) malloc (sizeof (int) * N);
int *orig_ptr = ptr;
- #pragma omp target map (ptr, ptr[:N])
+ #pragma omp target map (ptr, ptr[ :N])
{
for (int i = 0; i < N; i++)
ptr[i] = N - i;
S s = { 0 };
s.ptr = ptr;
- #pragma omp target map (s, s.ptr[:N])
+ #pragma omp target map (s, s.ptr[ :N])
{
for (int i = 0; i < N; i++)
s.ptr[i] = i;
for (int i = 0; i < N; i++)
gp[i] = i - 1;
- #pragma omp target map (gp[:N])
+ #pragma omp target map (gp[ :N])
{
for (int i = 0; i < N; i++)
gp[i] += 1;
l->m.num_blocks[i] = N;
}
- #pragma omp target enter data map(to:l[:1])
+ #pragma omp target enter data map(to:l[ :1])
for (int i = 0; i < N; i++)
{
- #pragma omp target enter data map(to:l->m.blocks[i][:l->m.num_blocks[i]])
+ #pragma omp target enter data map(to:l->m.blocks[i][ :l->m.num_blocks[i]])
}
#pragma omp target
for (int i = 0; i < N; i++)
{
- #pragma omp target exit data map(from:l->m.blocks[i][:l->m.num_blocks[i]])
+ #pragma omp target exit data map(from:l->m.blocks[i][ :l->m.num_blocks[i]])
}
- #pragma omp target exit data map(from:l[:1])
+ #pragma omp target exit data map(from:l[ :1])
for (int i = 0; i < N; i++)
unsigned char *p = (unsigned char *) &a;
unsigned char *q = p + 2;
- #pragma omp target enter data map (alloc:p[:1], q[:1])
+ #pragma omp target enter data map (alloc:p[ :1], q[ :1])
if (d != id)
{
abort ();
}
- #pragma omp target exit data map (from:q[:1])
+ #pragma omp target exit data map (from:q[ :1])
if (d != id)
{
int *p = &s.b;
int *q = &s.d;
- #pragma omp target enter data map (alloc: p[:1], q[:1])
+ #pragma omp target enter data map (alloc: p[ :1], q[ :1])
s.b = 88;
s.d = 99;
abort ();
}
- #pragma omp target exit data map (from: q[:1])
+ #pragma omp target exit data map (from: q[ :1])
if (d != id)
{
if (omp_target_is_present (&s, d))
int i;
fn1 (b, c, x);
fn1 (e, d + x, x);
- #pragma omp target map(to: b, c[:x], d[x:x], e) map(tofrom: s)
+ #pragma omp target map(to: b, c[ :x], d[x:x], e) map(tofrom: s)
#pragma omp parallel for reduction(+:s)
for (i = 0; i < x; i++)
s += b[i] * c[i] + d[x + i] + sizeof (b) - sizeof (c);
int i;
fn1 (b, c, x);
fn1 (e, d + x, x);
- #pragma omp target data map(from: b, c[:x], d[x:x], e)
+ #pragma omp target data map(from: b, c[ :x], d[x:x], e)
{
- #pragma omp target update to(b, c[:x], d[x:x], e)
- #pragma omp target map(c[:x], d[x:x], s)
+ #pragma omp target update to(b, c[ :x], d[x:x], e)
+ #pragma omp target map(c[ :x], d[x:x], s)
#pragma omp parallel for reduction(+:s)
for (i = 0; i < x; i++)
{
if (y[i] != i)
__builtin_abort ();
- #pragma omp target data map(y[:N]) use_device_addr(y)
- #pragma omp target has_device_addr(y[:N])
+ #pragma omp target data map(y[ :N]) use_device_addr(y)
+ #pragma omp target has_device_addr(y[ :N])
for (int i = 0; i < N; i++)
y[i] = i + 2;
for (int i = 0; i < N; i++)
if (y[i] != i + 2)
__builtin_abort ();
- #pragma omp target data map(y[:N]) use_device_addr(y)
+ #pragma omp target data map(y[ :N]) use_device_addr(y)
#pragma omp target has_device_addr(y[24])
y[24] = 42;
if (y[24] != 42)
__builtin_abort ();
- #pragma omp target data map(y[:N]) use_device_addr(y)
- #pragma omp target has_device_addr(y[24:])
+ #pragma omp target data map(y[ :N]) use_device_addr(y)
+ #pragma omp target has_device_addr(y[24: ])
for (int i = 24; i < N; i++)
y[i] = i + 3;
for (int i = 24; i < N; i++)
if (y[i] != i + 3)
__builtin_abort ();
- #pragma omp target data map(y[:N]) use_device_addr(y)
+ #pragma omp target data map(y[ :N]) use_device_addr(y)
#pragma omp target has_device_addr(y[12:24])
for (int i = 12; i < 24; i++)
y[i] = i + 4;
for (int i = 0; i < N; i++)
a.ptr[i] = 0;
- #pragma omp target enter data map(to: a.ptr, a.ptr[:N])
+ #pragma omp target enter data map(to: a.ptr, a.ptr[ :N])
#pragma omp target
for (int i = 0; i < N; i++)
a.ptr[i] += 1;
- #pragma omp target update from(a.ptr[:N])
+ #pragma omp target update from(a.ptr[ :N])
for (int i = 0; i < N; i++)
if (a.ptr[i] != 1)
abort ();
- #pragma omp target map(a.ptr[:N])
+ #pragma omp target map(a.ptr[ :N])
for (int i = 0; i < N; i++)
a.ptr[i] += 1;
- #pragma omp target update from(a.ptr[:N])
+ #pragma omp target update from(a.ptr[ :N])
for (int i = 0; i < N; i++)
if (a.ptr[i] != 2)
abort ();
- #pragma omp target exit data map(from:a.ptr, a.ptr[:N])
+ #pragma omp target exit data map(from:a.ptr, a.ptr[ :N])
free (a.ptr);
a.ptr[i] = 0;
#pragma omp target enter data map(to: a.ptr)
- #pragma omp target enter data map(to: a.ptr[:N])
+ #pragma omp target enter data map(to: a.ptr[ :N])
#pragma omp target
for (int i = 0; i < N; i++)
a.ptr[i] += 1;
- #pragma omp target update from(a.ptr[:N])
+ #pragma omp target update from(a.ptr[ :N])
for (int i = 0; i < N; i++)
if (a.ptr[i] != 1)
abort ();
- #pragma omp target map(a.ptr[:N])
+ #pragma omp target map(a.ptr[ :N])
for (int i = 0; i < N; i++)
a.ptr[i] += 1;
- #pragma omp target update from(a.ptr[:N])
+ #pragma omp target update from(a.ptr[ :N])
for (int i = 0; i < N; i++)
if (a.ptr[i] != 2)
abort ();
- #pragma omp target exit data map(release: a.ptr[:N])
+ #pragma omp target exit data map(release: a.ptr[ :N])
#pragma omp target exit data map(release: a.ptr)
free (a.ptr);
int u[n], w[n], i;
for (i = 0; i < n; i++)
w[i] = u[i] = n + i;
- #pragma omp taskgroup task_reduction (+: x, y[:2], z[1:2], u, w[1:v])
+ #pragma omp taskgroup task_reduction (+: x, y[ :2], z[1:2], u, w[1:v])
{
- #pragma omp task in_reduction (+: x, y[:2], z[1:2], u, w[1:v])
+ #pragma omp task in_reduction (+: x, y[ :2], z[1:2], u, w[1:v])
{
x++;
y[0] += 2;
u[0] += 5;
w[1] += 6;
}
- #pragma omp target in_reduction (+: x, y[:2], z[1:2], u, w[1:v])
+ #pragma omp target in_reduction (+: x, y[ :2], z[1:2], u, w[1:v])
{
x += 4;
y[0] += 5;
u[1] += 8;
w[2] += 7;
}
- #pragma omp target in_reduction (+: x, y[:v], z[1:v], u, w[1:2])
+ #pragma omp target in_reduction (+: x, y[ :v], z[1:v], u, w[1:2])
{
x += 9;
y[0] += 10;
for (i = 0; i < n; i++)
w[i] = u[i] = n + i;
#pragma omp parallel master
- #pragma omp taskgroup task_reduction (+: x, y[:2], z[1:2], u, w[1:v])
+ #pragma omp taskgroup task_reduction (+: x, y[ :2], z[1:2], u, w[1:v])
{
- #pragma omp task in_reduction (+: x, y[:2], z[1:2], u, w[1:v])
+ #pragma omp task in_reduction (+: x, y[ :2], z[1:2], u, w[1:v])
{
x++;
y[0] += 2;
u[0] += 5;
w[1] += 6;
}
- #pragma omp target in_reduction (+: x, y[:2], z[1:2], u, w[1:v])
+ #pragma omp target in_reduction (+: x, y[ :2], z[1:2], u, w[1:v])
{
x += 4;
y[0] += 5;
u[1] += 8;
w[2] += 7;
}
- #pragma omp target in_reduction (+: x, y[:v], z[1:v], u, w[1:2])
+ #pragma omp target in_reduction (+: x, y[ :v], z[1:v], u, w[1:2])
{
x += 9;
y[0] += 10;
w[i].c[0] = u[i].c[0] = 0;
w[i].c[1] = u[i].c[1] = 0;
}
- #pragma omp taskgroup task_reduction (+: x, y[:2], z[1:2], u, w[1:v])
+ #pragma omp taskgroup task_reduction (+: x, y[ :2], z[1:2], u, w[1:v])
{
- #pragma omp task in_reduction (+: x, y[:2], z[1:2], u, w[1:v])
+ #pragma omp task in_reduction (+: x, y[ :2], z[1:2], u, w[1:v])
{
x.a++;
x.b++;
w[1].a += 6;
w[1].b += 16;
}
- #pragma omp target in_reduction (+: x, y[:2], z[1:2], u, w[1:v]) map(tofrom: x.a, x.b, x.c[:2])
+ #pragma omp target in_reduction (+: x, y[ :2], z[1:2], u, w[1:v]) map(tofrom: x.a, x.b, x.c[ :2])
{
x.a += 4;
x.b += 14;
w[2].a += 7;
w[2].b += 17;
}
- #pragma omp target in_reduction (+: x, y[:v], z[1:v], u, w[1:2])
+ #pragma omp target in_reduction (+: x, y[ :v], z[1:v], u, w[1:2])
{
x.a += 9;
x.b += 19;
w[i].c[1] = u[i].c[1] = 0;
}
#pragma omp parallel master
- #pragma omp taskgroup task_reduction (+: x, y[:2], z[1:2], u, w[1:v])
+ #pragma omp taskgroup task_reduction (+: x, y[ :2], z[1:2], u, w[1:v])
{
- #pragma omp task in_reduction (+: x, y[:2], z[1:2], u, w[1:v])
+ #pragma omp task in_reduction (+: x, y[ :2], z[1:2], u, w[1:v])
{
x.a++;
x.b++;
w[1].a += 6;
w[1].b += 16;
}
- #pragma omp target in_reduction (+: x, y[:2], z[1:2], u, w[1:v]) map(tofrom: x.a, x.b, x.c[:2])
+ #pragma omp target in_reduction (+: x, y[ :2], z[1:2], u, w[1:v]) map(tofrom: x.a, x.b, x.c[ :2])
{
x.a += 4;
x.b += 14;
w[2].a += 7;
w[2].b += 17;
}
- #pragma omp target in_reduction (+: x, y[:v], z[1:v], u, w[1:2])
+ #pragma omp target in_reduction (+: x, y[ :v], z[1:v], u, w[1:2])
{
x.a += 9;
x.b += 19;
int expected = mkarray (x);
#pragma omp target enter data map(to: x)
- #pragma omp target map(iterator(i=0:DIM1), to: x[i][:DIM2]) \
+ #pragma omp target map(iterator(i=0:DIM1), to: x[i][ :DIM2]) \
map(from: y)
{
y = 0;
mkarray (x);
#pragma omp target enter data map(alloc: x)
- #pragma omp target map(iterator(i=0:DIM1), from: x[i][:DIM2]) \
+ #pragma omp target map(iterator(i=0:DIM1), from: x[i][ :DIM2]) \
map(from: expected)
{
expected = 0;
int expected = mkarrays (x, y);
#pragma omp target enter data map(to: x, y)
- #pragma omp target map(iterator(i=0:DIM1/4, j=0:4), to: x[f(i, j)][:DIM2]) \
- map(iterator(i=0:DIM1), to: y[i][:1]) \
+ #pragma omp target map(iterator(i=0:DIM1/4, j=0:4), to: x[f(i, j)][ :DIM2]) \
+ map(iterator(i=0:DIM1), to: y[i][ :1]) \
map(from: sum)
{
sum = 0;
for (int i = 0; i < N; i++)
a.ptr[i] = 0;
- #pragma omp target enter data map(to: a.ptr[:N])
+ #pragma omp target enter data map(to: a.ptr[ :N])
- #pragma omp target map(a, a.ptr[:0])
+ #pragma omp target map(a, a.ptr[ :0])
for (int i = 0; i < N; i++)
a.ptr[i] += 1;
- #pragma omp target exit data map(from: a.ptr[:N])
+ #pragma omp target exit data map(from: a.ptr[ :N])
for (int i = 0; i < N; i++)
if (a.ptr[i] != 1)
int sum;
int expected = mkarray (x);
- #pragma omp target enter data map(to: x[:DIM1])
- #pragma omp target enter data map(iterator(i=0:DIM1), to: x[i][:DIM2])
+ #pragma omp target enter data map(to: x[ :DIM1])
+ #pragma omp target enter data map(iterator(i=0:DIM1), to: x[i][ :DIM2])
#pragma omp target map(from: sum)
{
sum = 0;
expected += x[i][j];
}
- #pragma omp target update to(iterator(i=0:DIM1): x[i][:DIM2])
+ #pragma omp target update to(iterator(i=0:DIM1): x[i][ :DIM2])
#pragma omp target map(from: sum)
{
mkarray (x);
- #pragma omp target enter data map(alloc: x[:DIM1])
- #pragma omp target enter data map(iterator(i=0:DIM1), to: x[i][:DIM2])
+ #pragma omp target enter data map(alloc: x[ :DIM1])
+ #pragma omp target enter data map(iterator(i=0:DIM1), to: x[i][ :DIM2])
#pragma omp target map(from: expected)
{
expected = 0;
if (sum != 0)
return 1;
- #pragma omp target update from(iterator(i=0:DIM1): x[i][:DIM2])
+ #pragma omp target update from(iterator(i=0:DIM1): x[i][ :DIM2])
/* Host copy should now be updated. */
sum = 0;
mkarray (x);
- #pragma omp target enter data map(alloc: x[:DIM1])
- #pragma omp target enter data map(iterator(i=0:DIM1), to: x[i][:DIM2])
+ #pragma omp target enter data map(alloc: x[ :DIM1])
+ #pragma omp target enter data map(iterator(i=0:DIM1), to: x[i][ :DIM2])
/* Update x on host. */
for (int i = 0; i < DIM1; i++)
}
/* Update a subset of x on target. */
- #pragma omp target update to(iterator(i=0:DIM1/2): x[f (i)][:DIM2])
+ #pragma omp target update to(iterator(i=0:DIM1/2): x[f (i)][ :DIM2])
#pragma omp target map(from: sum)
{
void
bar (int i)
{
- #pragma omp task in_reduction (*: b[:3]) in_reduction (&: c[1:]) \
+ #pragma omp task in_reduction (*: b[ :3]) in_reduction (&: c[1: ]) \
in_reduction (+: a)
{
a += 4;
void
bar (int i)
{
- #pragma omp task in_reduction (*: b[:3]) in_reduction (&: c[1:]) \
+ #pragma omp task in_reduction (*: b[ :3]) in_reduction (&: c[1: ]) \
in_reduction (+: a)
{
a += 4;
void
bar (int i)
{
- #pragma omp task in_reduction (*: b[:3]) in_reduction (&: c[1:]) \
+ #pragma omp task in_reduction (*: b[ :3]) in_reduction (&: c[1: ]) \
in_reduction (+: a)
{
a += 4;
{
int i;
for (i = 0; i < 2; i++)
- #pragma omp task in_reduction (+: a, c[:2]) in_reduction (*: b[2 * n:3 * n], d[0:2]) \
- in_reduction (+: o[n:n*2], m[1], k[1:2][:], p[0], f[2:2]) \
- in_reduction (+: q[1:2][:], g[n:n*2], e[1], h[0], r[2:2]) \
- in_reduction (*: s[1:2], t[2:2][:])
+ #pragma omp task in_reduction (+: a, c[ :2]) in_reduction (*: b[2 * n:3 * n], d[0:2]) \
+ in_reduction (+: o[n:n*2], m[1], k[1:2][ : ], p[0], f[2:2]) \
+ in_reduction (+: q[1:2][ : ], g[n:n*2], e[1], h[0], r[2:2]) \
+ in_reduction (*: s[1:2], t[2:2][ : ])
{
a[0] += 7;
a[1] += 17;
int o[4] = { 1, 0, 0, 2 };
#pragma omp taskgroup task_reduction (+: a, c) task_reduction (*: b[2 * n:3 * n], d) \
task_reduction (+: e[1], f[2:2], g[n:n*2], h[0], k[1:2][0:2]) \
- task_reduction (+: o[n:n*2], m[1], q[1:2][:], p[0], r[2:2]) \
- task_reduction (*: t[2:2][:], s[1:n + 1])
+ task_reduction (+: o[n:n*2], m[1], q[1:2][ : ], p[0], r[2:2]) \
+ task_reduction (*: t[2:2][ : ], s[1:n + 1])
{
int i;
for (i = 0; i < 4; i++)
#pragma omp task in_reduction (+: a, c) in_reduction (*: b[2 * n:3 * n], d) \
- in_reduction (+: o[n:n*2], q[1:2][:], p[0], m[1], r[2:2]) \
- in_reduction (+: g[n:n * 2], e[1], k[1:2][:], h[0], f[2:2]) \
- in_reduction (*: s[1:2], t[2:2][:])
+ in_reduction (+: o[n:n*2], q[1:2][ : ], p[0], m[1], r[2:2]) \
+ in_reduction (+: g[n:n * 2], e[1], k[1:2][ : ], h[0], f[2:2]) \
+ in_reduction (*: s[1:2], t[2:2][ : ])
{
int j;
a[0] += 2;
t[2][1] *= 2;
t[3][1] *= 2;
for (j = 0; j < 2; j++)
- #pragma omp task in_reduction (+: a, c[:2]) \
+ #pragma omp task in_reduction (+: a, c[ :2]) \
in_reduction (*: b[2 * n:3 * n], d[n - 1:n + 1]) \
- in_reduction (+: e[1], f[2:2], g[n:n*2], h[0], k[1:2][:2]) \
- in_reduction (+: m[1], r[2:2], o[n:n*2], p[0], q[1:2][:2]) \
- in_reduction (*: s[n:2], t[2:2][:])
+ in_reduction (+: e[1], f[2:2], g[n:n*2], h[0], k[1:2][ :2]) \
+ in_reduction (+: m[1], r[2:2], o[n:n*2], p[0], q[1:2][ :2]) \
+ in_reduction (*: s[n:2], t[2:2][ : ])
{
m[1] += 6;
r[2] += 7;
{
int i;
for (i = 0; i < 2; i++)
- #pragma omp task in_reduction (+: a, c[:2]) in_reduction (*: b[2 * n:3 * n], d[0:2]) \
- in_reduction (+: o[n:n*2], m[1], k[1:2][:], p[0], f[2:2]) \
- in_reduction (+: q[1:2][:], g[n:n*2], e[1], h[0], r[2:2]) \
- in_reduction (*: s[1:2], t[2:2][:])
+ #pragma omp task in_reduction (+: a, c[ :2]) in_reduction (*: b[2 * n:3 * n], d[0:2]) \
+ in_reduction (+: o[n:n*2], m[1], k[1:2][ : ], p[0], f[2:2]) \
+ in_reduction (+: q[1:2][ : ], g[n:n*2], e[1], h[0], r[2:2]) \
+ in_reduction (*: s[1:2], t[2:2][ : ])
{
a[0] += 7;
a[1] += 17;
t = tt;
#pragma omp parallel reduction (task, +: a, c) reduction (task, *: b[2 * n:3 * n], d) \
reduction (task, +: e[1], f[2:2], g[n:n*2], h[0], k[1:2][0:2]) \
- reduction (task, +: o[n:n*2], m[1], q[1:2][:], p[0], r[2:2]) \
- reduction (task, *: t[2:2][:], s[1:n + 1]) num_threads(4)
+ reduction (task, +: o[n:n*2], m[1], q[1:2][ : ], p[0], r[2:2]) \
+ reduction (task, *: t[2:2][ : ], s[1:n + 1]) num_threads(4)
{
int i;
#pragma omp for
for (i = 0; i < 4; i++)
{
#pragma omp task in_reduction (+: a, c) in_reduction (*: b[2 * n:3 * n], d) \
- in_reduction (+: o[n:n*2], q[1:2][:], p[0], m[1], r[2:2]) \
- in_reduction (+: g[n:n * 2], e[1], k[1:2][:], h[0], f[2:2]) \
- in_reduction (*: s[1:2], t[2:2][:])
+ in_reduction (+: o[n:n*2], q[1:2][ : ], p[0], m[1], r[2:2]) \
+ in_reduction (+: g[n:n * 2], e[1], k[1:2][ : ], h[0], f[2:2]) \
+ in_reduction (*: s[1:2], t[2:2][ : ])
{
int j;
a[0] += 2;
t[2][1] *= 2;
t[3][1] *= 2;
for (j = 0; j < 2; j++)
- #pragma omp task in_reduction (+: a, c[:2]) \
+ #pragma omp task in_reduction (+: a, c[ :2]) \
in_reduction (*: b[2 * n:3 * n], d[n - 1:n + 1]) \
- in_reduction (+: e[1], f[2:2], g[n:n*2], h[0], k[1:2][:2]) \
- in_reduction (+: m[1], r[2:2], o[n:n*2], p[0], q[1:2][:2]) \
- in_reduction (*: s[n:2], t[2:2][:])
+ in_reduction (+: e[1], f[2:2], g[n:n*2], h[0], k[1:2][ :2]) \
+ in_reduction (+: m[1], r[2:2], o[n:n*2], p[0], q[1:2][ :2]) \
+ in_reduction (*: s[n:2], t[2:2][ : ])
{
m[1] += 6;
r[2] += 7;
{
int i;
for (i = 0; i < 2; i++)
- #pragma omp task in_reduction (+: a, c[:2]) in_reduction (*: b[2 * n:3 * n], d[0:2]) \
- in_reduction (+: o[n:n*2], m[1], k[1:2][:], p[0], f[2:2]) \
- in_reduction (+: q[1:2][:], g[n:n*2], e[1], h[0], r[2:2]) \
- in_reduction (*: s[1:2], t[2:2][:])
+ #pragma omp task in_reduction (+: a, c[ :2]) in_reduction (*: b[2 * n:3 * n], d[0:2]) \
+ in_reduction (+: o[n:n*2], m[1], k[1:2][ : ], p[0], f[2:2]) \
+ in_reduction (+: q[1:2][ : ], g[n:n*2], e[1], h[0], r[2:2]) \
+ in_reduction (*: s[1:2], t[2:2][ : ])
{
a[0] += 7;
a[1] += 17;
int i;
#pragma omp for reduction (task, +: a, c) reduction (task, *: b[2 * n:3 * n], d) \
reduction (task, +: e[1], f[2:2], g[n:n*2], h[0], k[1:2][0:2]) \
- reduction (task, +: o[n:n*2], m[1], q[1:2][:], p[0], r[2:2]) \
- reduction (task, *: t[2:2][:], s[1:n + 1]) \
+ reduction (task, +: o[n:n*2], m[1], q[1:2][ : ], p[0], r[2:2]) \
+ reduction (task, *: t[2:2][ : ], s[1:n + 1]) \
schedule(nonmonotonic: runtime)
for (i = 0; i < 4; i++)
{
#pragma omp task in_reduction (+: a, c) in_reduction (*: b[2 * n:3 * n], d) \
- in_reduction (+: o[n:n*2], q[1:2][:], p[0], m[1], r[2:2]) \
- in_reduction (+: g[n:n * 2], e[1], k[1:2][:], h[0], f[2:2]) \
- in_reduction (*: s[1:2], t[2:2][:])
+ in_reduction (+: o[n:n*2], q[1:2][ : ], p[0], m[1], r[2:2]) \
+ in_reduction (+: g[n:n * 2], e[1], k[1:2][ : ], h[0], f[2:2]) \
+ in_reduction (*: s[1:2], t[2:2][ : ])
{
int j;
a[0] += 2;
t[2][1] *= 2;
t[3][1] *= 2;
for (j = 0; j < 2; j++)
- #pragma omp task in_reduction (+: a, c[:2]) \
+ #pragma omp task in_reduction (+: a, c[ :2]) \
in_reduction (*: b[2 * n:3 * n], d[n - 1:n + 1]) \
- in_reduction (+: e[1], f[2:2], g[n:n*2], h[0], k[1:2][:2]) \
- in_reduction (+: m[1], r[2:2], o[n:n*2], p[0], q[1:2][:2]) \
- in_reduction (*: s[n:2], t[2:2][:])
+ in_reduction (+: e[1], f[2:2], g[n:n*2], h[0], k[1:2][ :2]) \
+ in_reduction (+: m[1], r[2:2], o[n:n*2], p[0], q[1:2][ :2]) \
+ in_reduction (*: s[n:2], t[2:2][ : ])
{
m[1] += 6;
r[2] += 7;
foo (int n, int *c, long long int *d, int m[3], int *r, int o[4], int *p, int q[4][2])
{
int i;
- #pragma omp taskloop in_reduction (+: a, c[:2]) in_reduction (*: b[2 * n:3 * n], d[0:2]) \
- in_reduction (+: o[n:n*2], m[1], k[1:2][:], p[0], f[2:2]) \
- in_reduction (+: q[1:2][:], g[n:n*2], e[1], h[0], r[2:2]) \
- in_reduction (*: s[1:2], t[2:2][:]) nogroup
+ #pragma omp taskloop in_reduction (+: a, c[ :2]) in_reduction (*: b[2 * n:3 * n], d[0:2]) \
+ in_reduction (+: o[n:n*2], m[1], k[1:2][ : ], p[0], f[2:2]) \
+ in_reduction (+: q[1:2][ : ], g[n:n*2], e[1], h[0], r[2:2]) \
+ in_reduction (*: s[1:2], t[2:2][ : ]) nogroup
for (i = 0; i < 2; i++)
{
a[0] += 7;
int i;
#pragma omp taskloop reduction (+: a, c) reduction (default, *: b[2 * n:3 * n], d) \
reduction (+: e[1], f[2:2], g[n:n*2], h[0], k[1:2][0:2]) \
- reduction (default, +: o[n:n*2], m[1], q[1:2][:], p[0], r[2:2]) \
- reduction (*: t[2:2][:], s[1:n + 1])
+ reduction (default, +: o[n:n*2], m[1], q[1:2][ : ], p[0], r[2:2]) \
+ reduction (*: t[2:2][ : ], s[1:n + 1])
for (i = 0; i < 4; i++)
{
int j;
s[1] *= 2;
t[2][1] *= 2;
t[3][1] *= 2;
- #pragma omp taskloop in_reduction (+: a, c[:2]) \
+ #pragma omp taskloop in_reduction (+: a, c[ :2]) \
in_reduction (*: b[2 * n:3 * n], d[n - 1:n + 1]) \
- in_reduction (+: e[1], f[2:2], g[n:n*2], h[0], k[1:2][:2]) \
- in_reduction (+: m[1], r[2:2], o[n:n*2], p[0], q[1:2][:2]) \
- in_reduction (*: s[n:2], t[2:2][:]) nogroup
+ in_reduction (+: e[1], f[2:2], g[n:n*2], h[0], k[1:2][ :2]) \
+ in_reduction (+: m[1], r[2:2], o[n:n*2], p[0], q[1:2][ :2]) \
+ in_reduction (*: s[n:2], t[2:2][ : ]) nogroup
for (j = 0; j < 2; j++)
{
m[1] += 6;
- OMP_NUM_TEAMS(_DEV(_<dev-num>)) overrides it
OMP_NUM_TEAMS_ALL overrides it
- Number of teams is:
- -> the value specific by num_teams([lower:]upper)
+ -> the value specific by num_teams([lower: ]upper)
with lower := upper if unspecified
-> Otherwise, if nteams-var ICV > 0, #teams <= nteams-var ICV
-> Otherwise, if nteams-var ICV <= 0, #teams > 1
int n = 100, i;
struct dc v = { .a = 3, .b = (int *) malloc (sizeof (int) * n) };
-#pragma acc parallel loop copy(v.a, v.b[:n])
+#pragma acc parallel loop copy(v.a, v.b[ :n])
for (i = 0; i < n; i++)
v.b[i] = v.a;
for (int i = 0; i < 99; i++)
{
-#pragma acc enter data copyin(p.m.s2[:1])
-#pragma acc parallel loop copy(p.m.s2->e[:N])
+#pragma acc enter data copyin(p.m.s2[ :1])
+#pragma acc parallel loop copy(p.m.s2->e[ :N])
for (int j = 0; j < N; j++)
p.m.s2->e[j]++;
-#pragma acc exit data delete(p.m.s2[:1])
+#pragma acc exit data delete(p.m.s2[ :1])
}
for (i = 0; i < N; i++)
for (int i = 0; i < 99; i++)
{
-#pragma acc enter data copyin(p.m.s2[:1])
-#pragma acc enter data copyin(p.m.s2->f[:1])
-#pragma acc parallel loop copy(p.m.s2->f->a[:N]) copy(p.m.s2->f->c[:N])
+#pragma acc enter data copyin(p.m.s2[ :1])
+#pragma acc enter data copyin(p.m.s2->f[ :1])
+#pragma acc parallel loop copy(p.m.s2->f->a[ :N]) copy(p.m.s2->f->c[ :N])
for (int j = 0; j < N; j++)
{
p.m.s2->f->a[j]++;
p.m.s2->f->c[j]++;
}
-#pragma acc exit data delete(p.m.s2->f[:1])
-#pragma acc exit data delete(p.m.s2[:1])
+#pragma acc exit data delete(p.m.s2->f[ :1])
+#pragma acc exit data delete(p.m.s2[ :1])
}
for (i = 0; i < N; i++)
for (int i = 0; i < 99; i++)
{
-#pragma acc enter data copyin(p.m.s2[:1]) copyin(p.n.s2[:1])
-#pragma acc enter data copyin(p.m.s2->f[:1]) copyin(p.n.s2->f[:1])
-#pragma acc parallel loop copy(p.m.s2->f->a[:N]) copy(p.m.s2->f->c[:N]) \
- copy(p.n.s2->f->a[:N]) copy(p.n.s2->f->c[:N])
+#pragma acc enter data copyin(p.m.s2[ :1]) copyin(p.n.s2[ :1])
+#pragma acc enter data copyin(p.m.s2->f[ :1]) copyin(p.n.s2->f[ :1])
+#pragma acc parallel loop copy(p.m.s2->f->a[ :N]) copy(p.m.s2->f->c[ :N]) \
+ copy(p.n.s2->f->a[ :N]) copy(p.n.s2->f->c[ :N])
for (int j = 0; j < N; j++)
{
p.m.s2->f->a[j]++;
p.n.s2->f->a[j]++;
p.n.s2->f->c[j]++;
}
-#pragma acc exit data delete(p.m.s2->f[:1]) delete(p.n.s2->f[:1])
-#pragma acc exit data delete(p.m.s2[:1]) delete(p.n.s2[:1])
+#pragma acc exit data delete(p.m.s2->f[ :1]) delete(p.n.s2->f[ :1])
+#pragma acc exit data delete(p.m.s2[ :1]) delete(p.n.s2[ :1])
}
for (i = 0; i < N; i++)
for (int i = 0; i < 99; i++)
{
-#pragma acc enter data copyin(p.m.s2[:1]) copyin(p.n.s2[:1])
-#pragma acc enter data copyin(p.n.s2->e[:N]) copyin(p.n.s2->f[:1]) \
- copyin(p.m.s2->f[:1])
-#pragma acc parallel loop copy(p.m.s2->f->a[:N]) copy(p.n.s2->f->a[:N])
+#pragma acc enter data copyin(p.m.s2[ :1]) copyin(p.n.s2[ :1])
+#pragma acc enter data copyin(p.n.s2->e[ :N]) copyin(p.n.s2->f[ :1]) \
+ copyin(p.m.s2->f[ :1])
+#pragma acc parallel loop copy(p.m.s2->f->a[ :N]) copy(p.n.s2->f->a[ :N])
for (int j = 0; j < N; j++)
{
p.m.s2->f->a[j]++;
p.n.s2->f->a[j]++;
p.n.s2->e[j]++;
}
-#pragma acc exit data delete(p.m.s2->f[:1]) delete(p.n.s2->f[:1]) \
- copyout(p.n.s2->e[:N])
-#pragma acc exit data delete(p.m.s2[:1]) delete(p.n.s2[:1])
+#pragma acc exit data delete(p.m.s2->f[ :1]) delete(p.n.s2->f[ :1]) \
+ copyout(p.n.s2->e[ :N])
+#pragma acc exit data delete(p.m.s2[ :1]) delete(p.n.s2[ :1])
}
for (i = 0; i < N; i++)
for (int i = 0; i < 99; i++)
{
-#pragma acc enter data copyin(q->m.s2[:1])
-#pragma acc parallel loop copy(q->m.s2->e[:N])
+#pragma acc enter data copyin(q->m.s2[ :1])
+#pragma acc parallel loop copy(q->m.s2->e[ :N])
for (int j = 0; j < N; j++)
q->m.s2->e[j]++;
-#pragma acc exit data delete(q->m.s2[:1])
+#pragma acc exit data delete(q->m.s2[ :1])
}
for (i = 0; i < N; i++)
for (int i = 0; i < 99; i++)
{
-#pragma acc enter data copyin(q->m.s2[:1])
-#pragma acc enter data copyin(q->m.s2->f[:1])
-#pragma acc parallel loop copy(q->m.s2->f->a[:N]) copy(q->m.s2->f->c[:N])
+#pragma acc enter data copyin(q->m.s2[ :1])
+#pragma acc enter data copyin(q->m.s2->f[ :1])
+#pragma acc parallel loop copy(q->m.s2->f->a[ :N]) copy(q->m.s2->f->c[ :N])
for (int j = 0; j < N; j++)
{
q->m.s2->f->a[j]++;
q->m.s2->f->c[j]++;
}
-#pragma acc exit data delete(q->m.s2->f[:1])
-#pragma acc exit data delete(q->m.s2[:1])
+#pragma acc exit data delete(q->m.s2->f[ :1])
+#pragma acc exit data delete(q->m.s2[ :1])
}
for (i = 0; i < N; i++)
for (int i = 0; i < 99; i++)
{
-#pragma acc enter data copyin(q->m.s2[:1]) copyin(q->n.s2[:1])
-#pragma acc enter data copyin(q->m.s2->f[:1]) copyin(q->n.s2->f[:1])
-#pragma acc parallel loop copy(q->m.s2->f->a[:N]) copy(q->m.s2->f->c[:N]) \
- copy(q->n.s2->f->a[:N]) copy(q->n.s2->f->c[:N])
+#pragma acc enter data copyin(q->m.s2[ :1]) copyin(q->n.s2[ :1])
+#pragma acc enter data copyin(q->m.s2->f[ :1]) copyin(q->n.s2->f[ :1])
+#pragma acc parallel loop copy(q->m.s2->f->a[ :N]) copy(q->m.s2->f->c[ :N]) \
+ copy(q->n.s2->f->a[ :N]) copy(q->n.s2->f->c[ :N])
for (int j = 0; j < N; j++)
{
q->m.s2->f->a[j]++;
q->n.s2->f->a[j]++;
q->n.s2->f->c[j]++;
}
-#pragma acc exit data delete(q->m.s2->f[:1]) delete(q->n.s2->f[:1])
-#pragma acc exit data delete(q->m.s2[:1]) delete(q->n.s2[:1])
+#pragma acc exit data delete(q->m.s2->f[ :1]) delete(q->n.s2->f[ :1])
+#pragma acc exit data delete(q->m.s2[ :1]) delete(q->n.s2[ :1])
}
for (i = 0; i < N; i++)
for (int i = 0; i < 99; i++)
{
-#pragma acc enter data copyin(q->m.s2[:1]) copyin(q->n.s2[:1])
-#pragma acc enter data copyin(q->n.s2->e[:N]) copyin(q->m.s2->f[:1]) \
- copyin(q->n.s2->f[:1])
-#pragma acc parallel loop copy(q->m.s2->f->a[:N]) copy(q->n.s2->f->a[:N])
+#pragma acc enter data copyin(q->m.s2[ :1]) copyin(q->n.s2[ :1])
+#pragma acc enter data copyin(q->n.s2->e[ :N]) copyin(q->m.s2->f[ :1]) \
+ copyin(q->n.s2->f[ :1])
+#pragma acc parallel loop copy(q->m.s2->f->a[ :N]) copy(q->n.s2->f->a[ :N])
for (int j = 0; j < N; j++)
{
q->m.s2->f->a[j]++;
q->n.s2->f->a[j]++;
q->n.s2->e[j]++;
}
-#pragma acc exit data delete(q->m.s2->f[:1]) delete(q->n.s2->f[:1]) \
- copyout(q->n.s2->e[:N])
-#pragma acc exit data delete(q->m.s2[:1]) delete(q->n.s2[:1])
+#pragma acc exit data delete(q->m.s2->f[ :1]) delete(q->n.s2->f[ :1]) \
+ copyout(q->n.s2->e[ :N])
+#pragma acc exit data delete(q->m.s2[ :1]) delete(q->n.s2[ :1])
}
for (i = 0; i < N; i++)
for (i = 0; i < n; i++)
a[i] = i+1;
-#pragma acc enter data copyin(a[:n]) create(b)
+#pragma acc enter data copyin(a[ :n]) create(b)
b = a;
acc_attach ((void **)&b);
-#pragma acc parallel loop present (b[:n])
+#pragma acc parallel loop present (b[ :n])
for (i = 0; i < n; i++)
b[i] = i+1;
acc_detach ((void **)&b);
-#pragma acc exit data copyout(a[:n], b)
+#pragma acc exit data copyout(a[ :n], b)
for (i = 0; i < 10; i++)
assert (a[i] == b[i]);
{
int i = 0, sum = 0;
-#pragma acc parallel reduction(+:sum) present(head[:1])
+#pragma acc parallel reduction(+:sum) present(head[ :1])
{
for (; head != NULL; head = head->next)
sum += head->val;
n->next = head->next;
head->next = n;
-#pragma acc enter data copyin(n[:1])
+#pragma acc enter data copyin(n[ :1])
#pragma acc enter data attach(head->next)
if (n->next)
{
{
#pragma acc exit data detach(n->next)
}
-#pragma acc exit data delete (n[:1])
+#pragma acc exit data delete (n[ :1])
if (head->next)
{
#pragma acc enter data attach(head->next)
{
int i = 0, sum = 0;
-#pragma acc parallel reduction(+:sum) present(head[:1])
+#pragma acc parallel reduction(+:sum) present(head[ :1])
{
for (; head != NULL; head = head->next)
sum += head->val;
{
#pragma acc data copy(v)
{
-#pragma acc data copy(v.b[:n])
+#pragma acc data copy(v.b[ :n])
{
for (i = 0; i < n; i++)
{
for (i = 0; i < n; i++)
v.b[i] = v.a + i;
-#pragma acc exit data copyout(v.b[:n]) finalize
+#pragma acc exit data copyout(v.b[ :n]) finalize
#pragma acc exit data delete(v.a)
for (i = 0; i < n; i++)
for (k = 0; k < 16; k++)
{
-#pragma acc enter data copyin(v.a, v.b[:n], v.c[:n], v.d[:n])
+#pragma acc enter data copyin(v.a, v.b[ :n], v.c[ :n], v.d[ :n])
#pragma acc parallel loop
for (i = 0; i < n; i++)
v.b[i] = v.a + i;
-#pragma acc exit data copyout(v.b[:n])
-#pragma acc exit data copyout(v.c[:n])
-#pragma acc exit data copyout(v.d[:n])
+#pragma acc exit data copyout(v.b[ :n])
+#pragma acc exit data copyout(v.c[ :n])
+#pragma acc exit data copyout(v.d[ :n])
#pragma acc exit data copyout(v.a)
for (i = 0; i < n; i++)