| 1 |
/* { dg-do run } */ |
| 2 |
|
| 3 |
#include <stdlib.h> |
| 4 |
|
| 5 |
#define n 10 |
| 6 |
|
| 7 |
static void __attribute__((noinline)) __attribute__((noclone)) |
| 8 |
foo (int beta, int *c) |
| 9 |
{ |
| 10 |
#pragma acc parallel copy(c[0:(n * n) - 1]) num_gangs(2) |
| 11 |
#pragma acc loop gang |
| 12 |
for (int j = 0; j < n; ++j) |
| 13 |
if (beta != 1) |
| 14 |
{ |
| 15 |
#pragma acc loop vector |
| 16 |
for (int i = 0; i < n; ++i) |
| 17 |
c[i + (j * n)] = 0; |
| 18 |
} |
| 19 |
} |
| 20 |
|
| 21 |
int |
| 22 |
main (void) |
| 23 |
{ |
| 24 |
int c[n * n]; |
| 25 |
|
| 26 |
c[0] = 1; |
| 27 |
foo (0, c); |
| 28 |
if (c[0] != 0) |
| 29 |
abort (); |
| 30 |
|
| 31 |
return 0; |
| 32 |
} |