Retro68/gcc/libgomp/testsuite/libgomp.oacc-c-c++-common/host_data-5.c

39 lines
535 B
C
Raw Normal View History

2017-04-10 11:32:00 +00:00
/* { dg-do run { target openacc_nvidia_accel_selected } } */
#include <openacc.h>
#include <stdlib.h>
#define N 1024
int main (int argc, char* argv[])
{
int x[N], y[N], *yp;
yp = y + 1;
#pragma acc data copyin (x[0:N])
{
int *xp, *yp2;
#pragma acc host_data use_device (x)
{
#pragma acc data copyin (y)
{
#pragma acc host_data use_device (yp)
{
xp = x;
yp2 = yp;
}
if (yp2 != acc_deviceptr (yp))
abort ();
}
}
if (xp != acc_deviceptr (x))
abort ();
}
return 0;
}