| 1 |
! REQUIRES: plugins, examples, shell |
| 2 |
|
| 3 |
!RUN: %flang_fc1 -load %llvmshlibdir/flangOmpReport.so -plugin flang-omp-report -fopenmp %s -o - | FileCheck %s |
| 4 |
|
| 5 |
! Check OpenMP clause validity for the following directives: |
| 6 |
! 2.10 Device constructs |
| 7 |
program main |
| 8 |
|
| 9 |
real(8) :: arrayA(256), arrayB(256) |
| 10 |
integer :: N |
| 11 |
|
| 12 |
arrayA = 1.414 |
| 13 |
arrayB = 3.14 |
| 14 |
N = 256 |
| 15 |
|
| 16 |
!$omp target map(arrayA) |
| 17 |
do i = 1, N |
| 18 |
a = 3.14 |
| 19 |
enddo |
| 20 |
!$omp end target |
| 21 |
|
| 22 |
!$omp target device(0) |
| 23 |
do i = 1, N |
| 24 |
a = 3.14 |
| 25 |
enddo |
| 26 |
!$omp end target |
| 27 |
|
| 28 |
!$omp target defaultmap(tofrom:scalar) |
| 29 |
do i = 1, N |
| 30 |
a = 3.14 |
| 31 |
enddo |
| 32 |
!$omp end target |
| 33 |
|
| 34 |
!$omp teams num_teams(3) thread_limit(10) default(shared) private(i) shared(a) |
| 35 |
do i = 1, N |
| 36 |
a = 3.14 |
| 37 |
enddo |
| 38 |
!$omp end teams |
| 39 |
|
| 40 |
!$omp target map(tofrom:a) |
| 41 |
do i = 1, N |
| 42 |
a = 3.14 |
| 43 |
enddo |
| 44 |
!$omp end target |
| 45 |
|
| 46 |
!$omp target data device(0) map(to:a) |
| 47 |
do i = 1, N |
| 48 |
a = 3.14 |
| 49 |
enddo |
| 50 |
!$omp end target data |
| 51 |
|
| 52 |
end program main |
| 53 |
|
| 54 |
! CHECK: --- |
| 55 |
! CHECK-NEXT: - file: '{{[^"]*}}omp-device-constructs.f90' |
| 56 |
! CHECK-NEXT: line: 16 |
| 57 |
! CHECK-NEXT: construct: target |
| 58 |
! CHECK-NEXT: clauses: |
| 59 |
! CHECK-NEXT: - clause: map |
| 60 |
! CHECK-NEXT: details: arraya |
| 61 |
! CHECK-NEXT: - file: '{{[^"]*}}omp-device-constructs.f90' |
| 62 |
! CHECK-NEXT: line: 22 |
| 63 |
! CHECK-NEXT: construct: target |
| 64 |
! CHECK-NEXT: clauses: |
| 65 |
! CHECK-NEXT: - clause: device |
| 66 |
! CHECK-NEXT: details: '0' |
| 67 |
! CHECK-NEXT: - file: '{{[^"]*}}omp-device-constructs.f90' |
| 68 |
! CHECK-NEXT: line: 28 |
| 69 |
! CHECK-NEXT: construct: target |
| 70 |
! CHECK-NEXT: clauses: |
| 71 |
! CHECK-NEXT: - clause: defaultmap |
| 72 |
! CHECK-NEXT: details: 'tofrom:scalar' |
| 73 |
! CHECK-NEXT: - file: '{{[^"]*}}omp-device-constructs.f90' |
| 74 |
! CHECK-NEXT: line: 34 |
| 75 |
! CHECK-NEXT: construct: teams |
| 76 |
! CHECK-NEXT: clauses: |
| 77 |
! CHECK-NEXT: - clause: default |
| 78 |
! CHECK-NEXT: details: shared |
| 79 |
! CHECK-NEXT: - clause: num_teams |
| 80 |
! CHECK-NEXT: details: '3' |
| 81 |
! CHECK-NEXT: - clause: private |
| 82 |
! CHECK-NEXT: details: i |
| 83 |
! CHECK-NEXT: - clause: shared |
| 84 |
! CHECK-NEXT: details: a |
| 85 |
! CHECK-NEXT: - clause: thread_limit |
| 86 |
! CHECK-NEXT: details: '10' |
| 87 |
! CHECK-NEXT: - file: '{{[^"]*}}omp-device-constructs.f90' |
| 88 |
! CHECK-NEXT: line: 40 |
| 89 |
! CHECK-NEXT: construct: target |
| 90 |
! CHECK-NEXT: clauses: |
| 91 |
! CHECK-NEXT: - clause: map |
| 92 |
! CHECK-NEXT: details: 'tofrom:a' |
| 93 |
! CHECK-NEXT: - file: '{{[^"]*}}omp-device-constructs.f90' |
| 94 |
! CHECK-NEXT: line: 46 |
| 95 |
! CHECK-NEXT: construct: target data |
| 96 |
! CHECK-NEXT: clauses: |
| 97 |
! CHECK-NEXT: - clause: device |
| 98 |
! CHECK-NEXT: details: '0' |
| 99 |
! CHECK-NEXT: - clause: map |
| 100 |
! CHECK-NEXT: details: 'to:a' |
| 101 |
! CHECK-NEXT: ... |