Debian Codegraph @

gcc/testsuite/c-c++-common/goacc/classify-kernels-parloops.c

raw
1 /* Check offloaded function's attributes and classification for OpenACC
2 kernels. */
3
4 /* { dg-additional-options "--param openacc-kernels=parloops" } */
5
6 /* { dg-additional-options "-O2" }
7 { dg-additional-options "-fopt-info-optimized-omp" }
8 { dg-additional-options "-fdump-tree-ompexp" }
9 { dg-additional-options "-fdump-tree-parloops1-all" }
10 { dg-additional-options "-fdump-tree-oaccloops" } */
11
12 /* { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
13 aspects of that functionality. */
14
15 #define N 1024
16
17 extern unsigned int *__restrict a;
18 extern unsigned int *__restrict b;
19 extern unsigned int *__restrict c;
20
21 void KERNELS ()
22 {
23 #pragma acc kernels copyin (a[0:N], b[0:N]) copyout (c[0:N]) /* { dg-line l_compute1 } */
24 /* { dg-optimized {assigned OpenACC gang loop parallelism} {} { target *-*-* } l_compute1 } */
25 for (unsigned int i = 0; i < N; i++)
26 c[i] = a[i] + b[i];
27 }
28
29 /* Check the offloaded function's attributes.
30 { dg-final { scan-tree-dump-times "(?n)__attribute__\\(\\(oacc kernels, omp target entrypoint, noclone\\)\\)" 1 "ompexp" } } */
31
32 /* Check that exactly one OpenACC kernels construct is analyzed, and that it
33 can be parallelized.
34 { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 1 "parloops1" } }
35 { dg-final { scan-tree-dump-times "(?n)__attribute__\\(\\(oacc kernels parallelized, oacc function \\(, , \\), oacc kernels, omp target entrypoint, noclone\\)\\)" 1 "parloops1" } }
36 { dg-final { scan-tree-dump-not "FAILED:" "parloops1" } } */
37
38 /* Check the offloaded function's classification and compute dimensions (will
39 always be 1 x 1 x 1 for non-offloading compilation).
40 { dg-final { scan-tree-dump-times "(?n)Function is parallelized OpenACC kernels offload" 1 "oaccloops" } }
41 { dg-final { scan-tree-dump-times "(?n)Compute dimensions \\\[1, 1, 1\\\]" 1 "oaccloops" } }
42 { dg-final { scan-tree-dump-times "(?n)__attribute__\\(\\(oacc function \\(1, 1, 1\\), oacc kernels parallelized, oacc function \\(, , \\), oacc kernels, omp target entrypoint, noclone\\)\\)" 1 "oaccloops" } } */