From: Nathan Sidwell Date: Wed, 4 Nov 2015 20:48:05 +0000 (+0000) Subject: nvptx.c (nvptx_goacc_validate_dims): Add checking. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ccc8282babb2336eab6457a0541a884348c7bafb;p=gcc.git nvptx.c (nvptx_goacc_validate_dims): Add checking. gcc/ * config/nvptx/nvptx.c (nvptx_goacc_validate_dims): Add checking. libgomp/ * testsuite/libgomp.oacc-fortran/reduction-1.f90: Fix dimensions and reduction copy. * testsuite/libgomp.oacc-fortran/reduction-2.f90: Likewise. * testsuite/libgomp.oacc-fortran/reduction-3.f90: Likewise. * testsuite/libgomp.oacc-fortran/reduction-4.f90: Likewise. * testsuite/libgomp.oacc-fortran/reduction-6.f90: Likewise. * testsuite/libgomp.oacc-c-c++-common/par-reduction-1.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/reduction-3.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/collapse-2.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/par-reduction-2.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/reduction-4.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/reduction-initial-1.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/reduction-1.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/reduction-5.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/reduction-2.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/parallel-dims.c: New. From-SVN: r229780 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index db1f93f8bfe..2a2eec2e38b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2015-11-04 Nathan Sidwell + + * config/nvptx/nvptx.c (nvptx_goacc_validate_dims): Add checking. + 2015-11-04 Nathan Sidwell Cesar Philippidis diff --git a/gcc/config/nvptx/nvptx.c b/gcc/config/nvptx/nvptx.c index 79ef4f703fe..dafb6954690 100644 --- a/gcc/config/nvptx/nvptx.c +++ b/gcc/config/nvptx/nvptx.c @@ -3472,8 +3472,29 @@ nvptx_goacc_validate_dims (tree ARG_UNUSED (decl), int *ARG_UNUSED (dims), { bool changed = false; - /* TODO: Leave dimensions unaltered. Reductions need - porting before filtering dimensions makes sense. */ + /* The vector size must be 32, unless this is a SEQ routine. */ + if (fn_level <= GOMP_DIM_VECTOR + && dims[GOMP_DIM_VECTOR] != PTX_VECTOR_LENGTH) + { + if (dims[GOMP_DIM_VECTOR] >= 0 && fn_level < 0) + warning_at (DECL_SOURCE_LOCATION (decl), 0, + dims[GOMP_DIM_VECTOR] + ? "using vector_length (%d), ignoring %d" + : "using vector_length (%d), ignoring runtime setting", + PTX_VECTOR_LENGTH, dims[GOMP_DIM_VECTOR]); + dims[GOMP_DIM_VECTOR] = PTX_VECTOR_LENGTH; + changed = true; + } + + /* Check the num workers is not too large. */ + if (dims[GOMP_DIM_WORKER] > PTX_WORKER_LENGTH) + { + warning_at (DECL_SOURCE_LOCATION (decl), 0, + "using num_workers (%d), ignoring %d", + PTX_WORKER_LENGTH, dims[GOMP_DIM_WORKER]); + dims[GOMP_DIM_WORKER] = PTX_WORKER_LENGTH; + changed = true; + } return changed; } diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index e0897e8f713..46680f183dc 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,22 @@ +2015-11-04 Nathan Sidwell + + * testsuite/libgomp.oacc-fortran/reduction-1.f90: Fix dimensions + and reduction copy. + * testsuite/libgomp.oacc-fortran/reduction-2.f90: Likewise. + * testsuite/libgomp.oacc-fortran/reduction-3.f90: Likewise. + * testsuite/libgomp.oacc-fortran/reduction-4.f90: Likewise. + * testsuite/libgomp.oacc-fortran/reduction-6.f90: Likewise. + * testsuite/libgomp.oacc-c-c++-common/par-reduction-1.c: Likewise. + * testsuite/libgomp.oacc-c-c++-common/reduction-3.c: Likewise. + * testsuite/libgomp.oacc-c-c++-common/collapse-2.c: Likewise. + * testsuite/libgomp.oacc-c-c++-common/par-reduction-2.c: Likewise. + * testsuite/libgomp.oacc-c-c++-common/reduction-4.c: Likewise. + * testsuite/libgomp.oacc-c-c++-common/reduction-initial-1.c: Likewise. + * testsuite/libgomp.oacc-c-c++-common/reduction-1.c: Likewise. + * testsuite/libgomp.oacc-c-c++-common/reduction-5.c: Likewise. + * testsuite/libgomp.oacc-c-c++-common/reduction-2.c: Likewise. + * testsuite/libgomp.oacc-c-c++-common/parallel-dims.c: New. + 2015-11-04 Nathan Sidwell * libgomp.oacc-c-c++-common/loop-red-g-1.c: New. diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/collapse-2.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/collapse-2.c index 44a77f7665d..8c56adac0cf 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/collapse-2.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/collapse-2.c @@ -8,7 +8,7 @@ main (void) int i, j, k, l = 0, f = 0, x = 0; int m1 = 4, m2 = -5, m3 = 17; - #pragma acc parallel +#pragma acc parallel copy(l) #pragma acc loop collapse(3) reduction(+:l) for (i = -2; i < m1; i++) for (j = m2; j < -2; j++) diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/par-reduction-1.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/par-reduction-1.c index dbe82fe67e1..dceac39cf15 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/par-reduction-1.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/par-reduction-1.c @@ -10,8 +10,7 @@ main (int argc, char *argv[]) #else # define GANGS 256 #endif - #pragma acc parallel num_gangs(GANGS) num_workers(1) vector_length(1) \ - copy(res2) + #pragma acc parallel num_gangs(GANGS) copy(res2) { #pragma acc atomic res2 += 5; @@ -28,8 +27,7 @@ main (int argc, char *argv[]) #else # define GANGS 8 #endif - #pragma acc parallel num_gangs(GANGS) num_workers(1) vector_length(1) \ - copy(res2) + #pragma acc parallel num_gangs(GANGS) copy(res2) { #pragma acc atomic res2 *= 5; diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/par-reduction-2.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/par-reduction-2.c index 12ab552284c..bd5715c675c 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/par-reduction-2.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/par-reduction-2.c @@ -11,8 +11,7 @@ main (int argc, char *argv[]) #else # define GANGS 256 #endif - #pragma acc parallel num_gangs(GANGS) num_workers(1) vector_length(1) \ - copy(res2) async(1) + #pragma acc parallel num_gangs(GANGS) copy(res2) async(1) { #pragma acc atomic res2 += 5; @@ -31,8 +30,7 @@ main (int argc, char *argv[]) #else # define GANGS 8 #endif - #pragma acc parallel num_gangs(GANGS) num_workers(1) vector_length(1) \ - copy(res2) async(1) + #pragma acc parallel num_gangs(GANGS) copy(res2) async(1) { #pragma acc atomic res2 *= 5; diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/parallel-dims.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/parallel-dims.c new file mode 100644 index 00000000000..39357ce357b --- /dev/null +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/parallel-dims.c @@ -0,0 +1,17 @@ +/* { dg-do run { target openacc_nvidia_accel_selected } } */ + +/* Worker and vector size checks. Picked an outrageously large + value. */ + +int main () +{ +#pragma acc parallel num_workers (2<<20) /* { dg-error "using num_workers" } */ + { + } + +#pragma acc parallel vector_length (2<<20) /* { dg-error "using vector_length" } */ + { + } + + return 0; +} diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-1.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-1.c index 4501f8e9f37..e55793136f3 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-1.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-1.c @@ -13,7 +13,7 @@ { \ type res, vres; \ res = (init); \ -DO_PRAGMA (acc parallel vector_length (vl))\ + DO_PRAGMA (acc parallel vector_length (vl) copy(res)) \ DO_PRAGMA (acc loop reduction (op:res))\ for (i = 0; i < n; i++) \ res = res op (b); \ @@ -63,7 +63,7 @@ test_reductions_bool (void) { \ type res, vres; \ res = (init); \ -DO_PRAGMA (acc parallel vector_length (vl))\ +DO_PRAGMA (acc parallel vector_length (vl) copy(res))\ DO_PRAGMA (acc loop reduction (op:res))\ for (i = 0; i < n; i++) \ res = op (res, (b)); \ diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-2.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-2.c index c2ec110abd2..e4454126b39 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-2.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-2.c @@ -23,7 +23,7 @@ main(void) vresult = 0; /* '+' reductions. */ -#pragma acc parallel vector_length (vl) +#pragma acc parallel vector_length (vl) copy(result) #pragma acc loop reduction (+:result) for (i = 0; i < n; i++) result += array[i]; @@ -39,7 +39,7 @@ main(void) vresult = 0; /* '*' reductions. */ -#pragma acc parallel vector_length (vl) +#pragma acc parallel vector_length (vl) copy(result) #pragma acc loop reduction (*:result) for (i = 0; i < n; i++) result *= array[i]; @@ -91,7 +91,7 @@ main(void) lvresult = false; /* '&&' reductions. */ -#pragma acc parallel vector_length (vl) +#pragma acc parallel vector_length (vl) copy(lresult) #pragma acc loop reduction (&&:lresult) for (i = 0; i < n; i++) lresult = lresult && (result > array[i]); @@ -110,7 +110,7 @@ main(void) lvresult = false; /* '||' reductions. */ -#pragma acc parallel vector_length (vl) +#pragma acc parallel vector_length (vl) copy(lresult) #pragma acc loop reduction (||:lresult) for (i = 0; i < n; i++) lresult = lresult || (result > array[i]); diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-3.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-3.c index 58b49ffa4be..e831dd603e1 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-3.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-3.c @@ -23,7 +23,7 @@ main(void) vresult = 0; /* '+' reductions. */ -#pragma acc parallel vector_length (vl) +#pragma acc parallel vector_length (vl) copy(result) #pragma acc loop reduction (+:result) for (i = 0; i < n; i++) result += array[i]; @@ -39,7 +39,7 @@ main(void) vresult = 0; /* '*' reductions. */ -#pragma acc parallel vector_length (vl) +#pragma acc parallel vector_length (vl) copy(result) #pragma acc loop reduction (*:result) for (i = 0; i < n; i++) result *= array[i]; @@ -91,7 +91,7 @@ main(void) lvresult = false; /* '&&' reductions. */ -#pragma acc parallel vector_length (vl) +#pragma acc parallel vector_length (vl) copy(lresult) #pragma acc loop reduction (&&:lresult) for (i = 0; i < n; i++) lresult = lresult && (result > array[i]); @@ -110,7 +110,7 @@ main(void) lvresult = false; /* '||' reductions. */ -#pragma acc parallel vector_length (vl) +#pragma acc parallel vector_length (vl) copy(lresult) #pragma acc loop reduction (||:lresult) for (i = 0; i < n; i++) lresult = lresult || (result > array[i]); diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-4.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-4.c index eab24281514..a89a96de736 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-4.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-4.c @@ -24,7 +24,7 @@ main(void) vresult = 0; /* '+' reductions. */ -#pragma acc parallel vector_length (vl) +#pragma acc parallel vector_length (vl) copy(result) #pragma acc loop reduction (+:result) for (i = 0; i < n; i++) result += array[i]; @@ -94,7 +94,7 @@ main(void) lvresult = false; /* '&&' reductions. */ -#pragma acc parallel vector_length (vl) +#pragma acc parallel vector_length (vl) copy(lresult) #pragma acc loop reduction (&&:lresult) for (i = 0; i < n; i++) lresult = lresult && (creal(result) > creal(array[i])); @@ -113,7 +113,7 @@ main(void) lvresult = false; /* '||' reductions. */ -#pragma acc parallel vector_length (vl) +#pragma acc parallel vector_length (vl) copy(lresult) #pragma acc loop reduction (||:lresult) for (i = 0; i < n; i++) lresult = lresult || (creal(result) > creal(array[i])); diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-5.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-5.c index 36469541972..efe87027bbf 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-5.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-5.c @@ -8,7 +8,7 @@ main (void) int n = 100; int i; -#pragma acc parallel vector_length (32) +#pragma acc parallel vector_length (32) copy(s1,s2) #pragma acc loop reduction (+:s1, s2) for (i = 0; i < n; i++) { diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-initial-1.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-initial-1.c index 81cf865e61b..9991db07013 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-initial-1.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-initial-1.c @@ -4,13 +4,13 @@ int main(void) { #define I 5 -#define N 11 +#define N 32 #define A 8 int a = A; int s = I; -#pragma acc parallel vector_length(N) +#pragma acc parallel vector_length(N) copy(s) { int i; #pragma acc loop reduction(+:s) diff --git a/libgomp/testsuite/libgomp.oacc-fortran/reduction-1.f90 b/libgomp/testsuite/libgomp.oacc-fortran/reduction-1.f90 index 89e7fe7fe58..db0a52d6a49 100644 --- a/libgomp/testsuite/libgomp.oacc-fortran/reduction-1.f90 +++ b/libgomp/testsuite/libgomp.oacc-fortran/reduction-1.f90 @@ -5,7 +5,7 @@ program reduction_1 implicit none - integer, parameter :: n = 10, vl = 2 + integer, parameter :: n = 10, vl = 32 integer :: i, vresult, result logical :: lresult, lvresult integer, dimension (n) :: array @@ -19,7 +19,7 @@ program reduction_1 ! '+' reductions - !$acc parallel vector_length(vl) num_gangs(1) + !$acc parallel vector_length(vl) num_gangs(1) copy(result) !$acc loop reduction(+:result) do i = 1, n result = result + array(i) @@ -38,7 +38,7 @@ program reduction_1 ! '*' reductions - !$acc parallel vector_length(vl) num_gangs(1) + !$acc parallel vector_length(vl) num_gangs(1) copy(result) !$acc loop reduction(*:result) do i = 1, n result = result * array(i) @@ -57,7 +57,7 @@ program reduction_1 ! 'max' reductions - !$acc parallel vector_length(vl) num_gangs(1) + !$acc parallel vector_length(vl) num_gangs(1) copy(result) !$acc loop reduction(max:result) do i = 1, n result = max (result, array(i)) @@ -76,7 +76,7 @@ program reduction_1 ! 'min' reductions - !$acc parallel vector_length(vl) num_gangs(1) + !$acc parallel vector_length(vl) num_gangs(1) copy(result) !$acc loop reduction(min:result) do i = 1, n result = min (result, array(i)) @@ -95,7 +95,7 @@ program reduction_1 ! 'iand' reductions - !$acc parallel vector_length(vl) num_gangs(1) + !$acc parallel vector_length(vl) num_gangs(1) copy(result) !$acc loop reduction(iand:result) do i = 1, n result = iand (result, array(i)) @@ -114,7 +114,7 @@ program reduction_1 ! 'ior' reductions - !$acc parallel vector_length(vl) num_gangs(1) + !$acc parallel vector_length(vl) num_gangs(1) copy(result) !$acc loop reduction(ior:result) do i = 1, n result = ior (result, array(i)) @@ -133,7 +133,7 @@ program reduction_1 ! 'ieor' reductions - !$acc parallel vector_length(vl) num_gangs(1) + !$acc parallel vector_length(vl) num_gangs(1) copy(result) !$acc loop reduction(ieor:result) do i = 1, n result = ieor (result, array(i)) @@ -152,7 +152,7 @@ program reduction_1 ! '.and.' reductions - !$acc parallel vector_length(vl) num_gangs(1) + !$acc parallel vector_length(vl) num_gangs(1) copy(lresult) !$acc loop reduction(.and.:lresult) do i = 1, n lresult = lresult .and. (array(i) .ge. 5) @@ -171,7 +171,7 @@ program reduction_1 ! '.or.' reductions - !$acc parallel vector_length(vl) num_gangs(1) + !$acc parallel vector_length(vl) num_gangs(1) copy(lresult) !$acc loop reduction(.or.:lresult) do i = 1, n lresult = lresult .or. (array(i) .ge. 5) @@ -190,7 +190,7 @@ program reduction_1 ! '.eqv.' reductions - !$acc parallel vector_length(vl) num_gangs(1) + !$acc parallel vector_length(vl) num_gangs(1) copy(lresult) !$acc loop reduction(.eqv.:lresult) do i = 1, n lresult = lresult .eqv. (array(i) .ge. 5) @@ -209,7 +209,7 @@ program reduction_1 ! '.neqv.' reductions - !$acc parallel vector_length(vl) num_gangs(1) + !$acc parallel vector_length(vl) num_gangs(1) copy(lresult) !$acc loop reduction(.neqv.:lresult) do i = 1, n lresult = lresult .neqv. (array(i) .ge. 5) diff --git a/libgomp/testsuite/libgomp.oacc-fortran/reduction-2.f90 b/libgomp/testsuite/libgomp.oacc-fortran/reduction-2.f90 index d3659c9fc3e..3d99668581f 100644 --- a/libgomp/testsuite/libgomp.oacc-fortran/reduction-2.f90 +++ b/libgomp/testsuite/libgomp.oacc-fortran/reduction-2.f90 @@ -5,7 +5,7 @@ program reduction_2 implicit none - integer, parameter :: n = 10, vl = 2 + integer, parameter :: n = 10, vl = 32 integer :: i real, parameter :: e = .001 real :: vresult, result @@ -21,7 +21,7 @@ program reduction_2 ! '+' reductions - !$acc parallel vector_length(vl) num_gangs(1) + !$acc parallel vector_length(vl) num_gangs(1) copy(result) !$acc loop reduction(+:result) do i = 1, n result = result + array(i) @@ -40,7 +40,7 @@ program reduction_2 ! '*' reductions - !$acc parallel vector_length(vl) num_gangs(1) + !$acc parallel vector_length(vl) num_gangs(1) copy(result) !$acc loop reduction(*:result) do i = 1, n result = result * array(i) @@ -59,7 +59,7 @@ program reduction_2 ! 'max' reductions - !$acc parallel vector_length(vl) num_gangs(1) + !$acc parallel vector_length(vl) num_gangs(1) copy(result) !$acc loop reduction(max:result) do i = 1, n result = max (result, array(i)) @@ -78,7 +78,7 @@ program reduction_2 ! 'min' reductions - !$acc parallel vector_length(vl) num_gangs(1) + !$acc parallel vector_length(vl) num_gangs(1) copy(result) !$acc loop reduction(min:result) do i = 1, n result = min (result, array(i)) @@ -97,7 +97,7 @@ program reduction_2 ! '.and.' reductions - !$acc parallel vector_length(vl) num_gangs(1) + !$acc parallel vector_length(vl) num_gangs(1) copy(lresult) !$acc loop reduction(.and.:lresult) do i = 1, n lresult = lresult .and. (array(i) .ge. 5) @@ -116,7 +116,7 @@ program reduction_2 ! '.or.' reductions - !$acc parallel vector_length(vl) num_gangs(1) + !$acc parallel vector_length(vl) num_gangs(1) copy(lresult) !$acc loop reduction(.or.:lresult) do i = 1, n lresult = lresult .or. (array(i) .ge. 5) @@ -135,7 +135,7 @@ program reduction_2 ! '.eqv.' reductions - !$acc parallel vector_length(vl) num_gangs(1) + !$acc parallel vector_length(vl) num_gangs(1) copy(lresult) !$acc loop reduction(.eqv.:lresult) do i = 1, n lresult = lresult .eqv. (array(i) .ge. 5) @@ -154,7 +154,7 @@ program reduction_2 ! '.neqv.' reductions - !$acc parallel vector_length(vl) num_gangs(1) + !$acc parallel vector_length(vl) num_gangs(1) copy(lresult) !$acc loop reduction(.neqv.:lresult) do i = 1, n lresult = lresult .neqv. (array(i) .ge. 5) diff --git a/libgomp/testsuite/libgomp.oacc-fortran/reduction-3.f90 b/libgomp/testsuite/libgomp.oacc-fortran/reduction-3.f90 index 2b8005dac15..d0b590e6496 100644 --- a/libgomp/testsuite/libgomp.oacc-fortran/reduction-3.f90 +++ b/libgomp/testsuite/libgomp.oacc-fortran/reduction-3.f90 @@ -5,7 +5,7 @@ program reduction_3 implicit none - integer, parameter :: n = 10, vl = 2 + integer, parameter :: n = 10, vl = 32 integer :: i double precision, parameter :: e = .001 double precision :: vresult, result @@ -21,7 +21,7 @@ program reduction_3 ! '+' reductions - !$acc parallel vector_length(vl) num_gangs(1) + !$acc parallel vector_length(vl) num_gangs(1) copy(result) !$acc loop reduction(+:result) do i = 1, n result = result + array(i) @@ -40,7 +40,7 @@ program reduction_3 ! '*' reductions - !$acc parallel vector_length(vl) num_gangs(1) + !$acc parallel vector_length(vl) num_gangs(1) copy(result) !$acc loop reduction(*:result) do i = 1, n result = result * array(i) @@ -59,7 +59,7 @@ program reduction_3 ! 'max' reductions - !$acc parallel vector_length(vl) num_gangs(1) + !$acc parallel vector_length(vl) num_gangs(1) copy(result) !$acc loop reduction(max:result) do i = 1, n result = max (result, array(i)) @@ -78,7 +78,7 @@ program reduction_3 ! 'min' reductions - !$acc parallel vector_length(vl) num_gangs(1) + !$acc parallel vector_length(vl) num_gangs(1) copy(result) !$acc loop reduction(min:result) do i = 1, n result = min (result, array(i)) @@ -97,7 +97,7 @@ program reduction_3 ! '.and.' reductions - !$acc parallel vector_length(vl) num_gangs(1) + !$acc parallel vector_length(vl) num_gangs(1) copy(lresult) !$acc loop reduction(.and.:lresult) do i = 1, n lresult = lresult .and. (array(i) .ge. 5) @@ -116,7 +116,7 @@ program reduction_3 ! '.or.' reductions - !$acc parallel vector_length(vl) num_gangs(1) + !$acc parallel vector_length(vl) num_gangs(1) copy(lresult) !$acc loop reduction(.or.:lresult) do i = 1, n lresult = lresult .or. (array(i) .ge. 5) @@ -135,7 +135,7 @@ program reduction_3 ! '.eqv.' reductions - !$acc parallel vector_length(vl) num_gangs(1) + !$acc parallel vector_length(vl) num_gangs(1) copy(lresult) !$acc loop reduction(.eqv.:lresult) do i = 1, n lresult = lresult .eqv. (array(i) .ge. 5) @@ -154,7 +154,7 @@ program reduction_3 ! '.neqv.' reductions - !$acc parallel vector_length(vl) num_gangs(1) + !$acc parallel vector_length(vl) num_gangs(1) copy(lresult) !$acc loop reduction(.neqv.:lresult) do i = 1, n lresult = lresult .neqv. (array(i) .ge. 5) diff --git a/libgomp/testsuite/libgomp.oacc-fortran/reduction-4.f90 b/libgomp/testsuite/libgomp.oacc-fortran/reduction-4.f90 index 12f7a33053c..8c99fdb32bf 100644 --- a/libgomp/testsuite/libgomp.oacc-fortran/reduction-4.f90 +++ b/libgomp/testsuite/libgomp.oacc-fortran/reduction-4.f90 @@ -19,7 +19,7 @@ program reduction_4 ! '+' reductions - !$acc parallel vector_length(vl) num_gangs(1) + !$acc parallel vector_length(vl) num_gangs(1) copy(result) !$acc loop reduction(+:result) do i = 1, n result = result + array(i) diff --git a/libgomp/testsuite/libgomp.oacc-fortran/reduction-6.f90 b/libgomp/testsuite/libgomp.oacc-fortran/reduction-6.f90 index a1c43efa97c..2ff6f5fd17d 100644 --- a/libgomp/testsuite/libgomp.oacc-fortran/reduction-6.f90 +++ b/libgomp/testsuite/libgomp.oacc-fortran/reduction-6.f90 @@ -11,7 +11,7 @@ program reduction vs1 = 0 vs2 = 0 - !$acc parallel vector_length (32) + !$acc parallel vector_length (32) copy(s1, s2) !$acc loop reduction(+:s1, s2) do i = 1, n s1 = s1 + 1