sched1: debug/model: dump predecessor list and BB num [NFC]
[gcc.git] / libgomp / testsuite / libgomp.oacc-c-c++-common / broadcast-1.c
blobca0d37bf88a55c3a0d23c3502715f92b77dd36e5
1 /* Ensure that worker-vector state conditional expressions are
2 properly handled by the nvptx backend. */
4 #include <assert.h>
5 #include <math.h>
8 #define N 1024
10 int A[N][N] ;
12 void test(int x)
14 #pragma acc parallel num_gangs(16) num_workers(4) vector_length(32) copyout(A)
16 #pragma acc loop gang
17 for(int j=0;j<N;j++)
19 if (x==1)
21 #pragma acc loop worker vector
22 for(int i=0;i<N;i++)
23 A[i][j] = 1;
25 else
27 #pragma acc loop worker vector
28 for(int i=0;i<N;i++)
29 A[i][j] = -1;
36 int main(void)
38 test (0);
39 for (int i = 0; i < N; i++)
40 for (int j = 0; j < N; j++)
41 assert (A[i][j] == -1);
43 test (1);
44 for (int i = 0; i < N; i++)
45 for (int j = 0; j < N; j++)
46 assert (A[i][j] == 1);
48 return 0;