(root)/
gcc-13.2.0/
libgomp/
testsuite/
libgomp.oacc-c-c++-common/
lib-16.c
       1  /* Test if acc_copyin has present_or_ and reference counting behavior.  */
       2  
       3  #include <stdlib.h>
       4  #include <openacc.h>
       5  
       6  int
       7  main (int argc, char **argv)
       8  {
       9    const int N = 256;
      10    int i;
      11    unsigned char *h;
      12  
      13    h = (unsigned char *) malloc (N);
      14  
      15    for (i = 0; i < N; i++)
      16      {
      17        h[i] = i;
      18      }
      19  
      20    (void) acc_copyin (h, N);
      21    (void) acc_copyin (h, N);
      22  
      23    acc_copyout (h, N);
      24  
      25    if (!acc_is_present (h, N))
      26      abort ();
      27  
      28    acc_copyout (h, N);
      29  
      30  #if !ACC_MEM_SHARED
      31    if (acc_is_present (h, N))
      32      abort ();
      33  #endif
      34  
      35    free (h);
      36  
      37    return 0;
      38  }