2021-02-10 09:24:45 +00:00
|
|
|
! RUN: %S/../test_errors.sh %s %t %flang -fopenacc
|
2021-06-10 05:06:56 -05:00
|
|
|
! REQUIRES: shell
|
2021-01-26 14:53:50 -05:00
|
|
|
|
|
|
|
! Check OpenACC clause validity for the following construct and directive:
|
|
|
|
! 2.8 host_data
|
|
|
|
|
|
|
|
program openacc_host_data_validity
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
integer, parameter :: N = 256
|
|
|
|
real(8), dimension(N, N) :: aa, bb
|
|
|
|
logical :: ifCondition = .TRUE.
|
|
|
|
|
|
|
|
!ERROR: At least one of USE_DEVICE clause must appear on the HOST_DATA directive
|
|
|
|
!$acc host_data
|
|
|
|
!$acc end host_data
|
|
|
|
|
|
|
|
!$acc host_data use_device(aa)
|
|
|
|
!$acc end host_data
|
|
|
|
|
|
|
|
!$acc host_data use_device(aa) if(.true.)
|
|
|
|
!$acc end host_data
|
|
|
|
|
|
|
|
!$acc host_data use_device(aa) if(ifCondition)
|
|
|
|
!$acc end host_data
|
|
|
|
|
|
|
|
!$acc host_data use_device(aa, bb) if_present
|
|
|
|
!$acc end host_data
|
|
|
|
|
2021-01-27 10:06:18 -05:00
|
|
|
!ERROR: At most one IF_PRESENT clause can appear on the HOST_DATA directive
|
|
|
|
!$acc host_data use_device(aa, bb) if_present if_present
|
|
|
|
!$acc end host_data
|
|
|
|
|
2021-01-26 14:53:50 -05:00
|
|
|
!$acc host_data use_device(aa, bb) if(.true.) if_present
|
|
|
|
!$acc end host_data
|
|
|
|
|
2021-01-27 10:06:18 -05:00
|
|
|
!ERROR: At most one IF clause can appear on the HOST_DATA directive
|
2021-01-26 14:53:50 -05:00
|
|
|
!$acc host_data use_device(aa, bb) if(.true.) if(ifCondition)
|
|
|
|
!$acc end host_data
|
|
|
|
|
|
|
|
end program openacc_host_data_validity
|