Set num_threads to 50 on 32-bit hppa in two libgomp loop tests
[official-gcc.git] / libgomp / testsuite / libgomp.oacc-c-c++-common / parallel-reduction.c
blobf88babce5d6d48a487b601235bf8df56988c6835
1 /* { dg-additional-options "-fopt-info-note-omp" }
2 { dg-additional-options "--param=openacc-privatization=noisy" }
3 { dg-additional-options "-foffload=-fopt-info-note-omp" }
4 { dg-additional-options "-foffload=--param=openacc-privatization=noisy" }
5 for testing/documenting aspects of that functionality. */
7 /* { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
8 aspects of that functionality. */
10 #include <stdlib.h>
11 #include <openacc.h>
13 #define N 10
15 int
16 main ()
18 int s1 = 0, s2 = 0;
19 int i;
20 int dummy = 0;
22 #pragma acc data copy (dummy)
24 #pragma acc parallel num_gangs (N) reduction (+:s1) copy(s1)
25 /* { dg-bogus "warning: region is gang partitioned but does not contain gang partitioned code" "TODO 'reduction'" { xfail *-*-* } .-1 } */
27 s1++;
31 if (acc_get_device_type () == acc_device_host)
33 if (s1 != 1)
34 abort ();
36 else
38 if (s1 != N)
39 abort ();
42 s1 = 0;
43 s2 = 0;
45 #pragma acc parallel num_gangs (10) reduction (+:s1, s2) copy(s1, s2)
46 /* { dg-bogus "warning: region is gang partitioned but does not contain gang partitioned code" "TODO 'reduction'" { xfail *-*-* } .-1 } */
48 s1++;
49 s2 += N;
52 if (acc_get_device_type () == acc_device_host)
54 if (s1 != 1)
55 abort ();
56 if (s2 != N)
57 abort ();
59 else
61 if (s1 != N)
62 abort ();
63 if (s2 != N*N)
64 abort ();
67 s1 = 0;
69 #pragma acc parallel num_gangs (10) reduction (+:s1) copy(s1)
71 #pragma acc loop gang reduction (+:s1)
72 /* { dg-note {variable 'i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } .-1 } */
73 for (i = 0; i < 10; i++)
74 s1++;
77 if (s1 != N)
78 abort ();
80 return 0;