Debian Codegraph @

gcc/testsuite/gfortran.dg/goacc/common-block-3.f90

raw
1 ! { dg-options "-fopenacc -fdump-tree-omplower" }
2
3 ! { dg-additional-options "--param=openacc-kernels=decompose" }
4
5 ! { dg-additional-options "-fopt-info-omp-all" }
6
7 ! { dg-additional-options "--param=openacc-privatization=noisy" }
8 ! Prune a few: uninteresting, and potentially varying depending on GCC configuration (data types):
9 ! { dg-prune-output {note: variable 'D\.[0-9]+' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} }
10
11 module consts
12 integer, parameter :: n = 100
13 end module consts
14
15 program main
16 use consts
17 implicit none
18
19 integer :: i, j
20 real :: a(n) = 0, b(n) = 0, c, d, e(n)
21 real :: x(n) = 0, y(n), z
22 common /BLOCK/ a, b, c, j, d
23 common /KERNELS_BLOCK/ x, y, z
24
25 c = 1.0
26 !$acc parallel loop copy(/BLOCK/) ! { dg-line l1 }
27 ! { dg-note {variable 'i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l1 }
28 ! { dg-optimized {assigned OpenACC gang vector loop parallelism} {} { target *-*-* } l1 }
29 do i = 1, n
30 a(i) = b(i) + c
31 end do
32 !$acc kernels ! { dg-line l2 }
33 ! { dg-note {OpenACC 'kernels' decomposition: variable 'i' in 'copy' clause requested to be made addressable} {} { target *-*-* } l2 }
34 ! { dg-note {variable 'i' made addressable} {} { target *-*-* } l2 }
35 ! { dg-note {variable 'c\.[0-9]+' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l2 }
36 ! { dg-optimized {assigned OpenACC seq loop parallelism} {} { target *-*-* } l2 }
37 ! { dg-note {beginning 'parloops' part in OpenACC 'kernels' region} {} { target *-*-* } .+1 }
38 do i = 1, n
39 x(i) = y(i) + c
40 end do
41 !$acc end kernels
42 !$acc serial loop copy(/BLOCK/) ! { dg-line l3 }
43 ! { dg-note {variable 'i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l3 }
44 ! { dg-optimized {assigned OpenACC gang vector loop parallelism} {} { target *-*-* } l3 }
45 do i = 1, n
46 a(i) = b(i) + c
47 end do
48 end program main
49
50 ! { dg-final { scan-tree-dump-times "omp target oacc_parallel .*map\\(tofrom:a \\\[len: 400\\\]\\)" 1 "omplower" } }
51 ! { dg-final { scan-tree-dump-times "omp target oacc_parallel .*map\\(tofrom:b \\\[len: 400\\\]\\\)" 1 "omplower" } }
52 ! { dg-final { scan-tree-dump-times "omp target oacc_parallel .*map\\(tofrom:c \\\[len: 4\\\]\\)" 1 "omplower" } }
53
54 ! { dg-final { scan-tree-dump-times "omp target oacc_data_kernels .*map\\(force_tofrom:i \\\[len: 4\\\]\\)" 1 "omplower" } }
55 ! { dg-final { scan-tree-dump-times "omp target oacc_kernels .*map\\(force_present:i \\\[len: 4\\\]\\)" 1 "omplower" } }
56 ! { dg-final { scan-tree-dump-times "omp target oacc_data_kernels .*map\\(tofrom:x \\\[len: 400\\\]\\)" 1 "omplower" } }
57 ! { dg-final { scan-tree-dump-times "omp target oacc_kernels .*map\\(force_present:x \\\[len: 400\\\]\\)" 1 "omplower" } }
58 ! { dg-final { scan-tree-dump-times "omp target oacc_data_kernels .*map\\(tofrom:y \\\[len: 400\\\]\\\)" 1 "omplower" } }
59 ! { dg-final { scan-tree-dump-times "omp target oacc_kernels .*map\\(force_present:y \\\[len: 400\\\]\\\)" 1 "omplower" } }
60 ! { dg-final { scan-tree-dump-times "omp target oacc_data_kernels .*map\\(force_tofrom:c \\\[len: 4\\\]\\)" 1 "omplower" } }
61 ! { dg-final { scan-tree-dump-times "omp target oacc_kernels .*map\\(force_present:c \\\[len: 4\\\]\\)" 1 "omplower" } }
62
63 ! { dg-final { scan-tree-dump-times "omp target oacc_serial .*map\\(tofrom:a \\\[len: 400\\\]\\)" 1 "omplower" } }
64 ! { dg-final { scan-tree-dump-times "omp target oacc_serial .*map\\(tofrom:b \\\[len: 400\\\]\\\)" 1 "omplower" } }
65 ! { dg-final { scan-tree-dump-times "omp target oacc_serial .*map\\(tofrom:c \\\[len: 4\\\]\\)" 1 "omplower" } }
66
67 ! Expecting no mapping of un-referenced common-blocks variables
68
69 ! { dg-final { scan-tree-dump-not "map\\(.*:block" "omplower" } }
70 ! { dg-final { scan-tree-dump-not "map\\(.*:kernels_block" "omplower" } }
71 ! { dg-final { scan-tree-dump-not "map\\(.*:d " "omplower" } }
72 ! { dg-final { scan-tree-dump-not "map\\(.*:e " "omplower" } }
73 ! { dg-final { scan-tree-dump-not "map\\(.*:z " "omplower" } }