File: compute-construct-device_type-clause.c

package info (click to toggle)
llvm-toolchain-19 1%3A19.1.7-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,998,520 kB
  • sloc: cpp: 6,951,680; ansic: 1,486,157; asm: 913,598; python: 232,024; f90: 80,126; objc: 75,281; lisp: 37,276; pascal: 16,990; sh: 10,009; ml: 5,058; perl: 4,724; awk: 3,523; makefile: 3,167; javascript: 2,504; xml: 892; fortran: 664; cs: 573
file content (225 lines) | stat: -rw-r--r-- 10,760 bytes parent folder | download | duplicates (3)
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
// RUN: %clang_cc1 %s -fopenacc -verify

#define MACRO +FOO

void uses() {
  typedef struct S{} STy;
  STy SImpl;

#pragma acc parallel device_type(I)
  while(1);
#pragma acc serial device_type(S) dtype(STy)
  while(1);
#pragma acc kernels dtype(SImpl)
  while(1);
#pragma acc kernels dtype(int) device_type(*)
  while(1);
#pragma acc kernels dtype(true) device_type(false)
  while(1);

  // expected-error@+1{{expected identifier}}
#pragma acc kernels dtype(int, *)
  while(1);

#pragma acc parallel device_type(I, int)
  while(1);
  // expected-error@+2{{expected ','}}
  // expected-error@+1{{expected identifier}}
#pragma acc kernels dtype(int{})
  while(1);
  // expected-error@+1{{expected identifier}}
#pragma acc kernels dtype(5)
  while(1);
  // expected-error@+1{{expected identifier}}
#pragma acc kernels dtype(MACRO)
  while(1);

  // expected-error@+2{{OpenACC 'device_type' clause is not valid on 'enter data' directive}}
  // expected-warning@+1{{OpenACC construct 'enter data' not yet implemented}}
#pragma acc enter data device_type(I)
  // expected-error@+2{{OpenACC 'dtype' clause is not valid on 'enter data' directive}}
  // expected-warning@+1{{OpenACC construct 'enter data' not yet implemented}}
#pragma acc enter data dtype(I)


  // Only 'async', 'wait', num_gangs', 'num_workers', 'vector_length' allowed after 'device_type'.

  // expected-error@+2{{OpenACC clause 'finalize' may not follow a 'device_type' clause in a compute construct}}
  // expected-note@+1{{previous clause is here}}
#pragma acc kernels device_type(*) finalize
  while(1);
  // expected-error@+2{{OpenACC clause 'if_present' may not follow a 'device_type' clause in a compute construct}}
  // expected-note@+1{{previous clause is here}}
#pragma acc kernels device_type(*) if_present
  while(1);
  // expected-error@+1{{OpenACC 'seq' clause is not valid on 'kernels' directive}}
#pragma acc kernels device_type(*) seq
  while(1);
  // expected-error@+1{{OpenACC 'independent' clause is not valid on 'kernels' directive}}
#pragma acc kernels device_type(*) independent
  while(1);
  // expected-error@+1{{OpenACC 'auto' clause is not valid on 'kernels' directive}}
#pragma acc kernels device_type(*) auto
  while(1);
  // expected-error@+2{{OpenACC clause 'worker' may not follow a 'device_type' clause in a compute construct}}
  // expected-note@+1{{previous clause is here}}
#pragma acc kernels device_type(*) worker
  while(1);
  // expected-error@+2{{OpenACC clause 'nohost' may not follow a 'device_type' clause in a compute construct}}
  // expected-note@+1{{previous clause is here}}
#pragma acc kernels device_type(*) nohost
  while(1);
  // expected-error@+2{{OpenACC clause 'default' may not follow a 'device_type' clause in a compute construct}}
  // expected-note@+1{{previous clause is here}}
#pragma acc kernels device_type(*) default(none)
  while(1);
  // expected-error@+2{{OpenACC clause 'if' may not follow a 'device_type' clause in a compute construct}}
  // expected-note@+1{{previous clause is here}}
#pragma acc kernels device_type(*) if(1)
  while(1);
  // expected-error@+2{{OpenACC clause 'self' may not follow a 'device_type' clause in a compute construct}}
  // expected-note@+1{{previous clause is here}}
#pragma acc kernels device_type(*) self
  while(1);

  int Var;
  int *VarPtr;
  // expected-error@+2{{OpenACC clause 'copy' may not follow a 'device_type' clause in a compute construct}}
  // expected-note@+1{{previous clause is here}}
#pragma acc kernels device_type(*) copy(Var)
  while(1);
  // expected-error@+2{{OpenACC clause 'pcopy' may not follow a 'device_type' clause in a compute construct}}
  // expected-note@+1{{previous clause is here}}
#pragma acc kernels device_type(*) pcopy(Var)
  while(1);
  // expected-error@+2{{OpenACC clause 'present_or_copy' may not follow a 'device_type' clause in a compute construct}}
  // expected-note@+1{{previous clause is here}}
#pragma acc kernels device_type(*) present_or_copy(Var)
  while(1);
  // expected-error@+2{{OpenACC clause 'use_device' may not follow a 'device_type' clause in a compute construct}}
  // expected-note@+1{{previous clause is here}}
#pragma acc kernels device_type(*) use_device(Var)
  while(1);
  // expected-error@+2{{OpenACC clause 'attach' may not follow a 'device_type' clause in a compute construct}}
  // expected-note@+1{{previous clause is here}}
#pragma acc kernels device_type(*) attach(Var)
  while(1);
  // expected-error@+2{{OpenACC clause 'delete' may not follow a 'device_type' clause in a compute construct}}
  // expected-note@+1{{previous clause is here}}
#pragma acc kernels device_type(*) delete(Var)
  while(1);
  // expected-error@+2{{OpenACC clause 'detach' may not follow a 'device_type' clause in a compute construct}}
  // expected-note@+1{{previous clause is here}}
#pragma acc kernels device_type(*) detach(Var)
  while(1);
  // expected-error@+2{{OpenACC clause 'device' may not follow a 'device_type' clause in a compute construct}}
  // expected-note@+1{{previous clause is here}}
#pragma acc kernels device_type(*) device(VarPtr)
  while(1);
  // expected-error@+2{{OpenACC clause 'deviceptr' may not follow a 'device_type' clause in a compute construct}}
  // expected-note@+1{{previous clause is here}}
#pragma acc kernels device_type(*) deviceptr(VarPtr)
  while(1);
  // expected-error@+2{{OpenACC clause 'device_resident' may not follow a 'device_type' clause in a compute construct}}
  // expected-note@+1{{previous clause is here}}
#pragma acc kernels device_type(*)  device_resident(VarPtr)
  while(1);
  // expected-error@+2{{OpenACC clause 'firstprivate' may not follow a 'device_type' clause in a compute construct}}
  // expected-note@+1{{previous clause is here}}
#pragma acc parallel device_type(*) firstprivate(Var)
  while(1);
  // expected-error@+2{{OpenACC clause 'host' may not follow a 'device_type' clause in a compute construct}}
  // expected-note@+1{{previous clause is here}}
#pragma acc kernels device_type(*) host(Var)
  while(1);
  // expected-error@+2{{OpenACC clause 'link' may not follow a 'device_type' clause in a compute construct}}
  // expected-note@+1{{previous clause is here}}
#pragma acc kernels device_type(*) link(Var)
  while(1);
  // expected-error@+2{{OpenACC clause 'no_create' may not follow a 'device_type' clause in a compute construct}}
  // expected-note@+1{{previous clause is here}}
#pragma acc kernels device_type(*) no_create(Var)
  while(1);
  // expected-error@+2{{OpenACC clause 'present' may not follow a 'device_type' clause in a compute construct}}
  // expected-note@+1{{previous clause is here}}
#pragma acc kernels device_type(*) present(Var)
  while(1);
  // expected-error@+2{{OpenACC clause 'private' may not follow a 'device_type' clause in a compute construct}}
  // expected-note@+1{{previous clause is here}}
#pragma acc parallel device_type(*) private(Var)
  while(1);
  // expected-error@+2{{OpenACC clause 'copyout' may not follow a 'device_type' clause in a compute construct}}
  // expected-note@+1{{previous clause is here}}
#pragma acc kernels device_type(*) copyout(Var)
  while(1);
  // expected-error@+2{{OpenACC clause 'pcopyout' may not follow a 'device_type' clause in a compute construct}}
  // expected-note@+1{{previous clause is here}}
#pragma acc kernels device_type(*) pcopyout(Var)
  while(1);
  // expected-error@+2{{OpenACC clause 'present_or_copyout' may not follow a 'device_type' clause in a compute construct}}
  // expected-note@+1{{previous clause is here}}
#pragma acc kernels device_type(*) present_or_copyout(Var)
  while(1);
  // expected-error@+2{{OpenACC clause 'copyin' may not follow a 'device_type' clause in a compute construct}}
  // expected-note@+1{{previous clause is here}}
#pragma acc kernels device_type(*) copyin(Var)
  while(1);
  // expected-error@+2{{OpenACC clause 'pcopyin' may not follow a 'device_type' clause in a compute construct}}
  // expected-note@+1{{previous clause is here}}
#pragma acc kernels device_type(*) pcopyin(Var)
  while(1);
  // expected-error@+2{{OpenACC clause 'present_or_copyin' may not follow a 'device_type' clause in a compute construct}}
  // expected-note@+1{{previous clause is here}}
#pragma acc kernels device_type(*) present_or_copyin(Var)
  while(1);
  // expected-error@+2{{OpenACC clause 'create' may not follow a 'device_type' clause in a compute construct}}
  // expected-note@+1{{previous clause is here}}
#pragma acc kernels device_type(*) create(Var)
  while(1);
  // expected-error@+2{{OpenACC clause 'pcreate' may not follow a 'device_type' clause in a compute construct}}
  // expected-note@+1{{previous clause is here}}
#pragma acc kernels device_type(*) pcreate(Var)
  while(1);
  // expected-error@+2{{OpenACC clause 'present_or_create' may not follow a 'device_type' clause in a compute construct}}
  // expected-note@+1{{previous clause is here}}
#pragma acc kernels device_type(*) present_or_create(Var)
  while(1);
  // expected-error@+2{{OpenACC clause 'reduction' may not follow a 'device_type' clause in a compute construct}}
  // expected-note@+1{{previous clause is here}}
#pragma acc serial device_type(*) reduction(+:Var)
  while(1);
  // expected-error@+2{{OpenACC clause 'collapse' may not follow a 'device_type' clause in a compute construct}}
  // expected-note@+1{{previous clause is here}}
#pragma acc kernels device_type(*) collapse(1)
  while(1);
  // expected-error@+2{{OpenACC clause 'bind' may not follow a 'device_type' clause in a compute construct}}
  // expected-note@+1{{previous clause is here}}
#pragma acc kernels device_type(*) bind(Var)
  while(1);
#pragma acc kernels device_type(*) vector_length(1)
  while(1);
#pragma acc kernels device_type(*) num_gangs(1)
  while(1);
#pragma acc kernels device_type(*) num_workers(1)
  while(1);
  // expected-error@+2{{OpenACC clause 'device_num' may not follow a 'device_type' clause in a compute construct}}
  // expected-note@+1{{previous clause is here}}
#pragma acc kernels device_type(*) device_num(1)
  while(1);
  // expected-error@+2{{OpenACC clause 'default_async' may not follow a 'device_type' clause in a compute construct}}
  // expected-note@+1{{previous clause is here}}
#pragma acc kernels device_type(*) default_async(1)
  while(1);
#pragma acc kernels device_type(*) async
  while(1);
  // expected-error@+2{{OpenACC clause 'tile' may not follow a 'device_type' clause in a compute construct}}
  // expected-note@+1{{previous clause is here}}
#pragma acc kernels device_type(*) tile(Var, 1)
  while(1);
  // expected-error@+2{{OpenACC clause 'gang' may not follow a 'dtype' clause in a compute construct}}
  // expected-note@+1{{previous clause is here}}
#pragma acc kernels dtype(*) gang
  while(1);
#pragma acc kernels device_type(*) wait
  while(1);
}