* function.c (dump_stack_clash_frame_info): New function.
[official-gcc.git] / libgomp / testsuite / libgomp.oacc-fortran / kernels-loop-2.f95
blobb88ca67f2c7e83b185d7f6389ad68c65b5d5d4ff
1 ! { dg-do run }
3 program main
4 implicit none
5 integer, parameter :: n = 1024
6 integer, dimension (0:n-1) :: a, b, c
7 integer :: i, ii
9 ! Parallelism dimensions: compiler/runtime decides.
10 !$acc kernels copyout (a(0:n-1))
11 do i = 0, n - 1
12 a(i) = i * 2
13 end do
14 !$acc end kernels
16 ! Parallelism dimensions: variable.
17 !$acc kernels copyout (b(0:n-1)) &
18 !$acc num_gangs (3 + a(3)) num_workers (5 + a(5)) vector_length (7 + a(7))
19 ! { dg-prune-output "using vector_length \\(32\\), ignoring runtime setting" }
20 do i = 0, n -1
21 b(i) = i * 4
22 end do
23 !$acc end kernels
25 ! Parallelism dimensions: literal.
26 !$acc kernels copyin (a(0:n-1), b(0:n-1)) copyout (c(0:n-1)) &
27 !$acc num_gangs (3) num_workers (5) vector_length (7)
28 ! { dg-prune-output "using vector_length \\(32\\), ignoring 7" }
29 do ii = 0, n - 1
30 c(ii) = a(ii) + b(ii)
31 end do
32 !$acc end kernels
34 do i = 0, n - 1
35 if (a(i) .ne. i * 2) call abort
36 if (b(i) .ne. i * 4) call abort
37 if (c(i) .ne. a(i) + b(i)) call abort
38 end do
40 end program main