(root)/
gcc-13.2.0/
libgomp/
testsuite/
libgomp.oacc-c-c++-common/
lib-86.c
       1  /* { dg-do run } */
       2  
       3  #include <stdlib.h>
       4  #include <unistd.h>
       5  #include <openacc.h>
       6  
       7  int
       8  main (int argc, char **argv)
       9  {
      10    if (acc_get_current_cuda_device () != 0)
      11      abort ();
      12  
      13    acc_init (acc_device_host);
      14  
      15    if (acc_get_current_cuda_device () != 0)
      16      abort ();
      17  
      18    acc_shutdown (acc_device_host);
      19  
      20    if (acc_get_current_cuda_device () != 0)
      21      abort ();
      22  
      23    if (acc_get_num_devices (acc_device_nvidia))
      24      {
      25        acc_init (acc_device_nvidia);
      26  
      27        if (acc_get_current_cuda_device () == 0)
      28  	abort ();
      29  
      30        acc_shutdown (acc_device_nvidia);
      31      }
      32  
      33    if (acc_get_num_devices (acc_device_radeon))
      34      {
      35        acc_init (acc_device_radeon);
      36  
      37        if (acc_get_current_cuda_device () != 0)
      38  	abort ();
      39  
      40        acc_shutdown (acc_device_radeon);
      41      }
      42  
      43    if (acc_get_current_cuda_device () != 0)
      44      abort ();
      45  
      46    return 0;
      47  }
      48  
      49  /* { dg-output "" } */