Debian Codegraph @

gcc/testsuite/gfortran.dg/gomp/dispatch-1.f90

raw
1 module main
2 use iso_c_binding, only: c_ptr
3 implicit none
4 contains
5
6 subroutine f1 ()
7 integer :: a, b, arr(10)
8 real :: x
9 complex :: c
10 character :: ch
11 logical :: bool
12 type :: struct
13 integer :: a
14 real :: b
15 end type
16 type(struct) :: s
17 type(c_ptr) :: p
18
19 interface
20 subroutine f0 (a, c, bool, s)
21 import :: struct
22 integer, intent(in) :: a
23 complex, intent(out) :: c
24 logical, intent(inout) :: bool
25 type(struct) :: s
26 end subroutine
27 integer function f2 (arr, x, ch, b)
28 integer, intent(inout) :: arr(:)
29 real, intent(in) :: x
30 character, intent(out) :: ch
31 real :: b
32 end function
33 subroutine f3 (p)
34 import :: c_ptr
35 type(c_ptr) :: p
36 end subroutine
37 integer function f4 ()
38 end function
39 end interface
40
41 !$omp dispatch
42 b = f2(arr, x, ch, s%b)
43 !$omp dispatch
44 c = f2(arr(:5), x * 2.4, ch, s%b)
45 !$omp dispatch
46 arr(1) = f2(arr, x, ch, s%b)
47 !$omp dispatch
48 s%a = f2(arr, x, ch, s%b)
49 !$omp dispatch
50 x = f2(arr, x, ch, s%b)
51 !$omp dispatch
52 call f0(a, c, bool, s)
53 !$omp dispatch
54 call f0(f4(), c, bool, s)
55
56 !$omp dispatch nocontext(.TRUE.)
57 call f0(a, c, bool, s)
58 !$omp dispatch nocontext(arr(2) < 10)
59 call f0(a, c, bool, s)
60 !$omp dispatch novariants(.FALSE.)
61 call f0(a, c, bool, s)
62 !$omp dispatch novariants(bool)
63 call f0(a, c, bool, s)
64 !$omp dispatch nowait
65 call f0(a, c, bool, s)
66 !$omp dispatch device(arr(9))
67 call f0(a, c, bool, s)
68 !$omp dispatch device(a + a)
69 call f0(a, c, bool, s)
70 !$omp dispatch device(-25373654)
71 call f0(a, c, bool, s)
72 !$omp dispatch is_device_ptr(p)
73 call f3(p)
74 !$omp dispatch depend(in: a, c, bool) depend(inout: s, arr(:3))
75 call f0(a, c, bool, s)
76 end subroutine
77 end module