Debian Codegraph @

gcc/testsuite/gfortran.dg/gomp/target-device-ancestor-2a.f90

raw
1 ! { dg-do compile }
2
3 implicit none
4
5 integer :: a, b, c
6
7 !$omp requires reverse_offload
8
9 !$omp target device (ancestor: 1)
10 !$omp end target
11
12 !$omp target device (ancestor : a)
13 !$omp end target
14
15 !$omp target device (ancestor : a + 1)
16 !$omp end target
17
18
19 !$omp target device (device_num:42)
20 !$omp end target
21
22 !$omp target device (42)
23 !$omp end target
24
25
26 ! Ensure that no OpenMP constructs appear inside target regions with 'ancestor'.
27
28 !$omp target device (ancestor: 1)
29 !$omp teams ! { dg-error "OpenMP constructs are not allowed in target region with 'ancestor'" }
30 !$omp end teams
31 !$omp end target
32
33 !$omp target device (device_num: 1)
34 !$omp teams
35 !$omp end teams
36 !$omp end target
37
38 !$omp target device (1)
39 !$omp teams
40 !$omp end teams
41 !$omp end target
42
43
44 ! Ensure that with 'ancestor' only the 'device', 'firstprivate', 'private',
45 ! 'defaultmap', and 'map' clauses appear on the construct.
46
47 !$omp target nowait device (ancestor: 1) ! { dg-error "with 'ancestor', only the 'device', 'firstprivate', 'private', 'defaultmap', and 'map' clauses may appear on the construct" }
48 !$omp end target
49
50 !$omp target device (ancestor: 1) nowait ! { dg-error "with 'ancestor', only the 'device', 'firstprivate', 'private', 'defaultmap', and 'map' clauses may appear on the construct" }
51 !$omp end target
52
53 !$omp target nowait device (device_num: 1)
54 !$omp end target
55
56 !$omp target nowait device (1)
57 !$omp end target
58
59 !$omp target device (ancestor: 1) firstprivate (a) private (b) defaultmap (none) map (c)
60 !$omp end target
61
62
63 ! Ensure that 'ancestor' is only used with 'target' constructs (not with
64 ! 'target data', 'target update' etc.).
65 ! The following test case is marked with 'xfail' because a previous 'sorry' from
66 ! 'reverse_offload' suppresses the 'sorry' for 'ancestor'.
67
68 !$omp target data map (a) device (ancestor: 1) ! { dg-error "'device' clause with 'ancestor' is only allowed on 'target' construct" }
69 !$omp end target data
70
71 !$omp target enter data map (to: a) device (ancestor: 1) ! { dg-error "'device' clause with 'ancestor' is only allowed on 'target' construct" }
72 !$omp target exit data map (from: a) device (ancestor: 1) ! { dg-error "'device' clause with 'ancestor' is only allowed on 'target' construct" }
73
74 !$omp target update to (a) device (ancestor: 1) ! { dg-error "'device' clause with 'ancestor' is only allowed on 'target' construct" }
75
76 !$omp target device (ancestor: 1) if(.false.)
77 ! { dg-error "with 'ancestor', only the 'device', 'firstprivate', 'private', 'defaultmap', and 'map' clauses may appear on the construct" "" { target *-*-* } .-1 }
78 !$omp end target
79
80 end