Debian Codegraph @

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

raw
1 ! Check offloaded function's attributes and classification for OpenACC
2 ! 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 call setup(a, b)
22
23 !$acc kernels copyin (a(0:n-1), b(0:n-1)) copyout (c(0:n-1)) ! { dg-line l_compute1 }
24 ! { dg-note {OpenACC 'kernels' decomposition: variable 'i' in 'copy' clause requested to be made addressable} {} { target *-*-* } l_compute1 } */
25 ! { dg-note {variable 'i' made addressable} {} { target *-*-* } l_compute1 } */
26 ! { dg-optimized {assigned OpenACC gang loop parallelism} {} { target *-*-* } l_compute1 }
27 ! { dg-note {beginning 'parloops' part in OpenACC 'kernels' region} {} { target *-*-* } .+1 }
28 do i = 0, n - 1
29 c(i) = a(i) + b(i)
30 end do
31 !$acc end kernels
32 end program main
33
34 ! Check the offloaded function's attributes.
35 ! { dg-final { scan-tree-dump-times "(?n)__attribute__\\(\\(oacc kernels, omp target entrypoint, noclone\\)\\)" 1 "ompexp" } }
36
37 ! Check that exactly one OpenACC kernels construct is analyzed, and that it
38 ! can be parallelized.
39 ! { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 1 "parloops1" } }
40 ! { dg-final { scan-tree-dump-times "(?n)__attribute__\\(\\(oacc kernels parallelized, oacc function \\(, , \\), oacc kernels, omp target entrypoint, noclone\\)\\)" 1 "parloops1" } }
41 ! { dg-final { scan-tree-dump-not "FAILED:" "parloops1" } }
42
43 ! Check the offloaded function's classification and compute dimensions (will
44 ! always be 1 x 1 x 1 for non-offloading compilation).
45 ! { dg-final { scan-tree-dump-times "(?n)Function is parallelized OpenACC kernels offload" 1 "oaccloops" } }
46 ! { dg-final { scan-tree-dump-times "(?n)Compute dimensions \\\[1, 1, 1\\\]" 1 "oaccloops" } }
47 ! { 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" } }