]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gfortran.dg/goacc/classify-kernels.f95
[PR middle-end/69921] Use "oacc kernels parallelized" attribute for parallelized...
[thirdparty/gcc.git] / gcc / testsuite / gfortran.dg / goacc / classify-kernels.f95
1 ! Check offloaded function's attributes and classification for OpenACC
2 ! kernels.
3
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" }
8
9 program main
10 implicit none
11 integer, parameter :: n = 1024
12 integer, dimension (0:n-1) :: a, b, c
13 integer :: i
14
15 call setup(a, b)
16
17 !$acc kernels copyin (a(0:n-1), b(0:n-1)) copyout (c(0:n-1))
18 do i = 0, n - 1
19 c(i) = a(i) + b(i)
20 end do
21 !$acc end kernels
22 end program main
23
24 ! Check the offloaded function's attributes.
25 ! { dg-final { scan-tree-dump-times "(?n)__attribute__\\(\\(oacc kernels, omp target entrypoint\\)\\)" 1 "ompexp" } }
26
27 ! Check that exactly one OpenACC kernels construct is analyzed, and that it
28 ! can be parallelized.
29 ! { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 1 "parloops1" } }
30 ! { dg-final { scan-tree-dump-times "(?n)__attribute__\\(\\(oacc kernels parallelized, oacc function \\(, , \\), oacc kernels, omp target entrypoint\\)\\)" 1 "parloops1" } }
31 ! { dg-final { scan-tree-dump-not "FAILED:" "parloops1" } }
32
33 ! Check the offloaded function's classification and compute dimensions (will
34 ! always be 1 x 1 x 1 for non-offloading compilation).
35 ! { dg-final { scan-tree-dump-times "(?n)Function is parallelized OpenACC kernels offload" 1 "oaccdevlow" } }
36 ! { dg-final { scan-tree-dump-times "(?n)Compute dimensions \\\[1, 1, 1\\\]" 1 "oaccdevlow" } }
37 ! { dg-final { scan-tree-dump-times "(?n)__attribute__\\(\\(oacc function \\(1, 1, 1\\), oacc kernels parallelized, oacc function \\(, , \\), oacc kernels, omp target entrypoint\\)\\)" 1 "oaccdevlow" } }