| 1 |
/* { dg-do run { target openacc_nvidia_accel_selected } } */ |
| 2 |
|
| 3 |
#include <openacc.h> |
| 4 |
#include <stdlib.h> |
| 5 |
|
| 6 |
#define N 1024 |
| 7 |
|
| 8 |
int main (int argc, char* argv[]) |
| 9 |
{ |
| 10 |
int x[N], y[N], *yp; |
| 11 |
|
| 12 |
yp = y + 1; |
| 13 |
|
| 14 |
#pragma acc data copyin (x[0:N]) |
| 15 |
{ |
| 16 |
int *xp, *yp2; |
| 17 |
#pragma acc host_data use_device (x) |
| 18 |
{ |
| 19 |
#pragma acc data copyin (y) |
| 20 |
{ |
| 21 |
#pragma acc host_data use_device (yp) |
| 22 |
{ |
| 23 |
xp = x; |
| 24 |
yp2 = yp; |
| 25 |
} |
| 26 |
|
| 27 |
if (yp2 != acc_deviceptr (yp)) |
| 28 |
abort (); |
| 29 |
} |
| 30 |
} |
| 31 |
|
| 32 |
if (xp != acc_deviceptr (x)) |
| 33 |
abort (); |
| 34 |
|
| 35 |
} |
| 36 |
|
| 37 |
return 0; |
| 38 |
} |