ccc8282bab
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
33 lines
449 B
C
33 lines
449 B
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
int
|
|
main (void)
|
|
{
|
|
int s1 = 2, s2 = 5, v1 = 2, v2 = 5;
|
|
int n = 100;
|
|
int i;
|
|
|
|
#pragma acc parallel vector_length (32) copy(s1,s2)
|
|
#pragma acc loop reduction (+:s1, s2)
|
|
for (i = 0; i < n; i++)
|
|
{
|
|
s1 = s1 + 3;
|
|
s2 = s2 + 2;
|
|
}
|
|
|
|
for (i = 0; i < n; i++)
|
|
{
|
|
v1 = v1 + 3;
|
|
v2 = v2 + 2;
|
|
}
|
|
|
|
if (s1 != v1)
|
|
abort ();
|
|
|
|
if (s2 != v2)
|
|
abort ();
|
|
|
|
return 0;
|
|
}
|