Debian Codegraph @

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

raw
1 ! Check offloaded function's attributes and classification for OpenACC
2 ! parallel.
3
4 ! { dg-additional-options "-O2" }
5 ! { dg-additional-options "-fopt-info-optimized-omp" }
6 ! { dg-additional-options "-fdump-tree-ompexp" }
7 ! { dg-additional-options "-fdump-tree-oaccloops" }
8
9 ! { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
10 ! aspects of that functionality.
11
12 program main
13 implicit none
14 integer, parameter :: n = 1024
15 integer, dimension (0:n-1) :: a, b, c
16 integer :: i
17
18 call setup(a, b)
19
20 !$acc parallel loop copyin (a(0:n-1), b(0:n-1)) copyout (c(0:n-1)) ! { dg-line l_compute_loop_i1 }
21 ! { dg-optimized {assigned OpenACC gang vector loop parallelism} {} { target *-*-* } l_compute_loop_i1 }
22 do i = 0, n - 1
23 c(i) = a(i) + b(i)
24 end do
25 !$acc end parallel loop
26 end program main
27
28 ! Check the offloaded function's attributes.
29 ! { dg-final { scan-tree-dump-times "(?n)__attribute__\\(\\(oacc parallel, omp target entrypoint, noclone\\)\\)" 1 "ompexp" } }
30
31 ! Check the offloaded function's classification and compute dimensions (will
32 ! always be 1 x 1 x 1 for non-offloading compilation).
33 ! { dg-final { scan-tree-dump-times "(?n)Function is OpenACC parallel offload" 1 "oaccloops" } }
34 ! { dg-final { scan-tree-dump-times "(?n)Compute dimensions \\\[1, 1, 1\\\]" 1 "oaccloops" } }
35 ! { dg-final { scan-tree-dump-times "(?n)__attribute__\\(\\(oacc function \\(1, 1, 1\\), oacc parallel, omp target entrypoint, noclone\\)\\)" 1 "oaccloops" } }