[flang][openacc] OpenACC 3.0 parser
Summary:
This patch introduce the parser for OpenACC 3.0 in Flang. It uses the same TableGen mechanism
than OpenMP.
Reviewers: nvdatian, sscalpone, tskeith, klausler, ichoyjx, jdoerfert, DavidTruby
Reviewed By: klausler
Subscribers: MaskRay, SouraVX, mgorny, hiraditya, jfb, sstefan1, llvm-commits
Tags: #llvm, #flang
Differential Revision: https://reviews.llvm.org/D83649
2020-07-15 02:28:34 +08:00
|
|
|
! RUN: %S/test_errors.sh %s %t %f18 -fopenacc
|
|
|
|
|
|
|
|
! Check OpenACC clause validity for the following construct and directive:
|
|
|
|
! 2.6.5 Data
|
|
|
|
! 2.5.1 Parallel
|
|
|
|
! 2.5.2 Kernels
|
|
|
|
! 2.5.3 Serial
|
2020-08-14 02:04:43 +08:00
|
|
|
! 2.9 Loop
|
2020-10-23 22:31:33 +08:00
|
|
|
! 2.12 Atomic
|
2020-08-14 02:04:43 +08:00
|
|
|
! 2.13 Declare
|
|
|
|
! 2.14.3 Set
|
|
|
|
! 2.14.4 Update
|
[flang][openacc] OpenACC 3.0 parser
Summary:
This patch introduce the parser for OpenACC 3.0 in Flang. It uses the same TableGen mechanism
than OpenMP.
Reviewers: nvdatian, sscalpone, tskeith, klausler, ichoyjx, jdoerfert, DavidTruby
Reviewed By: klausler
Subscribers: MaskRay, SouraVX, mgorny, hiraditya, jfb, sstefan1, llvm-commits
Tags: #llvm, #flang
Differential Revision: https://reviews.llvm.org/D83649
2020-07-15 02:28:34 +08:00
|
|
|
! 2.15.1 Routine
|
2020-11-25 23:28:02 +08:00
|
|
|
! 2.10 Cache
|
[flang][openacc] OpenACC 3.0 parser
Summary:
This patch introduce the parser for OpenACC 3.0 in Flang. It uses the same TableGen mechanism
than OpenMP.
Reviewers: nvdatian, sscalpone, tskeith, klausler, ichoyjx, jdoerfert, DavidTruby
Reviewed By: klausler
Subscribers: MaskRay, SouraVX, mgorny, hiraditya, jfb, sstefan1, llvm-commits
Tags: #llvm, #flang
Differential Revision: https://reviews.llvm.org/D83649
2020-07-15 02:28:34 +08:00
|
|
|
! 2.11 Parallel Loop
|
|
|
|
! 2.11 Kernels Loop
|
|
|
|
! 2.11 Serial Loop
|
2020-11-06 11:19:21 +08:00
|
|
|
! 2.14.3 Set
|
2020-10-23 22:31:33 +08:00
|
|
|
! 2.16.13 Wait
|
[flang][openacc] OpenACC 3.0 parser
Summary:
This patch introduce the parser for OpenACC 3.0 in Flang. It uses the same TableGen mechanism
than OpenMP.
Reviewers: nvdatian, sscalpone, tskeith, klausler, ichoyjx, jdoerfert, DavidTruby
Reviewed By: klausler
Subscribers: MaskRay, SouraVX, mgorny, hiraditya, jfb, sstefan1, llvm-commits
Tags: #llvm, #flang
Differential Revision: https://reviews.llvm.org/D83649
2020-07-15 02:28:34 +08:00
|
|
|
|
|
|
|
program openacc_clause_validity
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
|
2020-11-25 23:28:02 +08:00
|
|
|
type atype
|
|
|
|
real(8), dimension(10) :: arr
|
|
|
|
real(8) :: s
|
|
|
|
end type atype
|
|
|
|
|
2020-08-28 10:32:29 +08:00
|
|
|
integer :: i, j, b, gang_size, vector_size, worker_size
|
2020-08-25 02:22:34 +08:00
|
|
|
integer, parameter :: N = 256
|
|
|
|
integer, dimension(N) :: c
|
|
|
|
logical, dimension(N) :: d, e
|
2020-11-21 09:04:54 +08:00
|
|
|
integer :: async1
|
|
|
|
integer :: wait1, wait2
|
2020-08-25 02:22:34 +08:00
|
|
|
real :: reduction_r
|
|
|
|
logical :: reduction_l
|
2020-11-21 09:04:54 +08:00
|
|
|
real(8), dimension(N, N) :: aa, bb, cc
|
2020-10-07 09:26:13 +08:00
|
|
|
logical :: ifCondition = .TRUE.
|
2020-11-25 23:28:02 +08:00
|
|
|
type(atype) :: t
|
|
|
|
type(atype), dimension(10) :: ta
|
2020-08-25 02:22:34 +08:00
|
|
|
|
2020-07-15 08:43:40 +08:00
|
|
|
!ERROR: At least one clause is required on the DECLARE directive
|
[flang][openacc] OpenACC 3.0 parser
Summary:
This patch introduce the parser for OpenACC 3.0 in Flang. It uses the same TableGen mechanism
than OpenMP.
Reviewers: nvdatian, sscalpone, tskeith, klausler, ichoyjx, jdoerfert, DavidTruby
Reviewed By: klausler
Subscribers: MaskRay, SouraVX, mgorny, hiraditya, jfb, sstefan1, llvm-commits
Tags: #llvm, #flang
Differential Revision: https://reviews.llvm.org/D83649
2020-07-15 02:28:34 +08:00
|
|
|
!$acc declare
|
2020-10-28 09:09:48 +08:00
|
|
|
real(8), dimension(N) :: a, f, g, h
|
[flang][openacc] OpenACC 3.0 parser
Summary:
This patch introduce the parser for OpenACC 3.0 in Flang. It uses the same TableGen mechanism
than OpenMP.
Reviewers: nvdatian, sscalpone, tskeith, klausler, ichoyjx, jdoerfert, DavidTruby
Reviewed By: klausler
Subscribers: MaskRay, SouraVX, mgorny, hiraditya, jfb, sstefan1, llvm-commits
Tags: #llvm, #flang
Differential Revision: https://reviews.llvm.org/D83649
2020-07-15 02:28:34 +08:00
|
|
|
|
2020-10-07 09:26:13 +08:00
|
|
|
!$acc init
|
|
|
|
!$acc init if(.TRUE.)
|
|
|
|
!$acc init if(ifCondition)
|
|
|
|
!$acc init device_num(1)
|
|
|
|
!$acc init device_num(i)
|
|
|
|
!$acc init device_type(i)
|
|
|
|
!$acc init device_type(2, i, j)
|
|
|
|
!$acc init device_num(i) device_type(i, j) if(ifCondition)
|
|
|
|
|
2020-11-06 11:19:21 +08:00
|
|
|
!ERROR: At least one of DEFAULT_ASYNC, DEVICE_NUM, DEVICE_TYPE clause must appear on the SET directive
|
|
|
|
!$acc set
|
|
|
|
|
|
|
|
!ERROR: At least one of DEFAULT_ASYNC, DEVICE_NUM, DEVICE_TYPE clause must appear on the SET directive
|
|
|
|
!$acc set if(.TRUE.)
|
|
|
|
|
|
|
|
!ERROR: At most one DEFAULT_ASYNC clause can appear on the SET directive
|
|
|
|
!$acc set default_async(2) default_async(1)
|
|
|
|
|
|
|
|
!ERROR: At most one DEFAULT_ASYNC clause can appear on the SET directive
|
|
|
|
!$acc set default_async(2) default_async(1)
|
|
|
|
|
|
|
|
!ERROR: At most one DEVICE_NUM clause can appear on the SET directive
|
|
|
|
!$acc set device_num(1) device_num(i)
|
|
|
|
|
|
|
|
!ERROR: At most one DEVICE_TYPE clause can appear on the SET directive
|
|
|
|
!$acc set device_type(i) device_type(2, i, j)
|
|
|
|
|
|
|
|
!$acc set default_async(2)
|
|
|
|
!$acc set default_async(i)
|
|
|
|
!$acc set device_num(1)
|
|
|
|
!$acc set device_num(i)
|
|
|
|
!$acc set device_type(i)
|
|
|
|
!$acc set device_type(2, i, j)
|
|
|
|
!$acc set device_num(1) default_async(2) device_type(2, i, j)
|
|
|
|
|
2020-07-15 08:43:40 +08:00
|
|
|
!ERROR: At least one of ATTACH, COPYIN, CREATE clause must appear on the ENTER DATA directive
|
[flang][openacc] OpenACC 3.0 parser
Summary:
This patch introduce the parser for OpenACC 3.0 in Flang. It uses the same TableGen mechanism
than OpenMP.
Reviewers: nvdatian, sscalpone, tskeith, klausler, ichoyjx, jdoerfert, DavidTruby
Reviewed By: klausler
Subscribers: MaskRay, SouraVX, mgorny, hiraditya, jfb, sstefan1, llvm-commits
Tags: #llvm, #flang
Differential Revision: https://reviews.llvm.org/D83649
2020-07-15 02:28:34 +08:00
|
|
|
!$acc enter data
|
|
|
|
|
2020-10-29 21:53:10 +08:00
|
|
|
!ERROR: Modifier is not allowed for the COPYIN clause on the ENTER DATA directive
|
[flang][openacc] OpenACC 3.0 parser
Summary:
This patch introduce the parser for OpenACC 3.0 in Flang. It uses the same TableGen mechanism
than OpenMP.
Reviewers: nvdatian, sscalpone, tskeith, klausler, ichoyjx, jdoerfert, DavidTruby
Reviewed By: klausler
Subscribers: MaskRay, SouraVX, mgorny, hiraditya, jfb, sstefan1, llvm-commits
Tags: #llvm, #flang
Differential Revision: https://reviews.llvm.org/D83649
2020-07-15 02:28:34 +08:00
|
|
|
!$acc enter data copyin(zero: i)
|
|
|
|
|
2020-10-29 21:53:10 +08:00
|
|
|
!ERROR: Modifier is not allowed for the COPYOUT clause on the EXIT DATA directive
|
|
|
|
!$acc exit data copyout(zero: i)
|
|
|
|
|
2020-07-15 08:43:40 +08:00
|
|
|
!ERROR: Only the ZERO modifier is allowed for the CREATE clause on the ENTER DATA directive
|
[flang][openacc] OpenACC 3.0 parser
Summary:
This patch introduce the parser for OpenACC 3.0 in Flang. It uses the same TableGen mechanism
than OpenMP.
Reviewers: nvdatian, sscalpone, tskeith, klausler, ichoyjx, jdoerfert, DavidTruby
Reviewed By: klausler
Subscribers: MaskRay, SouraVX, mgorny, hiraditya, jfb, sstefan1, llvm-commits
Tags: #llvm, #flang
Differential Revision: https://reviews.llvm.org/D83649
2020-07-15 02:28:34 +08:00
|
|
|
!$acc enter data create(readonly: i)
|
|
|
|
|
2020-07-15 08:43:40 +08:00
|
|
|
!ERROR: Only the ZERO modifier is allowed for the COPYOUT clause on the DATA directive
|
[flang][openacc] OpenACC 3.0 parser
Summary:
This patch introduce the parser for OpenACC 3.0 in Flang. It uses the same TableGen mechanism
than OpenMP.
Reviewers: nvdatian, sscalpone, tskeith, klausler, ichoyjx, jdoerfert, DavidTruby
Reviewed By: klausler
Subscribers: MaskRay, SouraVX, mgorny, hiraditya, jfb, sstefan1, llvm-commits
Tags: #llvm, #flang
Differential Revision: https://reviews.llvm.org/D83649
2020-07-15 02:28:34 +08:00
|
|
|
!$acc data copyout(readonly: i)
|
|
|
|
!$acc end data
|
|
|
|
|
2020-07-15 08:43:40 +08:00
|
|
|
!ERROR: COPYOUT clause is not allowed on the ENTER DATA directive
|
[flang][openacc] OpenACC 3.0 parser
Summary:
This patch introduce the parser for OpenACC 3.0 in Flang. It uses the same TableGen mechanism
than OpenMP.
Reviewers: nvdatian, sscalpone, tskeith, klausler, ichoyjx, jdoerfert, DavidTruby
Reviewed By: klausler
Subscribers: MaskRay, SouraVX, mgorny, hiraditya, jfb, sstefan1, llvm-commits
Tags: #llvm, #flang
Differential Revision: https://reviews.llvm.org/D83649
2020-07-15 02:28:34 +08:00
|
|
|
!$acc enter data copyin(i) copyout(i)
|
|
|
|
|
2020-07-15 08:43:40 +08:00
|
|
|
!ERROR: At most one IF clause can appear on the DATA directive
|
[flang][openacc] OpenACC 3.0 parser
Summary:
This patch introduce the parser for OpenACC 3.0 in Flang. It uses the same TableGen mechanism
than OpenMP.
Reviewers: nvdatian, sscalpone, tskeith, klausler, ichoyjx, jdoerfert, DavidTruby
Reviewed By: klausler
Subscribers: MaskRay, SouraVX, mgorny, hiraditya, jfb, sstefan1, llvm-commits
Tags: #llvm, #flang
Differential Revision: https://reviews.llvm.org/D83649
2020-07-15 02:28:34 +08:00
|
|
|
!$acc data copy(i) if(.true.) if(.true.)
|
|
|
|
!$acc end data
|
|
|
|
|
2020-07-15 08:43:40 +08:00
|
|
|
!ERROR: At least one of COPYOUT, DELETE, DETACH clause must appear on the EXIT DATA directive
|
[flang][openacc] OpenACC 3.0 parser
Summary:
This patch introduce the parser for OpenACC 3.0 in Flang. It uses the same TableGen mechanism
than OpenMP.
Reviewers: nvdatian, sscalpone, tskeith, klausler, ichoyjx, jdoerfert, DavidTruby
Reviewed By: klausler
Subscribers: MaskRay, SouraVX, mgorny, hiraditya, jfb, sstefan1, llvm-commits
Tags: #llvm, #flang
Differential Revision: https://reviews.llvm.org/D83649
2020-07-15 02:28:34 +08:00
|
|
|
!$acc exit data
|
|
|
|
|
2020-07-15 08:43:40 +08:00
|
|
|
!ERROR: At least one of USE_DEVICE clause must appear on the HOST_DATA directive
|
[flang][openacc] OpenACC 3.0 parser
Summary:
This patch introduce the parser for OpenACC 3.0 in Flang. It uses the same TableGen mechanism
than OpenMP.
Reviewers: nvdatian, sscalpone, tskeith, klausler, ichoyjx, jdoerfert, DavidTruby
Reviewed By: klausler
Subscribers: MaskRay, SouraVX, mgorny, hiraditya, jfb, sstefan1, llvm-commits
Tags: #llvm, #flang
Differential Revision: https://reviews.llvm.org/D83649
2020-07-15 02:28:34 +08:00
|
|
|
!$acc host_data
|
|
|
|
!$acc end host_data
|
|
|
|
|
2020-11-21 09:17:18 +08:00
|
|
|
!$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
|
|
|
|
|
|
|
|
!$acc host_data use_device(aa, bb) if(.true.) if_present
|
|
|
|
!$acc end host_data
|
|
|
|
|
2020-07-15 08:43:40 +08:00
|
|
|
!ERROR: At least one of DEFAULT_ASYNC, DEVICE_NUM, DEVICE_TYPE clause must appear on the SET directive
|
[flang][openacc] OpenACC 3.0 parser
Summary:
This patch introduce the parser for OpenACC 3.0 in Flang. It uses the same TableGen mechanism
than OpenMP.
Reviewers: nvdatian, sscalpone, tskeith, klausler, ichoyjx, jdoerfert, DavidTruby
Reviewed By: klausler
Subscribers: MaskRay, SouraVX, mgorny, hiraditya, jfb, sstefan1, llvm-commits
Tags: #llvm, #flang
Differential Revision: https://reviews.llvm.org/D83649
2020-07-15 02:28:34 +08:00
|
|
|
!$acc set
|
|
|
|
|
2020-07-15 08:43:40 +08:00
|
|
|
!ERROR: At least one of ATTACH, COPY, COPYIN, COPYOUT, CREATE, DEFAULT, DEVICEPTR, NO_CREATE, PRESENT clause must appear on the DATA directive
|
[flang][openacc] OpenACC 3.0 parser
Summary:
This patch introduce the parser for OpenACC 3.0 in Flang. It uses the same TableGen mechanism
than OpenMP.
Reviewers: nvdatian, sscalpone, tskeith, klausler, ichoyjx, jdoerfert, DavidTruby
Reviewed By: klausler
Subscribers: MaskRay, SouraVX, mgorny, hiraditya, jfb, sstefan1, llvm-commits
Tags: #llvm, #flang
Differential Revision: https://reviews.llvm.org/D83649
2020-07-15 02:28:34 +08:00
|
|
|
!$acc data
|
|
|
|
!$acc end data
|
|
|
|
|
2020-12-05 04:12:05 +08:00
|
|
|
!$acc data copy(aa) if(.true.)
|
|
|
|
!$acc end data
|
|
|
|
|
|
|
|
!$acc data copy(aa) if(ifCondition)
|
|
|
|
!$acc end data
|
|
|
|
|
|
|
|
!$acc data copy(aa, bb, cc)
|
|
|
|
!$acc end data
|
|
|
|
|
|
|
|
!$acc data copyin(aa) copyin(readonly: bb) copyout(cc)
|
|
|
|
!$acc end data
|
|
|
|
|
|
|
|
!$acc data copyin(readonly: aa, bb) copyout(zero: cc)
|
|
|
|
!$acc end data
|
|
|
|
|
|
|
|
!$acc data create(aa, bb(:,:)) create(zero: cc(:,:))
|
|
|
|
!$acc end data
|
|
|
|
|
|
|
|
!$acc data no_create(aa) present(bb, cc)
|
|
|
|
!$acc end data
|
|
|
|
|
|
|
|
!$acc data deviceptr(aa) attach(bb, cc)
|
|
|
|
!$acc end data
|
|
|
|
|
|
|
|
!$acc data copy(aa, bb) default(none)
|
|
|
|
!$acc end data
|
|
|
|
|
|
|
|
!$acc data copy(aa, bb) default(present)
|
|
|
|
!$acc end data
|
|
|
|
|
|
|
|
!ERROR: At most one DEFAULT clause can appear on the DATA directive
|
|
|
|
!$acc data copy(aa, bb) default(none) default(present)
|
|
|
|
!$acc end data
|
|
|
|
|
|
|
|
!ERROR: At most one IF clause can appear on the DATA directive
|
|
|
|
!$acc data copy(aa) if(.true.) if(ifCondition)
|
[flang][openacc] OpenACC 3.0 parser
Summary:
This patch introduce the parser for OpenACC 3.0 in Flang. It uses the same TableGen mechanism
than OpenMP.
Reviewers: nvdatian, sscalpone, tskeith, klausler, ichoyjx, jdoerfert, DavidTruby
Reviewed By: klausler
Subscribers: MaskRay, SouraVX, mgorny, hiraditya, jfb, sstefan1, llvm-commits
Tags: #llvm, #flang
Differential Revision: https://reviews.llvm.org/D83649
2020-07-15 02:28:34 +08:00
|
|
|
!$acc end data
|
|
|
|
|
|
|
|
!$acc data copyin(i)
|
2020-07-15 08:43:40 +08:00
|
|
|
!ERROR: Unmatched PARALLEL directive
|
[flang][openacc] OpenACC 3.0 parser
Summary:
This patch introduce the parser for OpenACC 3.0 in Flang. It uses the same TableGen mechanism
than OpenMP.
Reviewers: nvdatian, sscalpone, tskeith, klausler, ichoyjx, jdoerfert, DavidTruby
Reviewed By: klausler
Subscribers: MaskRay, SouraVX, mgorny, hiraditya, jfb, sstefan1, llvm-commits
Tags: #llvm, #flang
Differential Revision: https://reviews.llvm.org/D83649
2020-07-15 02:28:34 +08:00
|
|
|
!$acc end parallel
|
|
|
|
|
2020-10-28 09:09:48 +08:00
|
|
|
!$acc update self(a, f) host(g) device(h)
|
|
|
|
|
2020-12-05 04:06:22 +08:00
|
|
|
!$acc update device(i) device_type(*) async
|
[flang][openacc] OpenACC 3.0 parser
Summary:
This patch introduce the parser for OpenACC 3.0 in Flang. It uses the same TableGen mechanism
than OpenMP.
Reviewers: nvdatian, sscalpone, tskeith, klausler, ichoyjx, jdoerfert, DavidTruby
Reviewed By: klausler
Subscribers: MaskRay, SouraVX, mgorny, hiraditya, jfb, sstefan1, llvm-commits
Tags: #llvm, #flang
Differential Revision: https://reviews.llvm.org/D83649
2020-07-15 02:28:34 +08:00
|
|
|
|
2020-07-15 08:43:40 +08:00
|
|
|
!ERROR: Clause IF is not allowed after clause DEVICE_TYPE on the UPDATE directive
|
[flang][openacc] OpenACC 3.0 parser
Summary:
This patch introduce the parser for OpenACC 3.0 in Flang. It uses the same TableGen mechanism
than OpenMP.
Reviewers: nvdatian, sscalpone, tskeith, klausler, ichoyjx, jdoerfert, DavidTruby
Reviewed By: klausler
Subscribers: MaskRay, SouraVX, mgorny, hiraditya, jfb, sstefan1, llvm-commits
Tags: #llvm, #flang
Differential Revision: https://reviews.llvm.org/D83649
2020-07-15 02:28:34 +08:00
|
|
|
!$acc update device(i) device_type(*) if(.TRUE.)
|
|
|
|
|
|
|
|
!$acc parallel
|
2020-07-15 08:43:40 +08:00
|
|
|
!ERROR: INDEPENDENT and SEQ clauses are mutually exclusive and may not appear on the same LOOP directive
|
[flang][openacc] OpenACC 3.0 parser
Summary:
This patch introduce the parser for OpenACC 3.0 in Flang. It uses the same TableGen mechanism
than OpenMP.
Reviewers: nvdatian, sscalpone, tskeith, klausler, ichoyjx, jdoerfert, DavidTruby
Reviewed By: klausler
Subscribers: MaskRay, SouraVX, mgorny, hiraditya, jfb, sstefan1, llvm-commits
Tags: #llvm, #flang
Differential Revision: https://reviews.llvm.org/D83649
2020-07-15 02:28:34 +08:00
|
|
|
!$acc loop seq independent
|
|
|
|
do i = 1, N
|
|
|
|
a(i) = 3.14
|
|
|
|
end do
|
|
|
|
!$acc end parallel
|
|
|
|
|
2020-08-28 10:13:29 +08:00
|
|
|
!$acc parallel
|
|
|
|
!$acc loop tile(2)
|
|
|
|
do i = 1, N
|
|
|
|
a(i) = 3.14
|
|
|
|
end do
|
|
|
|
!$acc end parallel
|
|
|
|
|
|
|
|
!$acc parallel loop tile(2)
|
|
|
|
do i = 1, N
|
|
|
|
a(i) = 3.14
|
|
|
|
end do
|
|
|
|
|
2020-10-28 09:09:48 +08:00
|
|
|
!$acc parallel loop self
|
|
|
|
do i = 1, N
|
|
|
|
a(i) = 3.14
|
|
|
|
end do
|
|
|
|
|
|
|
|
!$acc parallel loop self(.true.)
|
|
|
|
do i = 1, N
|
|
|
|
a(i) = 3.14
|
|
|
|
end do
|
|
|
|
|
|
|
|
!$acc parallel loop self(ifCondition)
|
|
|
|
do i = 1, N
|
|
|
|
a(i) = 3.14
|
|
|
|
end do
|
|
|
|
|
2020-08-28 10:13:29 +08:00
|
|
|
!$acc parallel loop tile(2, 2)
|
|
|
|
do i = 1, N
|
|
|
|
do j = 1, N
|
|
|
|
aa(i, j) = 3.14
|
|
|
|
end do
|
|
|
|
end do
|
|
|
|
|
[flang][openacc] OpenACC 3.0 parser
Summary:
This patch introduce the parser for OpenACC 3.0 in Flang. It uses the same TableGen mechanism
than OpenMP.
Reviewers: nvdatian, sscalpone, tskeith, klausler, ichoyjx, jdoerfert, DavidTruby
Reviewed By: klausler
Subscribers: MaskRay, SouraVX, mgorny, hiraditya, jfb, sstefan1, llvm-commits
Tags: #llvm, #flang
Differential Revision: https://reviews.llvm.org/D83649
2020-07-15 02:28:34 +08:00
|
|
|
!$acc parallel device_type(*) num_gangs(2)
|
|
|
|
!$acc loop
|
|
|
|
do i = 1, N
|
|
|
|
a(i) = 3.14
|
|
|
|
end do
|
|
|
|
!$acc end parallel
|
|
|
|
|
2020-08-28 10:32:29 +08:00
|
|
|
!$acc parallel
|
|
|
|
!$acc loop seq
|
|
|
|
do i = 1, N
|
|
|
|
a(i) = 3.14
|
|
|
|
end do
|
|
|
|
!$acc end parallel
|
|
|
|
|
|
|
|
!$acc parallel
|
|
|
|
!$acc loop independent
|
|
|
|
do i = 1, N
|
|
|
|
a(i) = 3.14
|
|
|
|
end do
|
|
|
|
!$acc end parallel
|
|
|
|
|
|
|
|
!$acc parallel
|
|
|
|
!$acc loop auto
|
|
|
|
do i = 1, N
|
|
|
|
a(i) = 3.14
|
|
|
|
end do
|
|
|
|
!$acc end parallel
|
|
|
|
|
|
|
|
!$acc parallel
|
|
|
|
!$acc loop vector
|
|
|
|
do i = 1, N
|
|
|
|
a(i) = 3.14
|
|
|
|
end do
|
|
|
|
!$acc end parallel
|
|
|
|
|
|
|
|
!$acc parallel
|
|
|
|
!$acc loop vector(10)
|
|
|
|
do i = 1, N
|
|
|
|
a(i) = 3.14
|
|
|
|
end do
|
|
|
|
!$acc end parallel
|
|
|
|
|
|
|
|
!$acc parallel
|
|
|
|
!$acc loop vector(vector_size)
|
|
|
|
do i = 1, N
|
|
|
|
a(i) = 3.14
|
|
|
|
end do
|
|
|
|
!$acc end parallel
|
|
|
|
|
|
|
|
!$acc parallel
|
|
|
|
!$acc loop vector(length: vector_size)
|
|
|
|
do i = 1, N
|
|
|
|
a(i) = 3.14
|
|
|
|
end do
|
|
|
|
!$acc end parallel
|
|
|
|
|
|
|
|
!$acc parallel
|
|
|
|
!$acc loop worker
|
|
|
|
do i = 1, N
|
|
|
|
a(i) = 3.14
|
|
|
|
end do
|
|
|
|
!$acc end parallel
|
|
|
|
|
|
|
|
!$acc parallel
|
|
|
|
!$acc loop worker(10)
|
|
|
|
do i = 1, N
|
|
|
|
a(i) = 3.14
|
|
|
|
end do
|
|
|
|
!$acc end parallel
|
|
|
|
|
|
|
|
!$acc parallel
|
|
|
|
!$acc loop worker(worker_size)
|
|
|
|
do i = 1, N
|
|
|
|
a(i) = 3.14
|
|
|
|
end do
|
|
|
|
!$acc end parallel
|
|
|
|
|
|
|
|
!$acc parallel
|
|
|
|
!$acc loop worker(num: worker_size)
|
|
|
|
do i = 1, N
|
|
|
|
a(i) = 3.14
|
|
|
|
end do
|
|
|
|
!$acc end parallel
|
|
|
|
|
|
|
|
!$acc parallel
|
|
|
|
!$acc loop gang(gang_size)
|
|
|
|
do i = 1, N
|
|
|
|
a(i) = 3.14
|
|
|
|
end do
|
|
|
|
!$acc end parallel
|
|
|
|
|
|
|
|
!$acc parallel
|
|
|
|
!$acc loop gang(num: gang_size)
|
|
|
|
do i = 1, N
|
|
|
|
a(i) = 3.14
|
|
|
|
end do
|
|
|
|
!$acc end parallel
|
|
|
|
|
|
|
|
!$acc parallel
|
|
|
|
!$acc loop gang(gang_size, static:*)
|
|
|
|
do i = 1, N
|
|
|
|
a(i) = 3.14
|
|
|
|
end do
|
|
|
|
!$acc end parallel
|
|
|
|
|
|
|
|
!$acc parallel
|
|
|
|
!$acc loop gang(num: gang_size, static:*)
|
|
|
|
do i = 1, N
|
|
|
|
a(i) = 3.14
|
|
|
|
end do
|
|
|
|
!$acc end parallel
|
|
|
|
|
|
|
|
!$acc parallel
|
|
|
|
!$acc loop gang(num: gang_size, static: gang_size)
|
|
|
|
do i = 1, N
|
|
|
|
a(i) = 3.14
|
|
|
|
end do
|
|
|
|
!$acc end parallel
|
|
|
|
|
|
|
|
!$acc parallel
|
|
|
|
!$acc loop private(b, a(:))
|
|
|
|
do i = 1, N
|
|
|
|
a(i) = b
|
|
|
|
end do
|
|
|
|
!$acc end parallel
|
|
|
|
|
|
|
|
!$acc parallel
|
|
|
|
!$acc loop tile(*)
|
|
|
|
do i = 1, N
|
|
|
|
a(i) = b
|
|
|
|
end do
|
|
|
|
!$acc end parallel
|
|
|
|
|
|
|
|
!$acc parallel
|
|
|
|
!$acc loop tile(2, 2)
|
|
|
|
do i = 1, N
|
|
|
|
do j = 1, N
|
|
|
|
a(i) = b
|
|
|
|
end do
|
|
|
|
end do
|
|
|
|
!$acc end parallel
|
|
|
|
|
2020-11-21 09:04:54 +08:00
|
|
|
!$acc parallel async
|
|
|
|
!$acc end parallel
|
|
|
|
|
|
|
|
!$acc parallel async(1)
|
|
|
|
!$acc end parallel
|
|
|
|
|
|
|
|
!$acc parallel async(async1)
|
|
|
|
!$acc end parallel
|
|
|
|
|
|
|
|
!$acc parallel wait
|
|
|
|
!$acc end parallel
|
|
|
|
|
|
|
|
!$acc parallel wait(1)
|
|
|
|
!$acc end parallel
|
|
|
|
|
|
|
|
!$acc parallel wait(wait1)
|
|
|
|
!$acc end parallel
|
|
|
|
|
|
|
|
!$acc parallel wait(1,2)
|
|
|
|
!$acc end parallel
|
|
|
|
|
|
|
|
!$acc parallel wait(wait1, wait2)
|
|
|
|
!$acc end parallel
|
|
|
|
|
|
|
|
!$acc parallel num_gangs(8)
|
|
|
|
!$acc end parallel
|
|
|
|
|
|
|
|
!$acc parallel num_workers(8)
|
|
|
|
!$acc end parallel
|
|
|
|
|
|
|
|
!$acc parallel vector_length(128)
|
|
|
|
!$acc end parallel
|
|
|
|
|
|
|
|
!$acc parallel if(.true.)
|
|
|
|
!$acc end parallel
|
|
|
|
|
|
|
|
!$acc parallel if(ifCondition)
|
|
|
|
!$acc end parallel
|
|
|
|
|
|
|
|
!$acc parallel self
|
|
|
|
!$acc end parallel
|
|
|
|
|
|
|
|
!$acc parallel self(.true.)
|
|
|
|
!$acc end parallel
|
|
|
|
|
|
|
|
!$acc parallel self(ifCondition)
|
|
|
|
!$acc end parallel
|
|
|
|
|
|
|
|
!$acc parallel copy(aa) copyin(bb) copyout(cc)
|
|
|
|
!$acc end parallel
|
|
|
|
|
|
|
|
!$acc parallel copy(aa, bb) copyout(zero: cc)
|
|
|
|
!$acc end parallel
|
|
|
|
|
|
|
|
!$acc parallel present(aa, bb) create(cc)
|
|
|
|
!$acc end parallel
|
|
|
|
|
|
|
|
!$acc parallel copyin(readonly: aa, bb) create(zero: cc)
|
|
|
|
!$acc end parallel
|
|
|
|
|
|
|
|
!$acc parallel deviceptr(aa, bb) no_create(cc)
|
|
|
|
!$acc end parallel
|
|
|
|
|
|
|
|
!$acc parallel attach(aa, bb, cc)
|
|
|
|
!$acc end parallel
|
|
|
|
|
|
|
|
!$acc parallel private(aa) firstprivate(bb, cc)
|
|
|
|
!$acc end parallel
|
|
|
|
|
|
|
|
!$acc parallel default(none)
|
|
|
|
!$acc end parallel
|
|
|
|
|
|
|
|
!$acc parallel default(present)
|
|
|
|
!$acc end parallel
|
|
|
|
|
|
|
|
!$acc parallel device_type(*)
|
|
|
|
!$acc end parallel
|
|
|
|
|
|
|
|
!$acc parallel device_type(1)
|
|
|
|
!$acc end parallel
|
|
|
|
|
|
|
|
!$acc parallel device_type(1, 3)
|
|
|
|
!$acc end parallel
|
|
|
|
|
|
|
|
!ERROR: Clause PRIVATE is not allowed after clause DEVICE_TYPE on the PARALLEL directive
|
|
|
|
!ERROR: Clause FIRSTPRIVATE is not allowed after clause DEVICE_TYPE on the PARALLEL directive
|
|
|
|
!$acc parallel device_type(*) private(aa) firstprivate(bb)
|
|
|
|
!$acc end parallel
|
|
|
|
|
|
|
|
!$acc parallel device_type(*) async
|
|
|
|
!$acc end parallel
|
|
|
|
|
|
|
|
!$acc parallel device_type(*) wait
|
|
|
|
!$acc end parallel
|
|
|
|
|
|
|
|
!$acc parallel device_type(*) num_gangs(8)
|
|
|
|
!$acc end parallel
|
|
|
|
|
|
|
|
!$acc parallel device_type(1) async device_type(2) wait
|
|
|
|
!$acc end parallel
|
|
|
|
|
[flang][openacc] OpenACC 3.0 parser
Summary:
This patch introduce the parser for OpenACC 3.0 in Flang. It uses the same TableGen mechanism
than OpenMP.
Reviewers: nvdatian, sscalpone, tskeith, klausler, ichoyjx, jdoerfert, DavidTruby
Reviewed By: klausler
Subscribers: MaskRay, SouraVX, mgorny, hiraditya, jfb, sstefan1, llvm-commits
Tags: #llvm, #flang
Differential Revision: https://reviews.llvm.org/D83649
2020-07-15 02:28:34 +08:00
|
|
|
!$acc parallel
|
2020-08-06 02:20:26 +08:00
|
|
|
!ERROR: The parameter of the COLLAPSE clause must be a constant positive integer expression
|
[flang][openacc] OpenACC 3.0 parser
Summary:
This patch introduce the parser for OpenACC 3.0 in Flang. It uses the same TableGen mechanism
than OpenMP.
Reviewers: nvdatian, sscalpone, tskeith, klausler, ichoyjx, jdoerfert, DavidTruby
Reviewed By: klausler
Subscribers: MaskRay, SouraVX, mgorny, hiraditya, jfb, sstefan1, llvm-commits
Tags: #llvm, #flang
Differential Revision: https://reviews.llvm.org/D83649
2020-07-15 02:28:34 +08:00
|
|
|
!$acc loop collapse(-1)
|
|
|
|
do i = 1, N
|
|
|
|
do j = 1, N
|
|
|
|
a(i) = 3.14 + j
|
|
|
|
end do
|
|
|
|
end do
|
|
|
|
!$acc end parallel
|
|
|
|
|
|
|
|
!$acc parallel
|
2020-07-15 08:43:40 +08:00
|
|
|
!ERROR: Clause PRIVATE is not allowed after clause DEVICE_TYPE on the LOOP directive
|
[flang][openacc] OpenACC 3.0 parser
Summary:
This patch introduce the parser for OpenACC 3.0 in Flang. It uses the same TableGen mechanism
than OpenMP.
Reviewers: nvdatian, sscalpone, tskeith, klausler, ichoyjx, jdoerfert, DavidTruby
Reviewed By: klausler
Subscribers: MaskRay, SouraVX, mgorny, hiraditya, jfb, sstefan1, llvm-commits
Tags: #llvm, #flang
Differential Revision: https://reviews.llvm.org/D83649
2020-07-15 02:28:34 +08:00
|
|
|
!$acc loop device_type(*) private(i)
|
|
|
|
do i = 1, N
|
|
|
|
a(i) = 3.14
|
|
|
|
end do
|
|
|
|
!$acc end parallel
|
|
|
|
|
|
|
|
!$acc parallel
|
2020-07-15 08:43:40 +08:00
|
|
|
!ERROR: Clause GANG is not allowed if clause SEQ appears on the LOOP directive
|
[flang][openacc] OpenACC 3.0 parser
Summary:
This patch introduce the parser for OpenACC 3.0 in Flang. It uses the same TableGen mechanism
than OpenMP.
Reviewers: nvdatian, sscalpone, tskeith, klausler, ichoyjx, jdoerfert, DavidTruby
Reviewed By: klausler
Subscribers: MaskRay, SouraVX, mgorny, hiraditya, jfb, sstefan1, llvm-commits
Tags: #llvm, #flang
Differential Revision: https://reviews.llvm.org/D83649
2020-07-15 02:28:34 +08:00
|
|
|
!$acc loop gang seq
|
|
|
|
do i = 1, N
|
|
|
|
a(i) = 3.14
|
|
|
|
end do
|
|
|
|
!$acc end parallel
|
|
|
|
|
2020-07-15 08:43:40 +08:00
|
|
|
!ERROR: Clause IF is not allowed after clause DEVICE_TYPE on the PARALLEL directive
|
[flang][openacc] OpenACC 3.0 parser
Summary:
This patch introduce the parser for OpenACC 3.0 in Flang. It uses the same TableGen mechanism
than OpenMP.
Reviewers: nvdatian, sscalpone, tskeith, klausler, ichoyjx, jdoerfert, DavidTruby
Reviewed By: klausler
Subscribers: MaskRay, SouraVX, mgorny, hiraditya, jfb, sstefan1, llvm-commits
Tags: #llvm, #flang
Differential Revision: https://reviews.llvm.org/D83649
2020-07-15 02:28:34 +08:00
|
|
|
!$acc parallel device_type(*) if(.TRUE.)
|
|
|
|
!$acc loop
|
|
|
|
do i = 1, N
|
|
|
|
a(i) = 3.14
|
|
|
|
end do
|
|
|
|
!$acc end parallel
|
|
|
|
|
2020-07-15 08:43:40 +08:00
|
|
|
!ERROR: Clause IF is not allowed after clause DEVICE_TYPE on the PARALLEL LOOP directive
|
[flang][openacc] OpenACC 3.0 parser
Summary:
This patch introduce the parser for OpenACC 3.0 in Flang. It uses the same TableGen mechanism
than OpenMP.
Reviewers: nvdatian, sscalpone, tskeith, klausler, ichoyjx, jdoerfert, DavidTruby
Reviewed By: klausler
Subscribers: MaskRay, SouraVX, mgorny, hiraditya, jfb, sstefan1, llvm-commits
Tags: #llvm, #flang
Differential Revision: https://reviews.llvm.org/D83649
2020-07-15 02:28:34 +08:00
|
|
|
!$acc parallel loop device_type(*) if(.TRUE.)
|
|
|
|
do i = 1, N
|
|
|
|
a(i) = 3.14
|
|
|
|
end do
|
|
|
|
!$acc end parallel loop
|
|
|
|
|
|
|
|
!$acc serial device_type(*) async
|
|
|
|
do i = 1, N
|
|
|
|
a(i) = 3.14
|
|
|
|
end do
|
|
|
|
!$acc end serial
|
|
|
|
|
2020-07-15 08:43:40 +08:00
|
|
|
!ERROR: Clause IF is not allowed after clause DEVICE_TYPE on the SERIAL directive
|
[flang][openacc] OpenACC 3.0 parser
Summary:
This patch introduce the parser for OpenACC 3.0 in Flang. It uses the same TableGen mechanism
than OpenMP.
Reviewers: nvdatian, sscalpone, tskeith, klausler, ichoyjx, jdoerfert, DavidTruby
Reviewed By: klausler
Subscribers: MaskRay, SouraVX, mgorny, hiraditya, jfb, sstefan1, llvm-commits
Tags: #llvm, #flang
Differential Revision: https://reviews.llvm.org/D83649
2020-07-15 02:28:34 +08:00
|
|
|
!$acc serial device_type(*) if(.TRUE.)
|
|
|
|
do i = 1, N
|
|
|
|
a(i) = 3.14
|
|
|
|
end do
|
|
|
|
!$acc end serial
|
|
|
|
|
2020-07-15 08:43:40 +08:00
|
|
|
!ERROR: Clause IF is not allowed after clause DEVICE_TYPE on the SERIAL LOOP directive
|
[flang][openacc] OpenACC 3.0 parser
Summary:
This patch introduce the parser for OpenACC 3.0 in Flang. It uses the same TableGen mechanism
than OpenMP.
Reviewers: nvdatian, sscalpone, tskeith, klausler, ichoyjx, jdoerfert, DavidTruby
Reviewed By: klausler
Subscribers: MaskRay, SouraVX, mgorny, hiraditya, jfb, sstefan1, llvm-commits
Tags: #llvm, #flang
Differential Revision: https://reviews.llvm.org/D83649
2020-07-15 02:28:34 +08:00
|
|
|
!$acc serial loop device_type(*) if(.TRUE.)
|
|
|
|
do i = 1, N
|
|
|
|
a(i) = 3.14
|
|
|
|
end do
|
|
|
|
!$acc end serial loop
|
|
|
|
|
2020-08-14 02:04:43 +08:00
|
|
|
!$acc parallel loop
|
|
|
|
do i = 1, N
|
|
|
|
a(i) = 3.14
|
|
|
|
end do
|
|
|
|
!ERROR: Unmatched END KERNELS LOOP directive
|
|
|
|
!$acc end kernels loop
|
|
|
|
|
|
|
|
!$acc kernels loop
|
|
|
|
do i = 1, N
|
|
|
|
a(i) = 3.14
|
|
|
|
end do
|
|
|
|
!ERROR: Unmatched END SERIAL LOOP directive
|
|
|
|
!$acc end serial loop
|
|
|
|
|
|
|
|
!$acc serial loop
|
|
|
|
do i = 1, N
|
|
|
|
a(i) = 3.14
|
|
|
|
end do
|
|
|
|
!ERROR: Unmatched END PARALLEL LOOP directive
|
|
|
|
!$acc end parallel loop
|
|
|
|
|
2020-08-25 02:22:34 +08:00
|
|
|
!$acc parallel loop reduction(+: reduction_r)
|
|
|
|
do i = 1, N
|
|
|
|
reduction_r = a(i) + i
|
|
|
|
end do
|
|
|
|
|
|
|
|
!$acc parallel loop reduction(*: reduction_r)
|
|
|
|
do i = 1, N
|
|
|
|
reduction_r = reduction_r * (a(i) + i)
|
|
|
|
end do
|
|
|
|
|
|
|
|
!$acc parallel loop reduction(min: reduction_r)
|
|
|
|
do i = 1, N
|
|
|
|
reduction_r = min(reduction_r, a(i) * i)
|
|
|
|
end do
|
|
|
|
|
|
|
|
!$acc parallel loop reduction(max: reduction_r)
|
|
|
|
do i = 1, N
|
|
|
|
reduction_r = max(reduction_r, a(i) * i)
|
|
|
|
end do
|
|
|
|
|
|
|
|
!$acc parallel loop reduction(iand: b)
|
|
|
|
do i = 1, N
|
|
|
|
b = iand(b, c(i))
|
|
|
|
end do
|
|
|
|
|
|
|
|
!$acc parallel loop reduction(ior: b)
|
|
|
|
do i = 1, N
|
|
|
|
b = ior(b, c(i))
|
|
|
|
end do
|
|
|
|
|
|
|
|
!$acc parallel loop reduction(ieor: b)
|
|
|
|
do i = 1, N
|
|
|
|
b = ieor(b, c(i))
|
|
|
|
end do
|
|
|
|
|
|
|
|
!$acc parallel loop reduction(.and.: reduction_l)
|
|
|
|
do i = 1, N
|
|
|
|
reduction_l = d(i) .and. e(i)
|
|
|
|
end do
|
|
|
|
|
|
|
|
!$acc parallel loop reduction(.or.: reduction_l)
|
|
|
|
do i = 1, N
|
|
|
|
reduction_l = d(i) .or. e(i)
|
|
|
|
end do
|
|
|
|
|
|
|
|
!$acc parallel loop reduction(.eqv.: reduction_l)
|
|
|
|
do i = 1, N
|
|
|
|
reduction_l = d(i) .eqv. e(i)
|
|
|
|
end do
|
|
|
|
|
|
|
|
!$acc parallel loop reduction(.neqv.: reduction_l)
|
|
|
|
do i = 1, N
|
|
|
|
reduction_l = d(i) .neqv. e(i)
|
|
|
|
end do
|
|
|
|
|
2020-12-08 03:26:50 +08:00
|
|
|
!$acc kernels async
|
|
|
|
!$acc end kernels
|
|
|
|
|
|
|
|
!$acc kernels async(1)
|
|
|
|
!$acc end kernels
|
|
|
|
|
|
|
|
!$acc kernels async(async1)
|
|
|
|
!$acc end kernels
|
|
|
|
|
|
|
|
!$acc kernels wait(wait1)
|
|
|
|
!$acc end kernels
|
|
|
|
|
|
|
|
!$acc kernels wait(wait1, wait2)
|
|
|
|
!$acc end kernels
|
|
|
|
|
2020-08-24 08:01:10 +08:00
|
|
|
!$acc kernels wait(1, 2) async(3)
|
|
|
|
!$acc end kernels
|
|
|
|
|
|
|
|
!$acc kernels wait(queues: 1, 2) async(3)
|
|
|
|
!$acc end kernels
|
|
|
|
|
2020-12-08 03:26:50 +08:00
|
|
|
!$acc kernels wait(1) wait(2) async(3)
|
|
|
|
!$acc end kernels
|
|
|
|
|
2020-08-24 08:01:10 +08:00
|
|
|
!$acc kernels wait(devnum: 1: 1, 2) async(3)
|
|
|
|
!$acc end kernels
|
|
|
|
|
|
|
|
!$acc kernels wait(devnum: 1: queues: 1, 2) async(3)
|
|
|
|
!$acc end kernels
|
|
|
|
|
2020-12-08 03:26:50 +08:00
|
|
|
!$acc kernels num_gangs(8)
|
|
|
|
!$acc end kernels
|
|
|
|
|
|
|
|
!$acc kernels num_workers(8)
|
|
|
|
!$acc end kernels
|
|
|
|
|
|
|
|
!$acc kernels vector_length(128)
|
|
|
|
!$acc end kernels
|
|
|
|
|
|
|
|
!$acc kernels if(.true.)
|
|
|
|
!$acc end kernels
|
|
|
|
|
|
|
|
!$acc kernels if(ifCondition)
|
|
|
|
!$acc end kernels
|
|
|
|
|
|
|
|
!ERROR: At most one IF clause can appear on the KERNELS directive
|
|
|
|
!$acc kernels if(.true.) if(ifCondition)
|
|
|
|
!$acc end kernels
|
|
|
|
|
|
|
|
!$acc kernels self
|
|
|
|
!$acc end kernels
|
|
|
|
|
|
|
|
!$acc kernels self(.true.)
|
|
|
|
!$acc end kernels
|
|
|
|
|
|
|
|
!$acc kernels self(ifCondition)
|
|
|
|
!$acc end kernels
|
|
|
|
|
|
|
|
!$acc kernels copy(aa) copyin(bb) copyout(cc)
|
|
|
|
!$acc end kernels
|
|
|
|
|
|
|
|
!$acc kernels copy(aa, bb) copyout(zero: cc)
|
|
|
|
!$acc end kernels
|
|
|
|
|
|
|
|
!$acc kernels present(aa, bb) create(cc)
|
|
|
|
!$acc end kernels
|
|
|
|
|
|
|
|
!$acc kernels copyin(readonly: aa, bb) create(zero: cc)
|
|
|
|
!$acc end kernels
|
|
|
|
|
|
|
|
!$acc kernels deviceptr(aa, bb) no_create(cc)
|
|
|
|
!$acc end kernels
|
|
|
|
|
|
|
|
!$acc kernels attach(aa, bb, cc)
|
|
|
|
!$acc end kernels
|
|
|
|
|
|
|
|
!ERROR: PRIVATE clause is not allowed on the KERNELS directive
|
|
|
|
!$acc kernels private(aa, bb, cc)
|
|
|
|
!$acc end kernels
|
|
|
|
|
|
|
|
!$acc kernels default(none)
|
|
|
|
!$acc end kernels
|
|
|
|
|
|
|
|
!$acc kernels default(present)
|
|
|
|
!$acc end kernels
|
|
|
|
|
|
|
|
!ERROR: At most one DEFAULT clause can appear on the KERNELS directive
|
|
|
|
!$acc kernels default(none) default(present)
|
|
|
|
!$acc end kernels
|
|
|
|
|
|
|
|
!$acc kernels device_type(*)
|
|
|
|
!$acc end kernels
|
|
|
|
|
|
|
|
!$acc kernels device_type(1)
|
|
|
|
!$acc end kernels
|
|
|
|
|
|
|
|
!$acc kernels device_type(1, 3)
|
|
|
|
!$acc end kernels
|
|
|
|
|
|
|
|
!$acc kernels device_type(*) async wait num_gangs(8) num_workers(8) vector_length(128)
|
|
|
|
!$acc end kernels
|
|
|
|
|
|
|
|
!$acc kernels device_type(*) async
|
|
|
|
do i = 1, N
|
|
|
|
a(i) = 3.14
|
|
|
|
end do
|
|
|
|
!$acc end kernels
|
|
|
|
|
|
|
|
!ERROR: Clause IF is not allowed after clause DEVICE_TYPE on the KERNELS directive
|
|
|
|
!$acc kernels device_type(*) if(.TRUE.)
|
|
|
|
do i = 1, N
|
|
|
|
a(i) = 3.14
|
|
|
|
end do
|
|
|
|
!$acc end kernels
|
|
|
|
|
|
|
|
!ERROR: Clause IF is not allowed after clause DEVICE_TYPE on the KERNELS LOOP directive
|
|
|
|
!$acc kernels loop device_type(*) if(.TRUE.)
|
|
|
|
do i = 1, N
|
|
|
|
a(i) = 3.14
|
|
|
|
end do
|
|
|
|
!$acc end kernels loop
|
|
|
|
|
2020-10-23 22:31:33 +08:00
|
|
|
!$acc wait
|
|
|
|
|
|
|
|
!$acc wait async
|
|
|
|
|
2020-08-24 08:01:10 +08:00
|
|
|
!$acc wait(1)
|
|
|
|
!$acc wait(1, 2)
|
|
|
|
|
|
|
|
!$acc wait(queues: 1)
|
|
|
|
!$acc wait(queues: 1, 2)
|
|
|
|
|
|
|
|
!$acc wait(devnum: 1: 3)
|
|
|
|
!$acc wait(devnum: 1: 3, 4)
|
|
|
|
|
|
|
|
!$acc wait(devnum: 1: queues: 3)
|
|
|
|
!$acc wait(devnum: 1: queues: 3, 4)
|
|
|
|
|
2020-10-23 22:31:33 +08:00
|
|
|
!$acc wait(1) if(.true.)
|
|
|
|
|
|
|
|
!ERROR: At most one IF clause can appear on the WAIT directive
|
|
|
|
!$acc wait(1) if(.true.) if(.false.)
|
|
|
|
|
|
|
|
!$acc wait(1) if(.true.) async
|
|
|
|
|
|
|
|
!$acc wait(1) if(.true.) async(1)
|
|
|
|
|
|
|
|
!ERROR: At most one ASYNC clause can appear on the WAIT directive
|
|
|
|
!$acc wait(1) if(.true.) async(1) async
|
|
|
|
|
|
|
|
!$acc parallel
|
|
|
|
!$acc atomic update
|
|
|
|
c(i) = c(i) + 1
|
|
|
|
|
|
|
|
!$acc atomic update
|
|
|
|
c(i) = c(i) + 1
|
|
|
|
!$acc end atomic
|
|
|
|
|
|
|
|
!$acc atomic write
|
|
|
|
c(i) = 10
|
|
|
|
|
|
|
|
!$acc atomic write
|
|
|
|
c(i) = 10
|
|
|
|
!$acc end atomic
|
|
|
|
|
|
|
|
!$acc atomic read
|
|
|
|
i = c(i)
|
|
|
|
|
|
|
|
!$acc atomic read
|
|
|
|
i = c(i)
|
|
|
|
!$acc end atomic
|
|
|
|
|
|
|
|
!$acc atomic capture
|
|
|
|
c(i) = i
|
|
|
|
i = i + 1
|
|
|
|
!$acc end atomic
|
|
|
|
!$acc end parallel
|
2020-11-25 23:28:02 +08:00
|
|
|
t%arr(i) = 2.0
|
|
|
|
|
|
|
|
!$acc cache(a(i))
|
|
|
|
!$acc cache(a(1:2,3:4))
|
|
|
|
!$acc cache(a)
|
|
|
|
!$acc cache(readonly: a, aa)
|
|
|
|
!$acc cache(readonly: a(i), aa(i, i))
|
|
|
|
!$acc cache(t%arr)
|
|
|
|
!$acc cache(ta(1:2)%arr)
|
|
|
|
!$acc cache(ta(1:2)%arr(1:4))
|
|
|
|
|
|
|
|
!ERROR: Only array element or subarray are allowed in CACHE directive
|
|
|
|
!$acc cache(ta(1:2)%s)
|
|
|
|
|
|
|
|
!ERROR: Only array element or subarray are allowed in CACHE directive
|
|
|
|
!$acc cache(i)
|
|
|
|
|
|
|
|
!ERROR: Only array element or subarray are allowed in CACHE directive
|
|
|
|
!$acc cache(t%s)
|
|
|
|
|
|
|
|
!ERROR: Only array element or subarray are allowed in CACHE directive
|
|
|
|
!$acc cache(/i/)
|
2020-10-23 22:31:33 +08:00
|
|
|
|
[flang][openacc] OpenACC 3.0 parser
Summary:
This patch introduce the parser for OpenACC 3.0 in Flang. It uses the same TableGen mechanism
than OpenMP.
Reviewers: nvdatian, sscalpone, tskeith, klausler, ichoyjx, jdoerfert, DavidTruby
Reviewed By: klausler
Subscribers: MaskRay, SouraVX, mgorny, hiraditya, jfb, sstefan1, llvm-commits
Tags: #llvm, #flang
Differential Revision: https://reviews.llvm.org/D83649
2020-07-15 02:28:34 +08:00
|
|
|
contains
|
|
|
|
|
|
|
|
subroutine sub1(a)
|
|
|
|
real :: a(:)
|
2020-07-15 08:43:40 +08:00
|
|
|
!ERROR: At least one of GANG, SEQ, VECTOR, WORKER clause must appear on the ROUTINE directive
|
[flang][openacc] OpenACC 3.0 parser
Summary:
This patch introduce the parser for OpenACC 3.0 in Flang. It uses the same TableGen mechanism
than OpenMP.
Reviewers: nvdatian, sscalpone, tskeith, klausler, ichoyjx, jdoerfert, DavidTruby
Reviewed By: klausler
Subscribers: MaskRay, SouraVX, mgorny, hiraditya, jfb, sstefan1, llvm-commits
Tags: #llvm, #flang
Differential Revision: https://reviews.llvm.org/D83649
2020-07-15 02:28:34 +08:00
|
|
|
!$acc routine
|
|
|
|
end subroutine sub1
|
|
|
|
|
|
|
|
subroutine sub2(a)
|
|
|
|
real :: a(:)
|
2020-07-15 08:43:40 +08:00
|
|
|
!ERROR: Clause NOHOST is not allowed after clause DEVICE_TYPE on the ROUTINE directive
|
[flang][openacc] OpenACC 3.0 parser
Summary:
This patch introduce the parser for OpenACC 3.0 in Flang. It uses the same TableGen mechanism
than OpenMP.
Reviewers: nvdatian, sscalpone, tskeith, klausler, ichoyjx, jdoerfert, DavidTruby
Reviewed By: klausler
Subscribers: MaskRay, SouraVX, mgorny, hiraditya, jfb, sstefan1, llvm-commits
Tags: #llvm, #flang
Differential Revision: https://reviews.llvm.org/D83649
2020-07-15 02:28:34 +08:00
|
|
|
!$acc routine seq device_type(*) nohost
|
|
|
|
end subroutine sub2
|
|
|
|
|
2020-07-15 08:43:40 +08:00
|
|
|
end program openacc_clause_validity
|