File: wsloop-nonmonotonic.f90

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (36 lines) | stat: -rw-r--r-- 1,241 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
! This test checks lowering of OpenMP DO Directive(Worksharing) with
! non-monotonic schedule modifier.

! RUN: bbc -fopenmp -emit-fir %s -o - | FileCheck %s

program wsloop_dynamic
  integer :: i
!CHECK-LABEL: func @_QQmain()


!$OMP PARALLEL
!CHECK:  omp.parallel {

!$OMP DO SCHEDULE(nonmonotonic:dynamic)
!CHECK:     %[[ALLOCA_IV:.*]] = fir.alloca i32 {{{.*}}, pinned}
!CHECK:     %[[WS_LB:.*]] = arith.constant 1 : i32
!CHECK:     %[[WS_UB:.*]] = arith.constant 9 : i32
!CHECK:     %[[WS_STEP:.*]] = arith.constant 1 : i32
!CHECK:     omp.wsloop schedule(dynamic, nonmonotonic) nowait for (%[[I:.*]]) : i32 = (%[[WS_LB]]) to (%[[WS_UB]]) inclusive step (%[[WS_STEP]])
!CHECK:       fir.store %[[I]] to %[[ALLOCA_IV]] : !fir.ref<i32>

  do i=1, 9
    print*, i
!CHECK:    %[[RTBEGIN:.*]] = fir.call @_FortranAioBeginExternalListOutput
!CHECK:    %[[LOAD:.*]] = fir.load %[[ALLOCA_IV]] : !fir.ref<i32>
!CHECK:    fir.call @_FortranAioOutputInteger32(%[[RTBEGIN]], %[[LOAD]]) {{.*}}: (!fir.ref<i8>, i32) -> i1
!CHECK:    fir.call @_FortranAioEndIoStatement(%[[RTBEGIN]]) {{.*}}: (!fir.ref<i8>) -> i32
  end do
!CHECK:       omp.yield
!CHECK:         }
!CHECK:       omp.terminator
!CHECK:     }

!$OMP END DO NOWAIT
!$OMP END PARALLEL
end