brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.9 KiB · 3d514e1 Raw
109 lines · plain
1! RUN: %python %S/../test_errors.py %s %flang -fopenacc2 3! Check OpenACC clause validity for the following construct and directive:4!   2.14.3 Set5 6program openacc_clause_validity7 8  implicit none9 10  integer :: i, j11  integer, parameter :: N = 25612  real(8), dimension(N) :: a13 14  !$acc parallel15  !ERROR: Directive SET may not be called within a compute region16  !$acc set default_async(i)17  !$acc end parallel18 19  !$acc serial20  !ERROR: Directive SET may not be called within a compute region21  !$acc set default_async(i)22  !$acc end serial23 24  !$acc kernels25  !ERROR: Directive SET may not be called within a compute region26  !$acc set default_async(i)27  !$acc end kernels28 29  !$acc parallel30  !$acc loop31  do i = 1, N32    !ERROR: Directive SET may not be called within a compute region33    !$acc set default_async(i)34    a(i) = 3.14d035  end do36  !$acc end parallel37 38  !$acc serial39  !$acc loop40  do i = 1, N41    !ERROR: Directive SET may not be called within a compute region42    !$acc set default_async(i)43    a(i) = 3.14d044  end do45  !$acc end serial46 47  !$acc kernels48  !$acc loop49  do i = 1, N50    !ERROR: Directive SET may not be called within a compute region51    !$acc set default_async(i)52    a(i) = 3.14d053  end do54  !$acc end kernels55 56  !$acc parallel loop57  do i = 1, N58    !ERROR: Directive SET may not be called within a compute region59    !$acc set default_async(i)60    a(i) = 3.14d061  end do62 63  !$acc serial loop64  do i = 1, N65    !ERROR: Directive SET may not be called within a compute region66    !$acc set default_async(i)67    a(i) = 3.14d068  end do69 70  !$acc kernels loop71  do i = 1, N72    !ERROR: Directive SET may not be called within a compute region73    !$acc set default_async(i)74    a(i) = 3.14d075  end do76 77  !ERROR: At least one of DEFAULT_ASYNC, DEVICE_NUM, DEVICE_TYPE clause must appear on the SET directive78  !$acc set79 80  !ERROR: At least one of DEFAULT_ASYNC, DEVICE_NUM, DEVICE_TYPE clause must appear on the SET directive81  !$acc set if(.TRUE.)82 83  !ERROR: At most one DEFAULT_ASYNC clause can appear on the SET directive84  !$acc set default_async(2) default_async(1)85 86  !ERROR: At most one DEFAULT_ASYNC clause can appear on the SET directive87  !$acc set default_async(2) default_async(1)88 89  !ERROR: At most one DEVICE_NUM clause can appear on the SET directive90  !$acc set device_num(1) device_num(i)91 92  !ERROR: At most one DEVICE_TYPE clause can appear on the SET directive93  !$acc set device_type(*) device_type(nvidia)94 95  !$acc set default_async(2)96  !$acc set default_async(i)97  !$acc set device_num(1)98  !$acc set device_num(i)99  !$acc set device_type(default)100  !$acc set device_num(1) default_async(2) device_type(*)101 102  !ERROR: The DEVICE_TYPE clause on the SET directive accepts only one value103  !$acc set device_type(*, default)104 105  !ERROR: At least one of DEFAULT_ASYNC, DEVICE_NUM, DEVICE_TYPE clause must appear on the SET directive106  !$acc set107 108end program openacc_clause_validity109