1 ! Check offloaded function's attributes and classification for unparallelized
4 ! { dg-additional-options "-O2" }
5 ! { dg-additional-options "-fdump-tree-ompexp" }
6 ! { dg-additional-options "-fdump-tree-parloops1-all" }
7 ! { dg-additional-options "-fdump-tree-oaccdevlow" }
11 integer, parameter :: n = 1024
12 integer, dimension (0:n-1) :: a, b, c
15 ! An "external" mapping of loop iterations/array indices makes the loop
17 integer, external :: f
21 !$acc kernels copyin (a(0:n-1), b(0:n-1)) copyout (c(0:n-1))
23 c(i) = a(f (i)) + b(f (i))
28 ! Check the offloaded function's attributes.
29 ! { dg-final { scan-tree-dump-times "(?n)__attribute__\\(\\(oacc kernels, omp target entrypoint\\)\\)" 1 "ompexp" } }
31 ! Check that exactly one OpenACC kernels construct is analyzed, and that it
32 ! can't be parallelized.
33 ! { dg-final { scan-tree-dump-times "FAILED:" 1 "parloops1" } }
34 ! { dg-final { scan-tree-dump-times "(?n)__attribute__\\(\\(oacc function \\(, , \\), oacc kernels, omp target entrypoint\\)\\)" 1 "parloops1" } }
35 ! { dg-final { scan-tree-dump-not "SUCCESS: may be parallelized" "parloops1" } }
37 ! Check the offloaded function's classification and compute dimensions (will
38 ! always be 1 x 1 x 1 for non-offloading compilation).
39 ! { dg-final { scan-tree-dump-times "(?n)Function is unparallelized OpenACC kernels offload" 1 "oaccdevlow" } }
40 ! { dg-final { scan-tree-dump-times "(?n)Compute dimensions \\\[1, 1, 1\\\]" 1 "oaccdevlow" } }
41 ! { dg-final { scan-tree-dump-times "(?n)__attribute__\\(\\(oacc function \\(1, 1, 1\\), oacc kernels, omp target entrypoint\\)\\)" 1 "oaccdevlow" } }