[flang-commits] [flang] 755674b - [flang][openacc] Add clause validity tests for the parallel directive

via flang-commits flang-commits at lists.llvm.org
Fri Nov 20 17:05:17 PST 2020


Author: Valentin Clement
Date: 2020-11-20T20:05:10-05:00
New Revision: 755674b715b1cb1d1d7d2753a6fd42104cf10cb9

URL: https://github.com/llvm/llvm-project/commit/755674b715b1cb1d1d7d2753a6fd42104cf10cb9
DIFF: https://github.com/llvm/llvm-project/commit/755674b715b1cb1d1d7d2753a6fd42104cf10cb9.diff

LOG: [flang][openacc] Add clause validity tests for the parallel directive

Add some clause validity tests for parallel directive.

Reviewed By: sameeranjoshi

Differential Revision: https://reviews.llvm.org/D91871

Added: 
    

Modified: 
    flang/test/Semantics/acc-clause-validity.f90

Removed: 
    


################################################################################
diff  --git a/flang/test/Semantics/acc-clause-validity.f90 b/flang/test/Semantics/acc-clause-validity.f90
index 3bc36cbe78f3..7b3a56ebe25e 100644
--- a/flang/test/Semantics/acc-clause-validity.f90
+++ b/flang/test/Semantics/acc-clause-validity.f90
@@ -25,9 +25,11 @@ program openacc_clause_validity
   integer, parameter :: N = 256
   integer, dimension(N) :: c
   logical, dimension(N) :: d, e
+  integer :: async1
+  integer :: wait1, wait2
   real :: reduction_r
   logical :: reduction_l
-  real(8), dimension(N, N) :: aa
+  real(8), dimension(N, N) :: aa, bb, cc
   logical :: ifCondition = .TRUE.
 
   !ERROR: At least one clause is required on the DECLARE directive
@@ -304,6 +306,107 @@ program openacc_clause_validity
   end do
   !$acc end parallel
 
+  !$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
+
   !$acc parallel
   !ERROR: The parameter of the COLLAPSE clause must be a constant positive integer expression
   !$acc loop collapse(-1)


        


More information about the flang-commits mailing list