(root)/
gcc-13.2.0/
libgomp/
testsuite/
libgomp.oacc-c-c++-common/
vector-length-128-3.c
       1  /* { dg-do run { target openacc_nvidia_accel_selected } } */
       2  /* { dg-additional-options "-foffload=-fdump-tree-oaccloops" } */
       3  /* We default to warp size 32 for the vector length, so the GOMP_OPENACC_DIM has
       4     no effect.  */
       5  /* { dg-set-target-env-var "GOMP_OPENACC_DIM" "::128" } */
       6  /* { dg-set-target-env-var "GOMP_DEBUG" "1" } */
       7  
       8  
       9  #include <stdlib.h>
      10  
      11  #define N 1024
      12  
      13  unsigned int a[N];
      14  unsigned int b[N];
      15  unsigned int c[N];
      16  unsigned int n = N;
      17  
      18  int
      19  main (void)
      20  {
      21    for (unsigned int i = 0; i < n; ++i)
      22      {
      23        a[i] = i % 3;
      24        b[i] = i % 5;
      25      }
      26  
      27  #pragma acc parallel copyin (a,b) copyout (c)
      28    {
      29  #pragma acc loop vector
      30      for (unsigned int i = 0; i < n; i++)
      31        c[i] = a[i] + b[i];
      32    }
      33  
      34    for (unsigned int i = 0; i < n; ++i)
      35      if (c[i] != (i % 3) + (i % 5))
      36        abort ();
      37  
      38    return 0;
      39  }
      40  
      41  /* { dg-final { scan-offload-tree-dump "__attribute__\\(\\(oacc function \\(1, 1, 32\\)" "oaccloops" } } */
      42  /* { dg-output "nvptx_exec: kernel main\\\$_omp_fn\\\$0: launch gangs=1, workers=1, vectors=32" } */