Debian Codegraph @

gcc/testsuite/gfortran.dg/gomp/metadirective-no-score.f90

raw
1 ! { dg-do compile { target x86_64-*-* } }
2 ! { dg-additional-options "-foffload=disable" }
3
4 ! This test is expected to fail with compile-time errors:
5 ! "A trait-score cannot be specified in traits from the construct,
6 ! device or target_device trait-selector-sets."
7
8
9 subroutine f1 (n, a, s)
10 implicit none
11 integer :: n
12 double precision :: a(*)
13 double precision :: s
14 integer :: i
15 !$omp metadirective &
16 !$omp& when (device={kind (score(5) : host)} &
17 !$omp& : parallel do)
18 ! { dg-error ".score. cannot be specified in traits in the .device. trait-selector-set" "" { target *-*-*} .-2 }
19 do i = 1, n
20 a(i) = a(i) * s;
21 end do
22 end subroutine
23
24 subroutine f2 (n, a, s)
25 implicit none
26 integer :: n
27 double precision :: a(*)
28 double precision :: s
29 integer :: i
30 !$omp metadirective &
31 !$omp& when (device={kind (host), arch (score(6) : x86_64), isa (avx512f)} &
32 !$omp& : parallel do)
33 ! { dg-error ".score. cannot be specified in traits in the .device. trait-selector-set" "" { target *-*-*} .-2 }
34 do i = 1, n
35 a(i) = a(i) * s;
36 end do
37 end subroutine
38
39 subroutine f3 (n, a, s)
40 implicit none
41 integer :: n
42 double precision :: a(*)
43 double precision :: s
44 integer :: i
45 !$omp metadirective &
46 !$omp& when (device={kind (host), arch (score(6) : x86_64), &
47 !$omp& isa (score(7): avx512f)} &
48 !$omp& : parallel do)
49 ! { dg-error ".score. cannot be specified in traits in the .device. trait-selector-set" "" { target *-*-*} .-3 }
50 do i = 1, n
51 a(i) = a(i) * s;
52 end do
53 end subroutine
54
55 subroutine f4 (n, a, s)
56 implicit none
57 integer :: n
58 double precision :: a(*)
59 double precision :: s
60 integer :: i
61 integer, parameter :: omp_initial_device = -1
62 !$omp metadirective &
63 !$omp& when (target_device={device_num (score(42) : omp_initial_device), &
64 !$omp& kind (host)} &
65 !$omp& : parallel do)
66 ! { dg-error ".score. cannot be specified in traits in the .target_device. trait-selector-set" "" { target *-*-*} .-3 }
67 do i = 1, n
68 a(i) = a(i) * s;
69 end do
70 end subroutine
71
72 subroutine f5 (n, a, s)
73 implicit none
74 integer :: n
75 double precision :: a(*)
76 double precision :: s
77 integer :: i
78 integer, parameter :: omp_initial_device = -1
79 !$omp metadirective &
80 !$omp& when (target_device={device_num(omp_initial_device), &
81 !$omp& kind (score(5) : host)} &
82 !$omp& : parallel do)
83 ! { dg-error ".score. cannot be specified in traits in the .target_device. trait-selector-set" "" { target *-*-*} .-2 }
84 do i = 1, n
85 a(i) = a(i) * s;
86 end do
87 end subroutine
88
89 subroutine f6 (n, a, s)
90 implicit none
91 integer :: n
92 double precision :: a(*)
93 double precision :: s
94 integer :: i
95 integer, parameter :: omp_initial_device = -1
96 !$omp metadirective &
97 !$omp& when (target_device={device_num(omp_initial_device), kind (host), &
98 !$omp& arch (score(6) : x86_64), isa (avx512f)} &
99 !$omp& : parallel do)
100 ! { dg-error ".score. cannot be specified in traits in the .target_device. trait-selector-set" "" { target *-*-*} .-2 }
101 do i = 1, n
102 a(i) = a(i) * s;
103 end do
104 end subroutine
105
106 subroutine f7 (n, a, s)
107 implicit none
108 integer :: n
109 double precision :: a(*)
110 double precision :: s
111 integer :: i
112 integer, parameter :: omp_initial_device = -1
113 !$omp metadirective &
114 !$omp& when (target_device={device_num(omp_initial_device), kind (host), &
115 !$omp& arch (score(6) : x86_64), &
116 !$omp& isa (score(7): avx512f)} &
117 !$omp& : parallel do)
118 ! { dg-error ".score. cannot be specified in traits in the .target_device. trait-selector-set" "" { target *-*-*} .-3 }
119 do i = 1, n
120 a(i) = a(i) * s;
121 end do
122 end subroutine