| 1 |
! RUN: %python %S/../test_errors.py %s %flang -fopenacc |
| 2 |
|
| 3 |
! Check OpenACC clause validity for the following construct and directive: |
| 4 |
! 2.14.2 Shutdown |
| 5 |
|
| 6 |
program openacc_shutdown_validity |
| 7 |
|
| 8 |
implicit none |
| 9 |
|
| 10 |
integer :: i, j |
| 11 |
integer, parameter :: N = 256 |
| 12 |
logical :: ifCondition = .TRUE. |
| 13 |
real(8), dimension(N) :: a |
| 14 |
|
| 15 |
!$acc parallel |
| 16 |
!ERROR: Directive SHUTDOWN may not be called within a compute region |
| 17 |
!$acc shutdown |
| 18 |
!$acc end parallel |
| 19 |
|
| 20 |
!$acc serial |
| 21 |
!ERROR: Directive SHUTDOWN may not be called within a compute region |
| 22 |
!$acc shutdown |
| 23 |
!$acc end serial |
| 24 |
|
| 25 |
!$acc kernels |
| 26 |
!ERROR: Directive SHUTDOWN may not be called within a compute region |
| 27 |
!$acc shutdown |
| 28 |
!$acc end kernels |
| 29 |
|
| 30 |
!$acc parallel |
| 31 |
!$acc loop |
| 32 |
do i = 1, N |
| 33 |
!ERROR: Directive SHUTDOWN may not be called within a compute region |
| 34 |
!$acc shutdown |
| 35 |
a(i) = 3.14 |
| 36 |
end do |
| 37 |
!$acc end parallel |
| 38 |
|
| 39 |
!$acc serial |
| 40 |
!$acc loop |
| 41 |
do i = 1, N |
| 42 |
!ERROR: Directive SHUTDOWN may not be called within a compute region |
| 43 |
!$acc shutdown |
| 44 |
a(i) = 3.14 |
| 45 |
end do |
| 46 |
!$acc end serial |
| 47 |
|
| 48 |
!$acc kernels |
| 49 |
!$acc loop |
| 50 |
do i = 1, N |
| 51 |
!ERROR: Directive SHUTDOWN may not be called within a compute region |
| 52 |
!$acc shutdown |
| 53 |
a(i) = 3.14 |
| 54 |
end do |
| 55 |
!$acc end kernels |
| 56 |
|
| 57 |
!$acc parallel loop |
| 58 |
do i = 1, N |
| 59 |
!ERROR: Directive SHUTDOWN may not be called within a compute region |
| 60 |
!$acc shutdown |
| 61 |
a(i) = 3.14 |
| 62 |
end do |
| 63 |
|
| 64 |
!$acc serial loop |
| 65 |
do i = 1, N |
| 66 |
!ERROR: Directive SHUTDOWN may not be called within a compute region |
| 67 |
!$acc shutdown |
| 68 |
a(i) = 3.14 |
| 69 |
end do |
| 70 |
|
| 71 |
!$acc kernels loop |
| 72 |
do i = 1, N |
| 73 |
!ERROR: Directive SHUTDOWN may not be called within a compute region |
| 74 |
!$acc shutdown |
| 75 |
a(i) = 3.14 |
| 76 |
end do |
| 77 |
|
| 78 |
!$acc shutdown |
| 79 |
!$acc shutdown if(.TRUE.) |
| 80 |
!$acc shutdown if(ifCondition) |
| 81 |
!$acc shutdown device_num(1) |
| 82 |
!$acc shutdown device_num(i) |
| 83 |
!$acc shutdown device_type(*) |
| 84 |
!$acc shutdown device_type(*, default, host) |
| 85 |
!$acc shutdown device_num(i) device_type(default, host) if(ifCondition) |
| 86 |
|
| 87 |
!ERROR: At most one IF clause can appear on the SHUTDOWN directive |
| 88 |
!$acc shutdown if(.TRUE.) if(ifCondition) |
| 89 |
|
| 90 |
!ERROR: At most one DEVICE_NUM clause can appear on the SHUTDOWN directive |
| 91 |
!$acc shutdown device_num(1) device_num(i) |
| 92 |
|
| 93 |
!ERROR: At most one DEVICE_TYPE clause can appear on the SHUTDOWN directive |
| 94 |
!$acc shutdown device_type(*) device_type(host, default) |
| 95 |
|
| 96 |
end program openacc_shutdown_validity |