Skip gnat.dg/prot7.adb on hppa.
[official-gcc.git] / libgomp / testsuite / libgomp.oacc-fortran / kernels-private-vars-loop-worker-5.f90
blob22c0b9b1045ddc6e90b1b9755d77d7d6bca01621
1 ! Test of worker-private variables declared on a loop directive, broadcasting
2 ! to vector-partitioned mode. Addressable worker variable.
4 ! { dg-do run }
6 ! { dg-additional-options "--param=openacc-kernels=decompose" }
8 ! { dg-additional-options "-fopt-info-omp-all" }
9 ! { dg-additional-options "-foffload=-fopt-info-omp-all" }
11 ! { dg-additional-options "--param=openacc-privatization=noisy" }
12 ! { dg-additional-options "-foffload=--param=openacc-privatization=noisy" }
13 ! Prune a few: uninteresting:
14 ! { dg-prune-output {note: variable 'D\.[0-9]+' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} }
16 ! It's only with Tcl 8.5 (released in 2007) that "the variable 'varName'
17 ! passed to 'incr' may be unset, and in that case, it will be set to [...]",
18 ! so to maintain compatibility with earlier Tcl releases, we manually
19 ! initialize counter variables:
20 ! { dg-line l_dummy[variable c_compute 0 c_loop_i 0 c_loop_j 0 c_loop_k 0] }
21 ! { dg-message "dummy" "" { target iN-VAl-Id } l_dummy } to avoid
22 ! "WARNING: dg-line var l_dummy defined, but not used".
24 program main
25 integer :: i, j, k, idx, arr(0:32*32*32)
26 integer, target :: x
27 integer, pointer :: p
29 do i = 0, 32*32*32-1
30 arr(i) = i
31 end do
33 !$acc kernels copy(arr) ! { dg-line l_compute[incr c_compute] }
34 ! { dg-note {variable 'x\.[0-9]+' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_compute$c_compute }
35 ! { dg-note {forwarded loop nest in OpenACC 'kernels' region to 'parloops' for analysis} {} { target *-*-* } .+1 }
36 !$acc loop gang(num:32) ! { dg-line l_loop_i[incr c_loop_i] }
37 ! { dg-note {variable 'i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop_i$c_loop_i }
38 do i = 0, 31
39 !$acc loop worker(num:8) private(x, p) ! { dg-line l_loop_j[incr c_loop_j] }
40 ! { dg-note {variable 'j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop_j$c_loop_j }
41 ! { dg-note {variable 'x' in 'private' clause is candidate for adjusting OpenACC privatization level} {} { target *-*-* } l_loop_j$c_loop_j }
42 ! { dg-note {variable 'p' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop_j$c_loop_j }
43 do j = 0, 31
44 p => x
45 x = ieor(i, j * 3)
47 !$acc loop vector(length:32) ! { dg-line l_loop_k[incr c_loop_k] }
48 ! { dg-note {variable 'k' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop_k$c_loop_k }
49 do k = 0, 31
50 arr(i * 1024 + j * 32 + k) = arr(i * 1024 + j * 32 + k) + x * k
51 end do
53 p = ior(i, j * 5)
55 !$acc loop vector(length:32) ! { dg-line l_loop_k[incr c_loop_k] }
56 ! { dg-note {variable 'k' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop_k$c_loop_k }
57 do k = 0, 31
58 arr(i * 1024 + j * 32 + k) = arr(i * 1024 + j * 32 + k) + x * k
59 end do
60 end do
61 end do
62 ! { dg-optimized {assigned OpenACC seq loop parallelism} {} { target *-*-* } l_loop_i$c_loop_i }
63 !$acc end kernels
65 do i = 0, 32 - 1
66 do j = 0, 32 -1
67 do k = 0, 32 - 1
68 idx = i * 1024 + j * 32 + k
69 if (arr(idx) .ne. idx + ieor(i, j * 3) * k + ior(i, j * 5) * k) then
70 stop 1
71 end if
72 end do
73 end do
74 end do
75 end program main