view libgomp/testsuite/libgomp.oacc-c-c++-common/host_data-4.c @ 143:76e1cf5455ef

add cbc_gc test
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 23 Dec 2018 19:24:05 +0900
parents 04ced10e8804
children
line wrap: on
line source

/* { 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], *xp2;

#pragma acc data copyin (x[0:N])
  {
    int *xp;
#pragma acc host_data use_device (x)
    {
#pragma acc data
      {
        xp = x;
      }
      xp2 = x;
    }

    if (xp != acc_deviceptr (x) || xp2 != xp)
      abort ();
  }

  return 0;
}