Debian Codegraph @

gcc/testsuite/gfortran.dg/goacc/classify-kernels-unparallelized.f95

raw
1 ! Check offloaded function's attributes and classification for unparallelized
2 ! OpenACC kernels.
3
4 ! { dg-additional-options "--param openacc-kernels=decompose" }
5
6 ! { dg-additional-options "-O2" }
7 ! { dg-additional-options "-fopt-info-all-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 program main
16 implicit none
17 integer, parameter :: n = 1024
18 integer, dimension (0:n-1) :: a, b, c
19 integer :: i
20
21 ! An "external" mapping of loop iterations/array indices makes the loop
22 ! unparallelizable.
23 integer, external :: f
24
25 call setup(a, b)
26
27 !$acc kernels copyin (a(0:n-1), b(0:n-1)) copyout (c(0:n-1)) ! { dg-line l_compute1 }
28 ! { dg-optimized {assigned OpenACC seq loop parallelism} {} { target *-*-* } l_compute1 }
29 ! { dg-note {beginning 'parloops' part in OpenACC 'kernels' region} {} { target *-*-* } .+1 }
30 do i = 0, n - 1
31 c(i) = a(f (i)) + b(f (i))
32 end do
33 !$acc end kernels
34 end program main
35
36 ! Check the offloaded function's attributes.
37 ! { dg-final { scan-tree-dump-times "(?n)__attribute__\\(\\(oacc kernels, omp target entrypoint, noclone\\)\\)" 1 "ompexp" } }
38
39 ! Check that exactly one OpenACC kernels construct is analyzed, and that it
40 ! can't be parallelized.
41 ! { dg-final { scan-tree-dump-times "FAILED:" 1 "parloops1" } }
42 ! { dg-final { scan-tree-dump-times "(?n)__attribute__\\(\\(oacc function \\(, , \\), oacc kernels, omp target entrypoint, noclone\\)\\)" 1 "parloops1" } }
43 ! { dg-final { scan-tree-dump-not "SUCCESS: may be parallelized" "parloops1" } }
44
45 ! Check the offloaded function's classification and compute dimensions (will
46 ! always be 1 x 1 x 1 for non-offloading compilation).
47 ! { dg-final { scan-tree-dump-times "(?n)Function is unparallelized OpenACC kernels offload" 1 "oaccloops" } }
48 ! { dg-final { scan-tree-dump-times "(?n)Compute dimensions \\\[1, 1, 1\\\]" 1 "oaccloops" } }
49 ! { dg-final { scan-tree-dump-times "(?n)__attribute__\\(\\(oacc function \\(1, 1, 1\\), oacc kernels, omp target entrypoint, noclone\\)\\)" 1 "oaccloops" } }