1 | #ifdef GEN_FLANG_DIRECTIVE_CLAUSE_SETS |
2 | #undef GEN_FLANG_DIRECTIVE_CLAUSE_SETS |
3 | |
4 | namespace llvm { |
5 | namespace acc { |
6 | |
7 | // Sets for atomic |
8 | |
9 | static AccClauseSet allowedClauses_ACCD_atomic { |
10 | }; |
11 | |
12 | static AccClauseSet allowedOnceClauses_ACCD_atomic { |
13 | }; |
14 | |
15 | static AccClauseSet allowedExclusiveClauses_ACCD_atomic { |
16 | }; |
17 | |
18 | static AccClauseSet requiredClauses_ACCD_atomic { |
19 | }; |
20 | |
21 | // Sets for cache |
22 | |
23 | static AccClauseSet allowedClauses_ACCD_cache { |
24 | }; |
25 | |
26 | static AccClauseSet allowedOnceClauses_ACCD_cache { |
27 | }; |
28 | |
29 | static AccClauseSet allowedExclusiveClauses_ACCD_cache { |
30 | }; |
31 | |
32 | static AccClauseSet requiredClauses_ACCD_cache { |
33 | }; |
34 | |
35 | // Sets for data |
36 | |
37 | static AccClauseSet allowedClauses_ACCD_data { |
38 | llvm::acc::Clause::ACCC_device_type, |
39 | llvm::acc::Clause::ACCC_wait, |
40 | }; |
41 | |
42 | static AccClauseSet allowedOnceClauses_ACCD_data { |
43 | llvm::acc::Clause::ACCC_async, |
44 | llvm::acc::Clause::ACCC_if, |
45 | llvm::acc::Clause::ACCC_default, |
46 | }; |
47 | |
48 | static AccClauseSet allowedExclusiveClauses_ACCD_data { |
49 | }; |
50 | |
51 | static AccClauseSet requiredClauses_ACCD_data { |
52 | llvm::acc::Clause::ACCC_attach, |
53 | llvm::acc::Clause::ACCC_copy, |
54 | llvm::acc::Clause::ACCC_copyin, |
55 | llvm::acc::Clause::ACCC_copyout, |
56 | llvm::acc::Clause::ACCC_create, |
57 | llvm::acc::Clause::ACCC_default, |
58 | llvm::acc::Clause::ACCC_deviceptr, |
59 | llvm::acc::Clause::ACCC_no_create, |
60 | llvm::acc::Clause::ACCC_present, |
61 | }; |
62 | |
63 | // Sets for declare |
64 | |
65 | static AccClauseSet allowedClauses_ACCD_declare { |
66 | llvm::acc::Clause::ACCC_copy, |
67 | llvm::acc::Clause::ACCC_copyin, |
68 | llvm::acc::Clause::ACCC_copyout, |
69 | llvm::acc::Clause::ACCC_create, |
70 | llvm::acc::Clause::ACCC_present, |
71 | llvm::acc::Clause::ACCC_deviceptr, |
72 | llvm::acc::Clause::ACCC_device_resident, |
73 | llvm::acc::Clause::ACCC_link, |
74 | }; |
75 | |
76 | static AccClauseSet allowedOnceClauses_ACCD_declare { |
77 | }; |
78 | |
79 | static AccClauseSet allowedExclusiveClauses_ACCD_declare { |
80 | }; |
81 | |
82 | static AccClauseSet requiredClauses_ACCD_declare { |
83 | }; |
84 | |
85 | // Sets for enter data |
86 | |
87 | static AccClauseSet allowedClauses_ACCD_enter_data { |
88 | llvm::acc::Clause::ACCC_wait, |
89 | }; |
90 | |
91 | static AccClauseSet allowedOnceClauses_ACCD_enter_data { |
92 | llvm::acc::Clause::ACCC_async, |
93 | llvm::acc::Clause::ACCC_if, |
94 | }; |
95 | |
96 | static AccClauseSet allowedExclusiveClauses_ACCD_enter_data { |
97 | }; |
98 | |
99 | static AccClauseSet requiredClauses_ACCD_enter_data { |
100 | llvm::acc::Clause::ACCC_attach, |
101 | llvm::acc::Clause::ACCC_create, |
102 | llvm::acc::Clause::ACCC_copyin, |
103 | }; |
104 | |
105 | // Sets for exit data |
106 | |
107 | static AccClauseSet allowedClauses_ACCD_exit_data { |
108 | llvm::acc::Clause::ACCC_wait, |
109 | }; |
110 | |
111 | static AccClauseSet allowedOnceClauses_ACCD_exit_data { |
112 | llvm::acc::Clause::ACCC_async, |
113 | llvm::acc::Clause::ACCC_if, |
114 | llvm::acc::Clause::ACCC_finalize, |
115 | }; |
116 | |
117 | static AccClauseSet allowedExclusiveClauses_ACCD_exit_data { |
118 | }; |
119 | |
120 | static AccClauseSet requiredClauses_ACCD_exit_data { |
121 | llvm::acc::Clause::ACCC_copyout, |
122 | llvm::acc::Clause::ACCC_delete, |
123 | llvm::acc::Clause::ACCC_detach, |
124 | }; |
125 | |
126 | // Sets for host_data |
127 | |
128 | static AccClauseSet allowedClauses_ACCD_host_data { |
129 | }; |
130 | |
131 | static AccClauseSet allowedOnceClauses_ACCD_host_data { |
132 | llvm::acc::Clause::ACCC_if, |
133 | llvm::acc::Clause::ACCC_if_present, |
134 | }; |
135 | |
136 | static AccClauseSet allowedExclusiveClauses_ACCD_host_data { |
137 | }; |
138 | |
139 | static AccClauseSet requiredClauses_ACCD_host_data { |
140 | llvm::acc::Clause::ACCC_use_device, |
141 | }; |
142 | |
143 | // Sets for init |
144 | |
145 | static AccClauseSet allowedClauses_ACCD_init { |
146 | }; |
147 | |
148 | static AccClauseSet allowedOnceClauses_ACCD_init { |
149 | llvm::acc::Clause::ACCC_device_num, |
150 | llvm::acc::Clause::ACCC_device_type, |
151 | llvm::acc::Clause::ACCC_if, |
152 | }; |
153 | |
154 | static AccClauseSet allowedExclusiveClauses_ACCD_init { |
155 | }; |
156 | |
157 | static AccClauseSet requiredClauses_ACCD_init { |
158 | }; |
159 | |
160 | // Sets for kernels |
161 | |
162 | static AccClauseSet allowedClauses_ACCD_kernels { |
163 | llvm::acc::Clause::ACCC_attach, |
164 | llvm::acc::Clause::ACCC_copy, |
165 | llvm::acc::Clause::ACCC_copyin, |
166 | llvm::acc::Clause::ACCC_copyout, |
167 | llvm::acc::Clause::ACCC_create, |
168 | llvm::acc::Clause::ACCC_device_type, |
169 | llvm::acc::Clause::ACCC_no_create, |
170 | llvm::acc::Clause::ACCC_present, |
171 | llvm::acc::Clause::ACCC_deviceptr, |
172 | llvm::acc::Clause::ACCC_wait, |
173 | }; |
174 | |
175 | static AccClauseSet allowedOnceClauses_ACCD_kernels { |
176 | llvm::acc::Clause::ACCC_async, |
177 | llvm::acc::Clause::ACCC_default, |
178 | llvm::acc::Clause::ACCC_if, |
179 | llvm::acc::Clause::ACCC_num_gangs, |
180 | llvm::acc::Clause::ACCC_num_workers, |
181 | llvm::acc::Clause::ACCC_self, |
182 | llvm::acc::Clause::ACCC_vector_length, |
183 | }; |
184 | |
185 | static AccClauseSet allowedExclusiveClauses_ACCD_kernels { |
186 | }; |
187 | |
188 | static AccClauseSet requiredClauses_ACCD_kernels { |
189 | }; |
190 | |
191 | // Sets for kernels loop |
192 | |
193 | static AccClauseSet allowedClauses_ACCD_kernels_loop { |
194 | llvm::acc::Clause::ACCC_attach, |
195 | llvm::acc::Clause::ACCC_collapse, |
196 | llvm::acc::Clause::ACCC_copy, |
197 | llvm::acc::Clause::ACCC_copyin, |
198 | llvm::acc::Clause::ACCC_copyout, |
199 | llvm::acc::Clause::ACCC_create, |
200 | llvm::acc::Clause::ACCC_deviceptr, |
201 | llvm::acc::Clause::ACCC_device_type, |
202 | llvm::acc::Clause::ACCC_gang, |
203 | llvm::acc::Clause::ACCC_no_create, |
204 | llvm::acc::Clause::ACCC_num_gangs, |
205 | llvm::acc::Clause::ACCC_num_workers, |
206 | llvm::acc::Clause::ACCC_present, |
207 | llvm::acc::Clause::ACCC_private, |
208 | llvm::acc::Clause::ACCC_reduction, |
209 | llvm::acc::Clause::ACCC_tile, |
210 | llvm::acc::Clause::ACCC_vector, |
211 | llvm::acc::Clause::ACCC_vector_length, |
212 | llvm::acc::Clause::ACCC_wait, |
213 | llvm::acc::Clause::ACCC_worker, |
214 | }; |
215 | |
216 | static AccClauseSet allowedOnceClauses_ACCD_kernels_loop { |
217 | llvm::acc::Clause::ACCC_async, |
218 | llvm::acc::Clause::ACCC_default, |
219 | llvm::acc::Clause::ACCC_if, |
220 | llvm::acc::Clause::ACCC_self, |
221 | }; |
222 | |
223 | static AccClauseSet allowedExclusiveClauses_ACCD_kernels_loop { |
224 | llvm::acc::Clause::ACCC_auto, |
225 | llvm::acc::Clause::ACCC_independent, |
226 | llvm::acc::Clause::ACCC_seq, |
227 | }; |
228 | |
229 | static AccClauseSet requiredClauses_ACCD_kernels_loop { |
230 | }; |
231 | |
232 | // Sets for loop |
233 | |
234 | static AccClauseSet allowedClauses_ACCD_loop { |
235 | llvm::acc::Clause::ACCC_device_type, |
236 | llvm::acc::Clause::ACCC_private, |
237 | llvm::acc::Clause::ACCC_reduction, |
238 | llvm::acc::Clause::ACCC_collapse, |
239 | llvm::acc::Clause::ACCC_gang, |
240 | llvm::acc::Clause::ACCC_tile, |
241 | llvm::acc::Clause::ACCC_vector, |
242 | llvm::acc::Clause::ACCC_worker, |
243 | }; |
244 | |
245 | static AccClauseSet allowedOnceClauses_ACCD_loop { |
246 | }; |
247 | |
248 | static AccClauseSet allowedExclusiveClauses_ACCD_loop { |
249 | llvm::acc::Clause::ACCC_auto, |
250 | llvm::acc::Clause::ACCC_independent, |
251 | llvm::acc::Clause::ACCC_seq, |
252 | }; |
253 | |
254 | static AccClauseSet requiredClauses_ACCD_loop { |
255 | }; |
256 | |
257 | // Sets for parallel |
258 | |
259 | static AccClauseSet allowedClauses_ACCD_parallel { |
260 | llvm::acc::Clause::ACCC_attach, |
261 | llvm::acc::Clause::ACCC_async, |
262 | llvm::acc::Clause::ACCC_copy, |
263 | llvm::acc::Clause::ACCC_copyin, |
264 | llvm::acc::Clause::ACCC_copyout, |
265 | llvm::acc::Clause::ACCC_create, |
266 | llvm::acc::Clause::ACCC_deviceptr, |
267 | llvm::acc::Clause::ACCC_device_type, |
268 | llvm::acc::Clause::ACCC_no_create, |
269 | llvm::acc::Clause::ACCC_num_gangs, |
270 | llvm::acc::Clause::ACCC_num_workers, |
271 | llvm::acc::Clause::ACCC_present, |
272 | llvm::acc::Clause::ACCC_private, |
273 | llvm::acc::Clause::ACCC_firstprivate, |
274 | llvm::acc::Clause::ACCC_reduction, |
275 | llvm::acc::Clause::ACCC_wait, |
276 | llvm::acc::Clause::ACCC_vector_length, |
277 | }; |
278 | |
279 | static AccClauseSet allowedOnceClauses_ACCD_parallel { |
280 | llvm::acc::Clause::ACCC_default, |
281 | llvm::acc::Clause::ACCC_if, |
282 | llvm::acc::Clause::ACCC_self, |
283 | }; |
284 | |
285 | static AccClauseSet allowedExclusiveClauses_ACCD_parallel { |
286 | }; |
287 | |
288 | static AccClauseSet requiredClauses_ACCD_parallel { |
289 | }; |
290 | |
291 | // Sets for parallel loop |
292 | |
293 | static AccClauseSet allowedClauses_ACCD_parallel_loop { |
294 | llvm::acc::Clause::ACCC_attach, |
295 | llvm::acc::Clause::ACCC_collapse, |
296 | llvm::acc::Clause::ACCC_copy, |
297 | llvm::acc::Clause::ACCC_copyin, |
298 | llvm::acc::Clause::ACCC_copyout, |
299 | llvm::acc::Clause::ACCC_create, |
300 | llvm::acc::Clause::ACCC_deviceptr, |
301 | llvm::acc::Clause::ACCC_device_type, |
302 | llvm::acc::Clause::ACCC_firstprivate, |
303 | llvm::acc::Clause::ACCC_gang, |
304 | llvm::acc::Clause::ACCC_no_create, |
305 | llvm::acc::Clause::ACCC_num_gangs, |
306 | llvm::acc::Clause::ACCC_num_workers, |
307 | llvm::acc::Clause::ACCC_present, |
308 | llvm::acc::Clause::ACCC_private, |
309 | llvm::acc::Clause::ACCC_reduction, |
310 | llvm::acc::Clause::ACCC_tile, |
311 | llvm::acc::Clause::ACCC_vector, |
312 | llvm::acc::Clause::ACCC_vector_length, |
313 | llvm::acc::Clause::ACCC_wait, |
314 | llvm::acc::Clause::ACCC_worker, |
315 | }; |
316 | |
317 | static AccClauseSet allowedOnceClauses_ACCD_parallel_loop { |
318 | llvm::acc::Clause::ACCC_async, |
319 | llvm::acc::Clause::ACCC_default, |
320 | llvm::acc::Clause::ACCC_if, |
321 | llvm::acc::Clause::ACCC_self, |
322 | }; |
323 | |
324 | static AccClauseSet allowedExclusiveClauses_ACCD_parallel_loop { |
325 | llvm::acc::Clause::ACCC_auto, |
326 | llvm::acc::Clause::ACCC_independent, |
327 | llvm::acc::Clause::ACCC_seq, |
328 | }; |
329 | |
330 | static AccClauseSet requiredClauses_ACCD_parallel_loop { |
331 | }; |
332 | |
333 | // Sets for routine |
334 | |
335 | static AccClauseSet allowedClauses_ACCD_routine { |
336 | llvm::acc::Clause::ACCC_bind, |
337 | llvm::acc::Clause::ACCC_device_type, |
338 | llvm::acc::Clause::ACCC_gang, |
339 | llvm::acc::Clause::ACCC_seq, |
340 | llvm::acc::Clause::ACCC_vector, |
341 | llvm::acc::Clause::ACCC_worker, |
342 | }; |
343 | |
344 | static AccClauseSet allowedOnceClauses_ACCD_routine { |
345 | llvm::acc::Clause::ACCC_nohost, |
346 | }; |
347 | |
348 | static AccClauseSet allowedExclusiveClauses_ACCD_routine { |
349 | }; |
350 | |
351 | static AccClauseSet requiredClauses_ACCD_routine { |
352 | }; |
353 | |
354 | // Sets for serial |
355 | |
356 | static AccClauseSet allowedClauses_ACCD_serial { |
357 | llvm::acc::Clause::ACCC_attach, |
358 | llvm::acc::Clause::ACCC_copy, |
359 | llvm::acc::Clause::ACCC_copyin, |
360 | llvm::acc::Clause::ACCC_copyout, |
361 | llvm::acc::Clause::ACCC_create, |
362 | llvm::acc::Clause::ACCC_deviceptr, |
363 | llvm::acc::Clause::ACCC_device_type, |
364 | llvm::acc::Clause::ACCC_no_create, |
365 | llvm::acc::Clause::ACCC_present, |
366 | llvm::acc::Clause::ACCC_private, |
367 | llvm::acc::Clause::ACCC_firstprivate, |
368 | llvm::acc::Clause::ACCC_reduction, |
369 | llvm::acc::Clause::ACCC_wait, |
370 | }; |
371 | |
372 | static AccClauseSet allowedOnceClauses_ACCD_serial { |
373 | llvm::acc::Clause::ACCC_async, |
374 | llvm::acc::Clause::ACCC_default, |
375 | llvm::acc::Clause::ACCC_if, |
376 | llvm::acc::Clause::ACCC_self, |
377 | }; |
378 | |
379 | static AccClauseSet allowedExclusiveClauses_ACCD_serial { |
380 | }; |
381 | |
382 | static AccClauseSet requiredClauses_ACCD_serial { |
383 | }; |
384 | |
385 | // Sets for serial loop |
386 | |
387 | static AccClauseSet allowedClauses_ACCD_serial_loop { |
388 | llvm::acc::Clause::ACCC_attach, |
389 | llvm::acc::Clause::ACCC_collapse, |
390 | llvm::acc::Clause::ACCC_copy, |
391 | llvm::acc::Clause::ACCC_copyin, |
392 | llvm::acc::Clause::ACCC_copyout, |
393 | llvm::acc::Clause::ACCC_create, |
394 | llvm::acc::Clause::ACCC_deviceptr, |
395 | llvm::acc::Clause::ACCC_device_type, |
396 | llvm::acc::Clause::ACCC_firstprivate, |
397 | llvm::acc::Clause::ACCC_gang, |
398 | llvm::acc::Clause::ACCC_no_create, |
399 | llvm::acc::Clause::ACCC_present, |
400 | llvm::acc::Clause::ACCC_private, |
401 | llvm::acc::Clause::ACCC_reduction, |
402 | llvm::acc::Clause::ACCC_tile, |
403 | llvm::acc::Clause::ACCC_vector, |
404 | llvm::acc::Clause::ACCC_wait, |
405 | llvm::acc::Clause::ACCC_worker, |
406 | }; |
407 | |
408 | static AccClauseSet allowedOnceClauses_ACCD_serial_loop { |
409 | llvm::acc::Clause::ACCC_async, |
410 | llvm::acc::Clause::ACCC_default, |
411 | llvm::acc::Clause::ACCC_if, |
412 | llvm::acc::Clause::ACCC_self, |
413 | }; |
414 | |
415 | static AccClauseSet allowedExclusiveClauses_ACCD_serial_loop { |
416 | llvm::acc::Clause::ACCC_auto, |
417 | llvm::acc::Clause::ACCC_independent, |
418 | llvm::acc::Clause::ACCC_seq, |
419 | }; |
420 | |
421 | static AccClauseSet requiredClauses_ACCD_serial_loop { |
422 | }; |
423 | |
424 | // Sets for set |
425 | |
426 | static AccClauseSet allowedClauses_ACCD_set { |
427 | }; |
428 | |
429 | static AccClauseSet allowedOnceClauses_ACCD_set { |
430 | llvm::acc::Clause::ACCC_default_async, |
431 | llvm::acc::Clause::ACCC_device_num, |
432 | llvm::acc::Clause::ACCC_device_type, |
433 | llvm::acc::Clause::ACCC_if, |
434 | }; |
435 | |
436 | static AccClauseSet allowedExclusiveClauses_ACCD_set { |
437 | }; |
438 | |
439 | static AccClauseSet requiredClauses_ACCD_set { |
440 | llvm::acc::Clause::ACCC_default_async, |
441 | llvm::acc::Clause::ACCC_device_num, |
442 | llvm::acc::Clause::ACCC_device_type, |
443 | }; |
444 | |
445 | // Sets for shutdown |
446 | |
447 | static AccClauseSet allowedClauses_ACCD_shutdown { |
448 | }; |
449 | |
450 | static AccClauseSet allowedOnceClauses_ACCD_shutdown { |
451 | llvm::acc::Clause::ACCC_device_num, |
452 | llvm::acc::Clause::ACCC_device_type, |
453 | llvm::acc::Clause::ACCC_if, |
454 | }; |
455 | |
456 | static AccClauseSet allowedExclusiveClauses_ACCD_shutdown { |
457 | }; |
458 | |
459 | static AccClauseSet requiredClauses_ACCD_shutdown { |
460 | }; |
461 | |
462 | // Sets for unknown |
463 | |
464 | static AccClauseSet allowedClauses_ACCD_unknown { |
465 | }; |
466 | |
467 | static AccClauseSet allowedOnceClauses_ACCD_unknown { |
468 | }; |
469 | |
470 | static AccClauseSet allowedExclusiveClauses_ACCD_unknown { |
471 | }; |
472 | |
473 | static AccClauseSet requiredClauses_ACCD_unknown { |
474 | }; |
475 | |
476 | // Sets for update |
477 | |
478 | static AccClauseSet allowedClauses_ACCD_update { |
479 | llvm::acc::Clause::ACCC_device_type, |
480 | llvm::acc::Clause::ACCC_wait, |
481 | }; |
482 | |
483 | static AccClauseSet allowedOnceClauses_ACCD_update { |
484 | llvm::acc::Clause::ACCC_async, |
485 | llvm::acc::Clause::ACCC_if, |
486 | llvm::acc::Clause::ACCC_if_present, |
487 | }; |
488 | |
489 | static AccClauseSet allowedExclusiveClauses_ACCD_update { |
490 | }; |
491 | |
492 | static AccClauseSet requiredClauses_ACCD_update { |
493 | llvm::acc::Clause::ACCC_device, |
494 | llvm::acc::Clause::ACCC_host, |
495 | llvm::acc::Clause::ACCC_self, |
496 | }; |
497 | |
498 | // Sets for wait |
499 | |
500 | static AccClauseSet allowedClauses_ACCD_wait { |
501 | }; |
502 | |
503 | static AccClauseSet allowedOnceClauses_ACCD_wait { |
504 | llvm::acc::Clause::ACCC_async, |
505 | llvm::acc::Clause::ACCC_if, |
506 | }; |
507 | |
508 | static AccClauseSet allowedExclusiveClauses_ACCD_wait { |
509 | }; |
510 | |
511 | static AccClauseSet requiredClauses_ACCD_wait { |
512 | }; |
513 | } // namespace acc |
514 | } // namespace llvm |
515 | |
516 | #endif // GEN_FLANG_DIRECTIVE_CLAUSE_SETS |
517 | |
518 | #ifdef GEN_FLANG_DIRECTIVE_CLAUSE_MAP |
519 | #undef GEN_FLANG_DIRECTIVE_CLAUSE_MAP |
520 | |
521 | { |
522 | {llvm::acc::Directive::ACCD_atomic, |
523 | { |
524 | llvm::acc::allowedClauses_ACCD_atomic, |
525 | llvm::acc::allowedOnceClauses_ACCD_atomic, |
526 | llvm::acc::allowedExclusiveClauses_ACCD_atomic, |
527 | llvm::acc::requiredClauses_ACCD_atomic, |
528 | } |
529 | }, |
530 | {llvm::acc::Directive::ACCD_cache, |
531 | { |
532 | llvm::acc::allowedClauses_ACCD_cache, |
533 | llvm::acc::allowedOnceClauses_ACCD_cache, |
534 | llvm::acc::allowedExclusiveClauses_ACCD_cache, |
535 | llvm::acc::requiredClauses_ACCD_cache, |
536 | } |
537 | }, |
538 | {llvm::acc::Directive::ACCD_data, |
539 | { |
540 | llvm::acc::allowedClauses_ACCD_data, |
541 | llvm::acc::allowedOnceClauses_ACCD_data, |
542 | llvm::acc::allowedExclusiveClauses_ACCD_data, |
543 | llvm::acc::requiredClauses_ACCD_data, |
544 | } |
545 | }, |
546 | {llvm::acc::Directive::ACCD_declare, |
547 | { |
548 | llvm::acc::allowedClauses_ACCD_declare, |
549 | llvm::acc::allowedOnceClauses_ACCD_declare, |
550 | llvm::acc::allowedExclusiveClauses_ACCD_declare, |
551 | llvm::acc::requiredClauses_ACCD_declare, |
552 | } |
553 | }, |
554 | {llvm::acc::Directive::ACCD_enter_data, |
555 | { |
556 | llvm::acc::allowedClauses_ACCD_enter_data, |
557 | llvm::acc::allowedOnceClauses_ACCD_enter_data, |
558 | llvm::acc::allowedExclusiveClauses_ACCD_enter_data, |
559 | llvm::acc::requiredClauses_ACCD_enter_data, |
560 | } |
561 | }, |
562 | {llvm::acc::Directive::ACCD_exit_data, |
563 | { |
564 | llvm::acc::allowedClauses_ACCD_exit_data, |
565 | llvm::acc::allowedOnceClauses_ACCD_exit_data, |
566 | llvm::acc::allowedExclusiveClauses_ACCD_exit_data, |
567 | llvm::acc::requiredClauses_ACCD_exit_data, |
568 | } |
569 | }, |
570 | {llvm::acc::Directive::ACCD_host_data, |
571 | { |
572 | llvm::acc::allowedClauses_ACCD_host_data, |
573 | llvm::acc::allowedOnceClauses_ACCD_host_data, |
574 | llvm::acc::allowedExclusiveClauses_ACCD_host_data, |
575 | llvm::acc::requiredClauses_ACCD_host_data, |
576 | } |
577 | }, |
578 | {llvm::acc::Directive::ACCD_init, |
579 | { |
580 | llvm::acc::allowedClauses_ACCD_init, |
581 | llvm::acc::allowedOnceClauses_ACCD_init, |
582 | llvm::acc::allowedExclusiveClauses_ACCD_init, |
583 | llvm::acc::requiredClauses_ACCD_init, |
584 | } |
585 | }, |
586 | {llvm::acc::Directive::ACCD_kernels, |
587 | { |
588 | llvm::acc::allowedClauses_ACCD_kernels, |
589 | llvm::acc::allowedOnceClauses_ACCD_kernels, |
590 | llvm::acc::allowedExclusiveClauses_ACCD_kernels, |
591 | llvm::acc::requiredClauses_ACCD_kernels, |
592 | } |
593 | }, |
594 | {llvm::acc::Directive::ACCD_kernels_loop, |
595 | { |
596 | llvm::acc::allowedClauses_ACCD_kernels_loop, |
597 | llvm::acc::allowedOnceClauses_ACCD_kernels_loop, |
598 | llvm::acc::allowedExclusiveClauses_ACCD_kernels_loop, |
599 | llvm::acc::requiredClauses_ACCD_kernels_loop, |
600 | } |
601 | }, |
602 | {llvm::acc::Directive::ACCD_loop, |
603 | { |
604 | llvm::acc::allowedClauses_ACCD_loop, |
605 | llvm::acc::allowedOnceClauses_ACCD_loop, |
606 | llvm::acc::allowedExclusiveClauses_ACCD_loop, |
607 | llvm::acc::requiredClauses_ACCD_loop, |
608 | } |
609 | }, |
610 | {llvm::acc::Directive::ACCD_parallel, |
611 | { |
612 | llvm::acc::allowedClauses_ACCD_parallel, |
613 | llvm::acc::allowedOnceClauses_ACCD_parallel, |
614 | llvm::acc::allowedExclusiveClauses_ACCD_parallel, |
615 | llvm::acc::requiredClauses_ACCD_parallel, |
616 | } |
617 | }, |
618 | {llvm::acc::Directive::ACCD_parallel_loop, |
619 | { |
620 | llvm::acc::allowedClauses_ACCD_parallel_loop, |
621 | llvm::acc::allowedOnceClauses_ACCD_parallel_loop, |
622 | llvm::acc::allowedExclusiveClauses_ACCD_parallel_loop, |
623 | llvm::acc::requiredClauses_ACCD_parallel_loop, |
624 | } |
625 | }, |
626 | {llvm::acc::Directive::ACCD_routine, |
627 | { |
628 | llvm::acc::allowedClauses_ACCD_routine, |
629 | llvm::acc::allowedOnceClauses_ACCD_routine, |
630 | llvm::acc::allowedExclusiveClauses_ACCD_routine, |
631 | llvm::acc::requiredClauses_ACCD_routine, |
632 | } |
633 | }, |
634 | {llvm::acc::Directive::ACCD_serial, |
635 | { |
636 | llvm::acc::allowedClauses_ACCD_serial, |
637 | llvm::acc::allowedOnceClauses_ACCD_serial, |
638 | llvm::acc::allowedExclusiveClauses_ACCD_serial, |
639 | llvm::acc::requiredClauses_ACCD_serial, |
640 | } |
641 | }, |
642 | {llvm::acc::Directive::ACCD_serial_loop, |
643 | { |
644 | llvm::acc::allowedClauses_ACCD_serial_loop, |
645 | llvm::acc::allowedOnceClauses_ACCD_serial_loop, |
646 | llvm::acc::allowedExclusiveClauses_ACCD_serial_loop, |
647 | llvm::acc::requiredClauses_ACCD_serial_loop, |
648 | } |
649 | }, |
650 | {llvm::acc::Directive::ACCD_set, |
651 | { |
652 | llvm::acc::allowedClauses_ACCD_set, |
653 | llvm::acc::allowedOnceClauses_ACCD_set, |
654 | llvm::acc::allowedExclusiveClauses_ACCD_set, |
655 | llvm::acc::requiredClauses_ACCD_set, |
656 | } |
657 | }, |
658 | {llvm::acc::Directive::ACCD_shutdown, |
659 | { |
660 | llvm::acc::allowedClauses_ACCD_shutdown, |
661 | llvm::acc::allowedOnceClauses_ACCD_shutdown, |
662 | llvm::acc::allowedExclusiveClauses_ACCD_shutdown, |
663 | llvm::acc::requiredClauses_ACCD_shutdown, |
664 | } |
665 | }, |
666 | {llvm::acc::Directive::ACCD_unknown, |
667 | { |
668 | llvm::acc::allowedClauses_ACCD_unknown, |
669 | llvm::acc::allowedOnceClauses_ACCD_unknown, |
670 | llvm::acc::allowedExclusiveClauses_ACCD_unknown, |
671 | llvm::acc::requiredClauses_ACCD_unknown, |
672 | } |
673 | }, |
674 | {llvm::acc::Directive::ACCD_update, |
675 | { |
676 | llvm::acc::allowedClauses_ACCD_update, |
677 | llvm::acc::allowedOnceClauses_ACCD_update, |
678 | llvm::acc::allowedExclusiveClauses_ACCD_update, |
679 | llvm::acc::requiredClauses_ACCD_update, |
680 | } |
681 | }, |
682 | {llvm::acc::Directive::ACCD_wait, |
683 | { |
684 | llvm::acc::allowedClauses_ACCD_wait, |
685 | llvm::acc::allowedOnceClauses_ACCD_wait, |
686 | llvm::acc::allowedExclusiveClauses_ACCD_wait, |
687 | llvm::acc::requiredClauses_ACCD_wait, |
688 | } |
689 | }, |
690 | } |
691 | |
692 | #endif // GEN_FLANG_DIRECTIVE_CLAUSE_MAP |
693 | |
694 | #ifdef GEN_FLANG_CLAUSE_PARSER_CLASSES |
695 | #undef GEN_FLANG_CLAUSE_PARSER_CLASSES |
696 | |
697 | WRAPPER_CLASS(Async, std::optional<ScalarIntExpr>); |
698 | WRAPPER_CLASS(Attach, AccObjectList); |
699 | EMPTY_CLASS(Auto); |
700 | WRAPPER_CLASS(Bind, AccBindClause); |
701 | EMPTY_CLASS(Capture); |
702 | WRAPPER_CLASS(Collapse, AccCollapseArg); |
703 | WRAPPER_CLASS(Copy, AccObjectList); |
704 | WRAPPER_CLASS(Copyin, AccObjectListWithModifier); |
705 | WRAPPER_CLASS(Copyout, AccObjectListWithModifier); |
706 | WRAPPER_CLASS(Create, AccObjectListWithModifier); |
707 | WRAPPER_CLASS(Default, AccDefaultClause); |
708 | WRAPPER_CLASS(DefaultAsync, ScalarIntExpr); |
709 | WRAPPER_CLASS(Delete, AccObjectList); |
710 | WRAPPER_CLASS(Detach, AccObjectList); |
711 | WRAPPER_CLASS(Device, AccObjectList); |
712 | WRAPPER_CLASS(DeviceNum, ScalarIntExpr); |
713 | WRAPPER_CLASS(Deviceptr, AccObjectList); |
714 | WRAPPER_CLASS(DeviceResident, AccObjectList); |
715 | WRAPPER_CLASS(DeviceType, AccDeviceTypeExprList); |
716 | EMPTY_CLASS(Finalize); |
717 | WRAPPER_CLASS(Firstprivate, AccObjectList); |
718 | WRAPPER_CLASS(Gang, std::optional<AccGangArgList>); |
719 | WRAPPER_CLASS(Host, AccObjectList); |
720 | WRAPPER_CLASS(If, ScalarExpr); |
721 | EMPTY_CLASS(IfPresent); |
722 | EMPTY_CLASS(Independent); |
723 | WRAPPER_CLASS(Link, AccObjectList); |
724 | WRAPPER_CLASS(NoCreate, AccObjectList); |
725 | EMPTY_CLASS(Nohost); |
726 | WRAPPER_CLASS(NumGangs, std::list<ScalarIntExpr>); |
727 | WRAPPER_CLASS(NumWorkers, ScalarIntExpr); |
728 | WRAPPER_CLASS(Present, AccObjectList); |
729 | WRAPPER_CLASS(Private, AccObjectList); |
730 | EMPTY_CLASS(Read); |
731 | WRAPPER_CLASS(Reduction, AccObjectListWithReduction); |
732 | WRAPPER_CLASS(Self, std::optional<AccSelfClause>); |
733 | EMPTY_CLASS(Seq); |
734 | WRAPPER_CLASS(Tile, AccTileExprList); |
735 | EMPTY_CLASS(Unknown); |
736 | WRAPPER_CLASS(UseDevice, AccObjectList); |
737 | WRAPPER_CLASS(Vector, std::optional<ScalarIntExpr>); |
738 | WRAPPER_CLASS(VectorLength, ScalarIntExpr); |
739 | WRAPPER_CLASS(Wait, std::optional<AccWaitArgument>); |
740 | WRAPPER_CLASS(Worker, std::optional<ScalarIntExpr>); |
741 | EMPTY_CLASS(Write); |
742 | |
743 | #endif // GEN_FLANG_CLAUSE_PARSER_CLASSES |
744 | |
745 | #ifdef GEN_FLANG_CLAUSE_PARSER_CLASSES_LIST |
746 | #undef GEN_FLANG_CLAUSE_PARSER_CLASSES_LIST |
747 | |
748 | Async |
749 | , Attach |
750 | , Auto |
751 | , Bind |
752 | , Capture |
753 | , Collapse |
754 | , Copy |
755 | , Copyin |
756 | , Copyout |
757 | , Create |
758 | , Default |
759 | , DefaultAsync |
760 | , Delete |
761 | , Detach |
762 | , Device |
763 | , DeviceNum |
764 | , Deviceptr |
765 | , DeviceResident |
766 | , DeviceType |
767 | , Finalize |
768 | , Firstprivate |
769 | , Gang |
770 | , Host |
771 | , If |
772 | , IfPresent |
773 | , Independent |
774 | , Link |
775 | , NoCreate |
776 | , Nohost |
777 | , NumGangs |
778 | , NumWorkers |
779 | , Present |
780 | , Private |
781 | , Read |
782 | , Reduction |
783 | , Self |
784 | , Seq |
785 | , Tile |
786 | , Unknown |
787 | , UseDevice |
788 | , Vector |
789 | , VectorLength |
790 | , Wait |
791 | , Worker |
792 | , Write |
793 | |
794 | #endif // GEN_FLANG_CLAUSE_PARSER_CLASSES_LIST |
795 | |
796 | #ifdef GEN_FLANG_DUMP_PARSE_TREE_CLAUSES |
797 | #undef GEN_FLANG_DUMP_PARSE_TREE_CLAUSES |
798 | |
799 | NODE(AccClause, Async) |
800 | NODE(AccClause, Attach) |
801 | NODE(AccClause, Auto) |
802 | NODE(AccClause, Bind) |
803 | NODE(AccClause, Capture) |
804 | NODE(AccClause, Collapse) |
805 | NODE(AccClause, Copy) |
806 | NODE(AccClause, Copyin) |
807 | NODE(AccClause, Copyout) |
808 | NODE(AccClause, Create) |
809 | NODE(AccClause, Default) |
810 | NODE(AccClause, DefaultAsync) |
811 | NODE(AccClause, Delete) |
812 | NODE(AccClause, Detach) |
813 | NODE(AccClause, Device) |
814 | NODE(AccClause, DeviceNum) |
815 | NODE(AccClause, Deviceptr) |
816 | NODE(AccClause, DeviceResident) |
817 | NODE(AccClause, DeviceType) |
818 | NODE(AccClause, Finalize) |
819 | NODE(AccClause, Firstprivate) |
820 | NODE(AccClause, Gang) |
821 | NODE(AccClause, Host) |
822 | NODE(AccClause, If) |
823 | NODE(AccClause, IfPresent) |
824 | NODE(AccClause, Independent) |
825 | NODE(AccClause, Link) |
826 | NODE(AccClause, NoCreate) |
827 | NODE(AccClause, Nohost) |
828 | NODE(AccClause, NumGangs) |
829 | NODE(AccClause, NumWorkers) |
830 | NODE(AccClause, Present) |
831 | NODE(AccClause, Private) |
832 | NODE(AccClause, Read) |
833 | NODE(AccClause, Reduction) |
834 | NODE(AccClause, Self) |
835 | NODE(AccClause, Seq) |
836 | NODE(AccClause, Tile) |
837 | NODE(AccClause, Unknown) |
838 | NODE(AccClause, UseDevice) |
839 | NODE(AccClause, Vector) |
840 | NODE(AccClause, VectorLength) |
841 | NODE(AccClause, Wait) |
842 | NODE(AccClause, Worker) |
843 | NODE(AccClause, Write) |
844 | |
845 | #endif // GEN_FLANG_DUMP_PARSE_TREE_CLAUSES |
846 | |
847 | #ifdef GEN_FLANG_CLAUSE_UNPARSE |
848 | #undef GEN_FLANG_CLAUSE_UNPARSE |
849 | |
850 | void Unparse(const AccClause::Async &x) { |
851 | Word("ASYNC" ); |
852 | Walk("(" , x.v, ")" ); |
853 | } |
854 | void Unparse(const AccClause::Attach &x) { |
855 | Word("ATTACH" ); |
856 | Put("(" ); |
857 | Walk(x.v); |
858 | Put(")" ); |
859 | } |
860 | void Before(const AccClause::Auto &) { Word("AUTO" ); } |
861 | void Unparse(const AccClause::Bind &x) { |
862 | Word("BIND" ); |
863 | Put("(" ); |
864 | Walk(x.v); |
865 | Put(")" ); |
866 | } |
867 | void Before(const AccClause::Capture &) { Word("CAPTURE" ); } |
868 | void Unparse(const AccClause::Collapse &x) { |
869 | Word("COLLAPSE" ); |
870 | Put("(" ); |
871 | Walk(x.v); |
872 | Put(")" ); |
873 | } |
874 | void Unparse(const AccClause::Copy &x) { |
875 | Word("COPY" ); |
876 | Put("(" ); |
877 | Walk(x.v); |
878 | Put(")" ); |
879 | } |
880 | void Unparse(const AccClause::Copyin &x) { |
881 | Word("COPYIN" ); |
882 | Put("(" ); |
883 | Walk(x.v); |
884 | Put(")" ); |
885 | } |
886 | void Unparse(const AccClause::Copyout &x) { |
887 | Word("COPYOUT" ); |
888 | Put("(" ); |
889 | Walk(x.v); |
890 | Put(")" ); |
891 | } |
892 | void Unparse(const AccClause::Create &x) { |
893 | Word("CREATE" ); |
894 | Put("(" ); |
895 | Walk(x.v); |
896 | Put(")" ); |
897 | } |
898 | void Unparse(const AccClause::Default &x) { |
899 | Word("DEFAULT" ); |
900 | Put("(" ); |
901 | Walk(x.v); |
902 | Put(")" ); |
903 | } |
904 | void Unparse(const AccClause::DefaultAsync &x) { |
905 | Word("DEFAULT_ASYNC" ); |
906 | Put("(" ); |
907 | Walk(x.v); |
908 | Put(")" ); |
909 | } |
910 | void Unparse(const AccClause::Delete &x) { |
911 | Word("DELETE" ); |
912 | Put("(" ); |
913 | Walk(x.v); |
914 | Put(")" ); |
915 | } |
916 | void Unparse(const AccClause::Detach &x) { |
917 | Word("DETACH" ); |
918 | Put("(" ); |
919 | Walk(x.v); |
920 | Put(")" ); |
921 | } |
922 | void Unparse(const AccClause::Device &x) { |
923 | Word("DEVICE" ); |
924 | Put("(" ); |
925 | Walk(x.v); |
926 | Put(")" ); |
927 | } |
928 | void Unparse(const AccClause::DeviceNum &x) { |
929 | Word("DEVICE_NUM" ); |
930 | Put("(" ); |
931 | Walk(x.v); |
932 | Put(")" ); |
933 | } |
934 | void Unparse(const AccClause::Deviceptr &x) { |
935 | Word("DEVICEPTR" ); |
936 | Put("(" ); |
937 | Walk(x.v); |
938 | Put(")" ); |
939 | } |
940 | void Unparse(const AccClause::DeviceResident &x) { |
941 | Word("DEVICE_RESIDENT" ); |
942 | Put("(" ); |
943 | Walk(x.v); |
944 | Put(")" ); |
945 | } |
946 | void Unparse(const AccClause::DeviceType &x) { |
947 | Word("DEVICE_TYPE" ); |
948 | Put("(" ); |
949 | Walk(x.v); |
950 | Put(")" ); |
951 | } |
952 | void Before(const AccClause::Finalize &) { Word("FINALIZE" ); } |
953 | void Unparse(const AccClause::Firstprivate &x) { |
954 | Word("FIRSTPRIVATE" ); |
955 | Put("(" ); |
956 | Walk(x.v); |
957 | Put(")" ); |
958 | } |
959 | void Unparse(const AccClause::Gang &x) { |
960 | Word("GANG" ); |
961 | Walk("(" , x.v, ")" ); |
962 | } |
963 | void Unparse(const AccClause::Host &x) { |
964 | Word("HOST" ); |
965 | Put("(" ); |
966 | Walk(x.v); |
967 | Put(")" ); |
968 | } |
969 | void Unparse(const AccClause::If &x) { |
970 | Word("IF" ); |
971 | Put("(" ); |
972 | Walk(x.v); |
973 | Put(")" ); |
974 | } |
975 | void Before(const AccClause::IfPresent &) { Word("IF_PRESENT" ); } |
976 | void Before(const AccClause::Independent &) { Word("INDEPENDENT" ); } |
977 | void Unparse(const AccClause::Link &x) { |
978 | Word("LINK" ); |
979 | Put("(" ); |
980 | Walk(x.v); |
981 | Put(")" ); |
982 | } |
983 | void Unparse(const AccClause::NoCreate &x) { |
984 | Word("NO_CREATE" ); |
985 | Put("(" ); |
986 | Walk(x.v); |
987 | Put(")" ); |
988 | } |
989 | void Before(const AccClause::Nohost &) { Word("NOHOST" ); } |
990 | void Unparse(const AccClause::NumGangs &x) { |
991 | Word("NUM_GANGS" ); |
992 | Put("(" ); |
993 | Walk(x.v, "," ); |
994 | Put(")" ); |
995 | } |
996 | void Unparse(const AccClause::NumWorkers &x) { |
997 | Word("NUM_WORKERS" ); |
998 | Put("(" ); |
999 | Walk(x.v); |
1000 | Put(")" ); |
1001 | } |
1002 | void Unparse(const AccClause::Present &x) { |
1003 | Word("PRESENT" ); |
1004 | Put("(" ); |
1005 | Walk(x.v); |
1006 | Put(")" ); |
1007 | } |
1008 | void Unparse(const AccClause::Private &x) { |
1009 | Word("PRIVATE" ); |
1010 | Put("(" ); |
1011 | Walk(x.v); |
1012 | Put(")" ); |
1013 | } |
1014 | void Before(const AccClause::Read &) { Word("READ" ); } |
1015 | void Unparse(const AccClause::Reduction &x) { |
1016 | Word("REDUCTION" ); |
1017 | Put("(" ); |
1018 | Walk(x.v); |
1019 | Put(")" ); |
1020 | } |
1021 | void Unparse(const AccClause::Self &x) { |
1022 | Word("SELF" ); |
1023 | Walk("(" , x.v, ")" ); |
1024 | } |
1025 | void Before(const AccClause::Seq &) { Word("SEQ" ); } |
1026 | void Unparse(const AccClause::Tile &x) { |
1027 | Word("TILE" ); |
1028 | Put("(" ); |
1029 | Walk(x.v); |
1030 | Put(")" ); |
1031 | } |
1032 | void Before(const AccClause::Unknown &) { Word("UNKNOWN" ); } |
1033 | void Unparse(const AccClause::UseDevice &x) { |
1034 | Word("USE_DEVICE" ); |
1035 | Put("(" ); |
1036 | Walk(x.v); |
1037 | Put(")" ); |
1038 | } |
1039 | void Unparse(const AccClause::Vector &x) { |
1040 | Word("VECTOR" ); |
1041 | Walk("(" , x.v, ")" ); |
1042 | } |
1043 | void Unparse(const AccClause::VectorLength &x) { |
1044 | Word("VECTOR_LENGTH" ); |
1045 | Put("(" ); |
1046 | Walk(x.v); |
1047 | Put(")" ); |
1048 | } |
1049 | void Unparse(const AccClause::Wait &x) { |
1050 | Word("WAIT" ); |
1051 | Walk("(" , x.v, ")" ); |
1052 | } |
1053 | void Unparse(const AccClause::Worker &x) { |
1054 | Word("WORKER" ); |
1055 | Walk("(" , x.v, ")" ); |
1056 | } |
1057 | void Before(const AccClause::Write &) { Word("WRITE" ); } |
1058 | |
1059 | #endif // GEN_FLANG_CLAUSE_UNPARSE |
1060 | |
1061 | #ifdef GEN_FLANG_CLAUSE_CHECK_ENTER |
1062 | #undef GEN_FLANG_CLAUSE_CHECK_ENTER |
1063 | |
1064 | void Enter(const parser::AccClause::Async &); |
1065 | void Enter(const parser::AccClause::Attach &); |
1066 | void Enter(const parser::AccClause::Auto &); |
1067 | void Enter(const parser::AccClause::Bind &); |
1068 | void Enter(const parser::AccClause::Capture &); |
1069 | void Enter(const parser::AccClause::Collapse &); |
1070 | void Enter(const parser::AccClause::Copy &); |
1071 | void Enter(const parser::AccClause::Copyin &); |
1072 | void Enter(const parser::AccClause::Copyout &); |
1073 | void Enter(const parser::AccClause::Create &); |
1074 | void Enter(const parser::AccClause::Default &); |
1075 | void Enter(const parser::AccClause::DefaultAsync &); |
1076 | void Enter(const parser::AccClause::Delete &); |
1077 | void Enter(const parser::AccClause::Detach &); |
1078 | void Enter(const parser::AccClause::Device &); |
1079 | void Enter(const parser::AccClause::DeviceNum &); |
1080 | void Enter(const parser::AccClause::Deviceptr &); |
1081 | void Enter(const parser::AccClause::DeviceResident &); |
1082 | void Enter(const parser::AccClause::DeviceType &); |
1083 | void Enter(const parser::AccClause::Finalize &); |
1084 | void Enter(const parser::AccClause::Firstprivate &); |
1085 | void Enter(const parser::AccClause::Gang &); |
1086 | void Enter(const parser::AccClause::Host &); |
1087 | void Enter(const parser::AccClause::If &); |
1088 | void Enter(const parser::AccClause::IfPresent &); |
1089 | void Enter(const parser::AccClause::Independent &); |
1090 | void Enter(const parser::AccClause::Link &); |
1091 | void Enter(const parser::AccClause::NoCreate &); |
1092 | void Enter(const parser::AccClause::Nohost &); |
1093 | void Enter(const parser::AccClause::NumGangs &); |
1094 | void Enter(const parser::AccClause::NumWorkers &); |
1095 | void Enter(const parser::AccClause::Present &); |
1096 | void Enter(const parser::AccClause::Private &); |
1097 | void Enter(const parser::AccClause::Read &); |
1098 | void Enter(const parser::AccClause::Reduction &); |
1099 | void Enter(const parser::AccClause::Self &); |
1100 | void Enter(const parser::AccClause::Seq &); |
1101 | void Enter(const parser::AccClause::Tile &); |
1102 | void Enter(const parser::AccClause::Unknown &); |
1103 | void Enter(const parser::AccClause::UseDevice &); |
1104 | void Enter(const parser::AccClause::Vector &); |
1105 | void Enter(const parser::AccClause::VectorLength &); |
1106 | void Enter(const parser::AccClause::Wait &); |
1107 | void Enter(const parser::AccClause::Worker &); |
1108 | void Enter(const parser::AccClause::Write &); |
1109 | |
1110 | #endif // GEN_FLANG_CLAUSE_CHECK_ENTER |
1111 | |
1112 | #ifdef GEN_FLANG_CLAUSE_PARSER_KIND_MAP |
1113 | #undef GEN_FLANG_CLAUSE_PARSER_KIND_MAP |
1114 | |
1115 | if constexpr (std::is_same_v<A, parser::AccClause::Async>) |
1116 | return llvm::acc::Clause::ACCC_async; |
1117 | if constexpr (std::is_same_v<A, parser::AccClause::Attach>) |
1118 | return llvm::acc::Clause::ACCC_attach; |
1119 | if constexpr (std::is_same_v<A, parser::AccClause::Auto>) |
1120 | return llvm::acc::Clause::ACCC_auto; |
1121 | if constexpr (std::is_same_v<A, parser::AccClause::Bind>) |
1122 | return llvm::acc::Clause::ACCC_bind; |
1123 | if constexpr (std::is_same_v<A, parser::AccClause::Capture>) |
1124 | return llvm::acc::Clause::ACCC_capture; |
1125 | if constexpr (std::is_same_v<A, parser::AccClause::Collapse>) |
1126 | return llvm::acc::Clause::ACCC_collapse; |
1127 | if constexpr (std::is_same_v<A, parser::AccClause::Copy>) |
1128 | return llvm::acc::Clause::ACCC_copy; |
1129 | if constexpr (std::is_same_v<A, parser::AccClause::Copyin>) |
1130 | return llvm::acc::Clause::ACCC_copyin; |
1131 | if constexpr (std::is_same_v<A, parser::AccClause::Copyout>) |
1132 | return llvm::acc::Clause::ACCC_copyout; |
1133 | if constexpr (std::is_same_v<A, parser::AccClause::Create>) |
1134 | return llvm::acc::Clause::ACCC_create; |
1135 | if constexpr (std::is_same_v<A, parser::AccClause::Default>) |
1136 | return llvm::acc::Clause::ACCC_default; |
1137 | if constexpr (std::is_same_v<A, parser::AccClause::DefaultAsync>) |
1138 | return llvm::acc::Clause::ACCC_default_async; |
1139 | if constexpr (std::is_same_v<A, parser::AccClause::Delete>) |
1140 | return llvm::acc::Clause::ACCC_delete; |
1141 | if constexpr (std::is_same_v<A, parser::AccClause::Detach>) |
1142 | return llvm::acc::Clause::ACCC_detach; |
1143 | if constexpr (std::is_same_v<A, parser::AccClause::Device>) |
1144 | return llvm::acc::Clause::ACCC_device; |
1145 | if constexpr (std::is_same_v<A, parser::AccClause::DeviceNum>) |
1146 | return llvm::acc::Clause::ACCC_device_num; |
1147 | if constexpr (std::is_same_v<A, parser::AccClause::Deviceptr>) |
1148 | return llvm::acc::Clause::ACCC_deviceptr; |
1149 | if constexpr (std::is_same_v<A, parser::AccClause::DeviceResident>) |
1150 | return llvm::acc::Clause::ACCC_device_resident; |
1151 | if constexpr (std::is_same_v<A, parser::AccClause::DeviceType>) |
1152 | return llvm::acc::Clause::ACCC_device_type; |
1153 | if constexpr (std::is_same_v<A, parser::AccClause::Finalize>) |
1154 | return llvm::acc::Clause::ACCC_finalize; |
1155 | if constexpr (std::is_same_v<A, parser::AccClause::Firstprivate>) |
1156 | return llvm::acc::Clause::ACCC_firstprivate; |
1157 | if constexpr (std::is_same_v<A, parser::AccClause::Gang>) |
1158 | return llvm::acc::Clause::ACCC_gang; |
1159 | if constexpr (std::is_same_v<A, parser::AccClause::Host>) |
1160 | return llvm::acc::Clause::ACCC_host; |
1161 | if constexpr (std::is_same_v<A, parser::AccClause::If>) |
1162 | return llvm::acc::Clause::ACCC_if; |
1163 | if constexpr (std::is_same_v<A, parser::AccClause::IfPresent>) |
1164 | return llvm::acc::Clause::ACCC_if_present; |
1165 | if constexpr (std::is_same_v<A, parser::AccClause::Independent>) |
1166 | return llvm::acc::Clause::ACCC_independent; |
1167 | if constexpr (std::is_same_v<A, parser::AccClause::Link>) |
1168 | return llvm::acc::Clause::ACCC_link; |
1169 | if constexpr (std::is_same_v<A, parser::AccClause::NoCreate>) |
1170 | return llvm::acc::Clause::ACCC_no_create; |
1171 | if constexpr (std::is_same_v<A, parser::AccClause::Nohost>) |
1172 | return llvm::acc::Clause::ACCC_nohost; |
1173 | if constexpr (std::is_same_v<A, parser::AccClause::NumGangs>) |
1174 | return llvm::acc::Clause::ACCC_num_gangs; |
1175 | if constexpr (std::is_same_v<A, parser::AccClause::NumWorkers>) |
1176 | return llvm::acc::Clause::ACCC_num_workers; |
1177 | if constexpr (std::is_same_v<A, parser::AccClause::Present>) |
1178 | return llvm::acc::Clause::ACCC_present; |
1179 | if constexpr (std::is_same_v<A, parser::AccClause::Private>) |
1180 | return llvm::acc::Clause::ACCC_private; |
1181 | if constexpr (std::is_same_v<A, parser::AccClause::Read>) |
1182 | return llvm::acc::Clause::ACCC_read; |
1183 | if constexpr (std::is_same_v<A, parser::AccClause::Reduction>) |
1184 | return llvm::acc::Clause::ACCC_reduction; |
1185 | if constexpr (std::is_same_v<A, parser::AccClause::Self>) |
1186 | return llvm::acc::Clause::ACCC_self; |
1187 | if constexpr (std::is_same_v<A, parser::AccClause::Seq>) |
1188 | return llvm::acc::Clause::ACCC_seq; |
1189 | if constexpr (std::is_same_v<A, parser::AccClause::Tile>) |
1190 | return llvm::acc::Clause::ACCC_tile; |
1191 | if constexpr (std::is_same_v<A, parser::AccClause::Unknown>) |
1192 | return llvm::acc::Clause::ACCC_unknown; |
1193 | if constexpr (std::is_same_v<A, parser::AccClause::UseDevice>) |
1194 | return llvm::acc::Clause::ACCC_use_device; |
1195 | if constexpr (std::is_same_v<A, parser::AccClause::Vector>) |
1196 | return llvm::acc::Clause::ACCC_vector; |
1197 | if constexpr (std::is_same_v<A, parser::AccClause::VectorLength>) |
1198 | return llvm::acc::Clause::ACCC_vector_length; |
1199 | if constexpr (std::is_same_v<A, parser::AccClause::Wait>) |
1200 | return llvm::acc::Clause::ACCC_wait; |
1201 | if constexpr (std::is_same_v<A, parser::AccClause::Worker>) |
1202 | return llvm::acc::Clause::ACCC_worker; |
1203 | if constexpr (std::is_same_v<A, parser::AccClause::Write>) |
1204 | return llvm::acc::Clause::ACCC_write; |
1205 | llvm_unreachable("Invalid OpenACC Parser clause" ); |
1206 | |
1207 | #endif // GEN_FLANG_CLAUSE_PARSER_KIND_MAP |
1208 | |
1209 | #ifdef GEN_FLANG_CLAUSES_PARSER |
1210 | #undef GEN_FLANG_CLAUSES_PARSER |
1211 | |
1212 | TYPE_PARSER( |
1213 | "write" >> construct<AccClause>(construct<AccClause::Write>()) || |
1214 | "worker" >> construct<AccClause>(construct<AccClause::Worker>(maybe(parenthesized("num:" >> scalarIntExpr || scalarIntExpr)))) || |
1215 | "wait" >> construct<AccClause>(construct<AccClause::Wait>(maybe(parenthesized(Parser<AccWaitArgument>{})))) || |
1216 | "vector_length" >> construct<AccClause>(construct<AccClause::VectorLength>(parenthesized(scalarIntExpr))) || |
1217 | "vector" >> construct<AccClause>(construct<AccClause::Vector>(maybe(parenthesized("length:" >> scalarIntExpr || scalarIntExpr)))) || |
1218 | "use_device" >> construct<AccClause>(construct<AccClause::UseDevice>(parenthesized(Parser<AccObjectList>{}))) || |
1219 | "unknown" >> construct<AccClause>(construct<AccClause::Unknown>()) || |
1220 | "tile" >> construct<AccClause>(construct<AccClause::Tile>(parenthesized(Parser<AccTileExprList>{}))) || |
1221 | "seq" >> construct<AccClause>(construct<AccClause::Seq>()) || |
1222 | "self" >> construct<AccClause>(construct<AccClause::Self>(maybe(parenthesized(Parser<AccSelfClause>{})))) || |
1223 | "reduction" >> construct<AccClause>(construct<AccClause::Reduction>(parenthesized(Parser<AccObjectListWithReduction>{}))) || |
1224 | "read" >> construct<AccClause>(construct<AccClause::Read>()) || |
1225 | "private" >> construct<AccClause>(construct<AccClause::Private>(parenthesized(Parser<AccObjectList>{}))) || |
1226 | "present" >> construct<AccClause>(construct<AccClause::Present>(parenthesized(Parser<AccObjectList>{}))) || |
1227 | "num_workers" >> construct<AccClause>(construct<AccClause::NumWorkers>(parenthesized(scalarIntExpr))) || |
1228 | "num_gangs" >> construct<AccClause>(construct<AccClause::NumGangs>(parenthesized(nonemptyList(scalarIntExpr)))) || |
1229 | "nohost" >> construct<AccClause>(construct<AccClause::Nohost>()) || |
1230 | "no_create" >> construct<AccClause>(construct<AccClause::NoCreate>(parenthesized(Parser<AccObjectList>{}))) || |
1231 | "link" >> construct<AccClause>(construct<AccClause::Link>(parenthesized(Parser<AccObjectList>{}))) || |
1232 | "independent" >> construct<AccClause>(construct<AccClause::Independent>()) || |
1233 | "if_present" >> construct<AccClause>(construct<AccClause::IfPresent>()) || |
1234 | "if" >> construct<AccClause>(construct<AccClause::If>(parenthesized(scalarExpr))) || |
1235 | "host" >> construct<AccClause>(construct<AccClause::Host>(parenthesized(Parser<AccObjectList>{}))) || |
1236 | "gang" >> construct<AccClause>(construct<AccClause::Gang>(maybe(parenthesized(Parser<AccGangArgList>{})))) || |
1237 | "firstprivate" >> construct<AccClause>(construct<AccClause::Firstprivate>(parenthesized(Parser<AccObjectList>{}))) || |
1238 | "finalize" >> construct<AccClause>(construct<AccClause::Finalize>()) || |
1239 | "deviceptr" >> construct<AccClause>(construct<AccClause::Deviceptr>(parenthesized(Parser<AccObjectList>{}))) || |
1240 | ("device_type"_tok || "dtype"_tok ) >> construct<AccClause>(construct<AccClause::DeviceType>(parenthesized(Parser<AccDeviceTypeExprList>{}))) || |
1241 | "device_resident" >> construct<AccClause>(construct<AccClause::DeviceResident>(parenthesized(Parser<AccObjectList>{}))) || |
1242 | "device_num" >> construct<AccClause>(construct<AccClause::DeviceNum>(parenthesized(scalarIntExpr))) || |
1243 | "device" >> construct<AccClause>(construct<AccClause::Device>(parenthesized(Parser<AccObjectList>{}))) || |
1244 | "detach" >> construct<AccClause>(construct<AccClause::Detach>(parenthesized(Parser<AccObjectList>{}))) || |
1245 | "delete" >> construct<AccClause>(construct<AccClause::Delete>(parenthesized(Parser<AccObjectList>{}))) || |
1246 | "default_async" >> construct<AccClause>(construct<AccClause::DefaultAsync>(parenthesized(scalarIntExpr))) || |
1247 | "default" >> construct<AccClause>(construct<AccClause::Default>(parenthesized(Parser<AccDefaultClause>{}))) || |
1248 | ("create"_tok || "present_or_create"_tok || "pcreate"_tok ) >> construct<AccClause>(construct<AccClause::Create>(parenthesized(Parser<AccObjectListWithModifier>{}))) || |
1249 | ("copyout"_tok || "present_or_copyout"_tok || "pcopyout"_tok ) >> construct<AccClause>(construct<AccClause::Copyout>(parenthesized(Parser<AccObjectListWithModifier>{}))) || |
1250 | ("copyin"_tok || "present_or_copyin"_tok || "pcopyin"_tok ) >> construct<AccClause>(construct<AccClause::Copyin>(parenthesized(Parser<AccObjectListWithModifier>{}))) || |
1251 | ("copy"_tok || "present_or_copy"_tok || "pcopy"_tok ) >> construct<AccClause>(construct<AccClause::Copy>(parenthesized(Parser<AccObjectList>{}))) || |
1252 | "collapse" >> construct<AccClause>(construct<AccClause::Collapse>(parenthesized(Parser<AccCollapseArg>{}))) || |
1253 | "capture" >> construct<AccClause>(construct<AccClause::Capture>()) || |
1254 | "bind" >> construct<AccClause>(construct<AccClause::Bind>(parenthesized(Parser<AccBindClause>{}))) || |
1255 | "auto" >> construct<AccClause>(construct<AccClause::Auto>()) || |
1256 | "attach" >> construct<AccClause>(construct<AccClause::Attach>(parenthesized(Parser<AccObjectList>{}))) || |
1257 | "async" >> construct<AccClause>(construct<AccClause::Async>(maybe(parenthesized(scalarIntExpr)))) |
1258 | ) |
1259 | |
1260 | #endif // GEN_FLANG_CLAUSES_PARSER |
1261 | |
1262 | #ifdef GEN_CLANG_CLAUSE_CLASS |
1263 | #undef GEN_CLANG_CLAUSE_CLASS |
1264 | |
1265 | #ifndef CLAUSE |
1266 | #define CLAUSE(Enum, Str, Implicit) |
1267 | #endif |
1268 | #ifndef CLAUSE_CLASS |
1269 | #define CLAUSE_CLASS(Enum, Str, Class) |
1270 | #endif |
1271 | #ifndef CLAUSE_NO_CLASS |
1272 | #define CLAUSE_NO_CLASS(Enum, Str) |
1273 | #endif |
1274 | |
1275 | #define __CLAUSE(Name, Class) \ |
1276 | CLAUSE(ACCC_##Name, #Name, /* Implicit */ false) \ |
1277 | CLAUSE_CLASS(ACCC_##Name, #Name, Class) |
1278 | #define __CLAUSE_NO_CLASS(Name) \ |
1279 | CLAUSE(ACCC_##Name, #Name, /* Implicit */ false) \ |
1280 | CLAUSE_NO_CLASS(ACCC_##Name, #Name) |
1281 | #define __IMPLICIT_CLAUSE_CLASS(Name, Str, Class) \ |
1282 | CLAUSE(ACCC_##Name, Str, /* Implicit */ true) \ |
1283 | CLAUSE_CLASS(ACCC_##Name, Str, Class) |
1284 | #define __IMPLICIT_CLAUSE_NO_CLASS(Name, Str) \ |
1285 | CLAUSE(ACCC_##Name, Str, /* Implicit */ true) \ |
1286 | CLAUSE_NO_CLASS(ACCC_##Name, Str) |
1287 | |
1288 | __CLAUSE_NO_CLASS(async) |
1289 | __CLAUSE_NO_CLASS(attach) |
1290 | __CLAUSE_NO_CLASS(auto) |
1291 | __CLAUSE_NO_CLASS(bind) |
1292 | __CLAUSE_NO_CLASS(capture) |
1293 | __CLAUSE_NO_CLASS(collapse) |
1294 | __CLAUSE_NO_CLASS(copy) |
1295 | __CLAUSE_NO_CLASS(copyin) |
1296 | __CLAUSE_NO_CLASS(copyout) |
1297 | __CLAUSE_NO_CLASS(create) |
1298 | __CLAUSE_NO_CLASS(default) |
1299 | __CLAUSE_NO_CLASS(default_async) |
1300 | __CLAUSE_NO_CLASS(delete) |
1301 | __CLAUSE_NO_CLASS(detach) |
1302 | __CLAUSE_NO_CLASS(device) |
1303 | __CLAUSE_NO_CLASS(device_num) |
1304 | __CLAUSE_NO_CLASS(deviceptr) |
1305 | __CLAUSE_NO_CLASS(device_resident) |
1306 | __CLAUSE_NO_CLASS(device_type) |
1307 | __CLAUSE_NO_CLASS(finalize) |
1308 | __CLAUSE_NO_CLASS(firstprivate) |
1309 | __CLAUSE_NO_CLASS(gang) |
1310 | __CLAUSE_NO_CLASS(host) |
1311 | __CLAUSE_NO_CLASS(if) |
1312 | __CLAUSE_NO_CLASS(if_present) |
1313 | __CLAUSE_NO_CLASS(independent) |
1314 | __CLAUSE_NO_CLASS(link) |
1315 | __CLAUSE_NO_CLASS(no_create) |
1316 | __CLAUSE_NO_CLASS(nohost) |
1317 | __CLAUSE_NO_CLASS(num_gangs) |
1318 | __CLAUSE_NO_CLASS(num_workers) |
1319 | __CLAUSE_NO_CLASS(present) |
1320 | __CLAUSE_NO_CLASS(private) |
1321 | __CLAUSE_NO_CLASS(read) |
1322 | __CLAUSE_NO_CLASS(reduction) |
1323 | __CLAUSE_NO_CLASS(self) |
1324 | __CLAUSE_NO_CLASS(seq) |
1325 | __CLAUSE_NO_CLASS(tile) |
1326 | __CLAUSE_NO_CLASS(unknown) |
1327 | __CLAUSE_NO_CLASS(use_device) |
1328 | __CLAUSE_NO_CLASS(vector) |
1329 | __CLAUSE_NO_CLASS(vector_length) |
1330 | __CLAUSE_NO_CLASS(wait) |
1331 | __CLAUSE_NO_CLASS(worker) |
1332 | __CLAUSE_NO_CLASS(write) |
1333 | |
1334 | #undef __IMPLICIT_CLAUSE_NO_CLASS |
1335 | #undef __IMPLICIT_CLAUSE_CLASS |
1336 | #undef __CLAUSE_NO_CLASS |
1337 | #undef __CLAUSE |
1338 | #undef CLAUSE_NO_CLASS |
1339 | #undef CLAUSE_CLASS |
1340 | #undef CLAUSE |
1341 | |
1342 | #endif // GEN_CLANG_CLAUSE_CLASS |
1343 | |
1344 | #ifdef GEN_DIRECTIVES_IMPL |
1345 | #undef GEN_DIRECTIVES_IMPL |
1346 | |
1347 | #include "llvm/Support/ErrorHandling.h" |
1348 | |
1349 | Directive llvm::acc::getOpenACCDirectiveKind(llvm::StringRef Str) { |
1350 | return llvm::StringSwitch<Directive>(Str) |
1351 | .Case(S: "atomic" ,Value: ACCD_atomic) |
1352 | .Case(S: "cache" ,Value: ACCD_cache) |
1353 | .Case(S: "data" ,Value: ACCD_data) |
1354 | .Case(S: "declare" ,Value: ACCD_declare) |
1355 | .Case(S: "enter data" ,Value: ACCD_enter_data) |
1356 | .Case(S: "exit data" ,Value: ACCD_exit_data) |
1357 | .Case(S: "host_data" ,Value: ACCD_host_data) |
1358 | .Case(S: "init" ,Value: ACCD_init) |
1359 | .Case(S: "kernels" ,Value: ACCD_kernels) |
1360 | .Case(S: "kernels loop" ,Value: ACCD_kernels_loop) |
1361 | .Case(S: "loop" ,Value: ACCD_loop) |
1362 | .Case(S: "parallel" ,Value: ACCD_parallel) |
1363 | .Case(S: "parallel loop" ,Value: ACCD_parallel_loop) |
1364 | .Case(S: "routine" ,Value: ACCD_routine) |
1365 | .Case(S: "serial" ,Value: ACCD_serial) |
1366 | .Case(S: "serial loop" ,Value: ACCD_serial_loop) |
1367 | .Case(S: "set" ,Value: ACCD_set) |
1368 | .Case(S: "shutdown" ,Value: ACCD_shutdown) |
1369 | .Case(S: "unknown" ,Value: ACCD_unknown) |
1370 | .Case(S: "update" ,Value: ACCD_update) |
1371 | .Case(S: "wait" ,Value: ACCD_wait) |
1372 | .Default(Value: ACCD_unknown); |
1373 | } |
1374 | |
1375 | llvm::StringRef llvm::acc::getOpenACCDirectiveName(Directive Kind) { |
1376 | switch (Kind) { |
1377 | case ACCD_atomic: |
1378 | return "atomic" ; |
1379 | case ACCD_cache: |
1380 | return "cache" ; |
1381 | case ACCD_data: |
1382 | return "data" ; |
1383 | case ACCD_declare: |
1384 | return "declare" ; |
1385 | case ACCD_enter_data: |
1386 | return "enter data" ; |
1387 | case ACCD_exit_data: |
1388 | return "exit data" ; |
1389 | case ACCD_host_data: |
1390 | return "host_data" ; |
1391 | case ACCD_init: |
1392 | return "init" ; |
1393 | case ACCD_kernels: |
1394 | return "kernels" ; |
1395 | case ACCD_kernels_loop: |
1396 | return "kernels loop" ; |
1397 | case ACCD_loop: |
1398 | return "loop" ; |
1399 | case ACCD_parallel: |
1400 | return "parallel" ; |
1401 | case ACCD_parallel_loop: |
1402 | return "parallel loop" ; |
1403 | case ACCD_routine: |
1404 | return "routine" ; |
1405 | case ACCD_serial: |
1406 | return "serial" ; |
1407 | case ACCD_serial_loop: |
1408 | return "serial loop" ; |
1409 | case ACCD_set: |
1410 | return "set" ; |
1411 | case ACCD_shutdown: |
1412 | return "shutdown" ; |
1413 | case ACCD_unknown: |
1414 | return "unknown" ; |
1415 | case ACCD_update: |
1416 | return "update" ; |
1417 | case ACCD_wait: |
1418 | return "wait" ; |
1419 | } |
1420 | llvm_unreachable("Invalid OpenACC Directive kind" ); |
1421 | } |
1422 | |
1423 | Clause llvm::acc::getOpenACCClauseKind(llvm::StringRef Str) { |
1424 | return llvm::StringSwitch<Clause>(Str) |
1425 | .Case(S: "async" ,Value: ACCC_async) |
1426 | .Case(S: "attach" ,Value: ACCC_attach) |
1427 | .Case(S: "auto" ,Value: ACCC_auto) |
1428 | .Case(S: "bind" ,Value: ACCC_bind) |
1429 | .Case(S: "capture" ,Value: ACCC_capture) |
1430 | .Case(S: "collapse" ,Value: ACCC_collapse) |
1431 | .Case(S: "copy" ,Value: ACCC_copy) |
1432 | .Case(S: "copyin" ,Value: ACCC_copyin) |
1433 | .Case(S: "copyout" ,Value: ACCC_copyout) |
1434 | .Case(S: "create" ,Value: ACCC_create) |
1435 | .Case(S: "default" ,Value: ACCC_default) |
1436 | .Case(S: "default_async" ,Value: ACCC_default_async) |
1437 | .Case(S: "delete" ,Value: ACCC_delete) |
1438 | .Case(S: "detach" ,Value: ACCC_detach) |
1439 | .Case(S: "device" ,Value: ACCC_device) |
1440 | .Case(S: "device_num" ,Value: ACCC_device_num) |
1441 | .Case(S: "deviceptr" ,Value: ACCC_deviceptr) |
1442 | .Case(S: "device_resident" ,Value: ACCC_device_resident) |
1443 | .Case(S: "device_type" ,Value: ACCC_device_type) |
1444 | .Case(S: "finalize" ,Value: ACCC_finalize) |
1445 | .Case(S: "firstprivate" ,Value: ACCC_firstprivate) |
1446 | .Case(S: "gang" ,Value: ACCC_gang) |
1447 | .Case(S: "host" ,Value: ACCC_host) |
1448 | .Case(S: "if" ,Value: ACCC_if) |
1449 | .Case(S: "if_present" ,Value: ACCC_if_present) |
1450 | .Case(S: "independent" ,Value: ACCC_independent) |
1451 | .Case(S: "link" ,Value: ACCC_link) |
1452 | .Case(S: "no_create" ,Value: ACCC_no_create) |
1453 | .Case(S: "nohost" ,Value: ACCC_nohost) |
1454 | .Case(S: "num_gangs" ,Value: ACCC_num_gangs) |
1455 | .Case(S: "num_workers" ,Value: ACCC_num_workers) |
1456 | .Case(S: "present" ,Value: ACCC_present) |
1457 | .Case(S: "private" ,Value: ACCC_private) |
1458 | .Case(S: "read" ,Value: ACCC_read) |
1459 | .Case(S: "reduction" ,Value: ACCC_reduction) |
1460 | .Case(S: "self" ,Value: ACCC_self) |
1461 | .Case(S: "seq" ,Value: ACCC_seq) |
1462 | .Case(S: "tile" ,Value: ACCC_tile) |
1463 | .Case(S: "unknown" ,Value: ACCC_unknown) |
1464 | .Case(S: "use_device" ,Value: ACCC_use_device) |
1465 | .Case(S: "vector" ,Value: ACCC_vector) |
1466 | .Case(S: "vector_length" ,Value: ACCC_vector_length) |
1467 | .Case(S: "wait" ,Value: ACCC_wait) |
1468 | .Case(S: "worker" ,Value: ACCC_worker) |
1469 | .Case(S: "write" ,Value: ACCC_write) |
1470 | .Default(Value: ACCC_unknown); |
1471 | } |
1472 | |
1473 | llvm::StringRef llvm::acc::getOpenACCClauseName(Clause Kind) { |
1474 | switch (Kind) { |
1475 | case ACCC_async: |
1476 | return "async" ; |
1477 | case ACCC_attach: |
1478 | return "attach" ; |
1479 | case ACCC_auto: |
1480 | return "auto" ; |
1481 | case ACCC_bind: |
1482 | return "bind" ; |
1483 | case ACCC_capture: |
1484 | return "capture" ; |
1485 | case ACCC_collapse: |
1486 | return "collapse" ; |
1487 | case ACCC_copy: |
1488 | return "copy" ; |
1489 | case ACCC_copyin: |
1490 | return "copyin" ; |
1491 | case ACCC_copyout: |
1492 | return "copyout" ; |
1493 | case ACCC_create: |
1494 | return "create" ; |
1495 | case ACCC_default: |
1496 | return "default" ; |
1497 | case ACCC_default_async: |
1498 | return "default_async" ; |
1499 | case ACCC_delete: |
1500 | return "delete" ; |
1501 | case ACCC_detach: |
1502 | return "detach" ; |
1503 | case ACCC_device: |
1504 | return "device" ; |
1505 | case ACCC_device_num: |
1506 | return "device_num" ; |
1507 | case ACCC_deviceptr: |
1508 | return "deviceptr" ; |
1509 | case ACCC_device_resident: |
1510 | return "device_resident" ; |
1511 | case ACCC_device_type: |
1512 | return "device_type" ; |
1513 | case ACCC_finalize: |
1514 | return "finalize" ; |
1515 | case ACCC_firstprivate: |
1516 | return "firstprivate" ; |
1517 | case ACCC_gang: |
1518 | return "gang" ; |
1519 | case ACCC_host: |
1520 | return "host" ; |
1521 | case ACCC_if: |
1522 | return "if" ; |
1523 | case ACCC_if_present: |
1524 | return "if_present" ; |
1525 | case ACCC_independent: |
1526 | return "independent" ; |
1527 | case ACCC_link: |
1528 | return "link" ; |
1529 | case ACCC_no_create: |
1530 | return "no_create" ; |
1531 | case ACCC_nohost: |
1532 | return "nohost" ; |
1533 | case ACCC_num_gangs: |
1534 | return "num_gangs" ; |
1535 | case ACCC_num_workers: |
1536 | return "num_workers" ; |
1537 | case ACCC_present: |
1538 | return "present" ; |
1539 | case ACCC_private: |
1540 | return "private" ; |
1541 | case ACCC_read: |
1542 | return "read" ; |
1543 | case ACCC_reduction: |
1544 | return "reduction" ; |
1545 | case ACCC_self: |
1546 | return "self" ; |
1547 | case ACCC_seq: |
1548 | return "seq" ; |
1549 | case ACCC_tile: |
1550 | return "tile" ; |
1551 | case ACCC_unknown: |
1552 | return "unknown" ; |
1553 | case ACCC_use_device: |
1554 | return "use_device" ; |
1555 | case ACCC_vector: |
1556 | return "vector" ; |
1557 | case ACCC_vector_length: |
1558 | return "vector_length" ; |
1559 | case ACCC_wait: |
1560 | return "wait" ; |
1561 | case ACCC_worker: |
1562 | return "worker" ; |
1563 | case ACCC_write: |
1564 | return "write" ; |
1565 | } |
1566 | llvm_unreachable("Invalid OpenACC Clause kind" ); |
1567 | } |
1568 | |
1569 | DefaultValue llvm::acc::getDefaultValue(llvm::StringRef Str) { |
1570 | return llvm::StringSwitch<DefaultValue>(Str) |
1571 | .Case(S: "present" ,Value: ACC_Default_present) |
1572 | .Case(S: "none" ,Value: ACC_Default_none) |
1573 | .Default(Value: ACC_Default_none); |
1574 | } |
1575 | |
1576 | llvm::StringRef llvm::acc::getOpenACCDefaultValueName(llvm::acc::DefaultValue x) { |
1577 | switch (x) { |
1578 | case ACC_Default_present: |
1579 | return "present" ; |
1580 | case ACC_Default_none: |
1581 | return "none" ; |
1582 | } |
1583 | llvm_unreachable("Invalid OpenACC DefaultValue kind" ); |
1584 | } |
1585 | |
1586 | bool llvm::acc::isAllowedClauseForDirective(Directive D, Clause C, unsigned Version) { |
1587 | assert(unsigned(D) <= llvm::acc::Directive_enumSize); |
1588 | assert(unsigned(C) <= llvm::acc::Clause_enumSize); |
1589 | switch (D) { |
1590 | case ACCD_atomic: |
1591 | return false; |
1592 | break; |
1593 | case ACCD_cache: |
1594 | return false; |
1595 | break; |
1596 | case ACCD_data: |
1597 | switch (C) { |
1598 | case ACCC_device_type: |
1599 | return 32 <= Version && 2147483647 >= Version; |
1600 | case ACCC_wait: |
1601 | return 32 <= Version && 2147483647 >= Version; |
1602 | case ACCC_async: |
1603 | return 32 <= Version && 2147483647 >= Version; |
1604 | case ACCC_if: |
1605 | return 1 <= Version && 2147483647 >= Version; |
1606 | case ACCC_default: |
1607 | return 1 <= Version && 2147483647 >= Version; |
1608 | case ACCC_attach: |
1609 | return 1 <= Version && 2147483647 >= Version; |
1610 | case ACCC_copy: |
1611 | return 1 <= Version && 2147483647 >= Version; |
1612 | case ACCC_copyin: |
1613 | return 1 <= Version && 2147483647 >= Version; |
1614 | case ACCC_copyout: |
1615 | return 1 <= Version && 2147483647 >= Version; |
1616 | case ACCC_create: |
1617 | return 1 <= Version && 2147483647 >= Version; |
1618 | case ACCC_deviceptr: |
1619 | return 1 <= Version && 2147483647 >= Version; |
1620 | case ACCC_no_create: |
1621 | return 1 <= Version && 2147483647 >= Version; |
1622 | case ACCC_present: |
1623 | return 1 <= Version && 2147483647 >= Version; |
1624 | default: |
1625 | return false; |
1626 | } |
1627 | break; |
1628 | case ACCD_declare: |
1629 | switch (C) { |
1630 | case ACCC_copy: |
1631 | return 1 <= Version && 2147483647 >= Version; |
1632 | case ACCC_copyin: |
1633 | return 1 <= Version && 2147483647 >= Version; |
1634 | case ACCC_copyout: |
1635 | return 1 <= Version && 2147483647 >= Version; |
1636 | case ACCC_create: |
1637 | return 1 <= Version && 2147483647 >= Version; |
1638 | case ACCC_present: |
1639 | return 1 <= Version && 2147483647 >= Version; |
1640 | case ACCC_deviceptr: |
1641 | return 1 <= Version && 2147483647 >= Version; |
1642 | case ACCC_device_resident: |
1643 | return 1 <= Version && 2147483647 >= Version; |
1644 | case ACCC_link: |
1645 | return 1 <= Version && 2147483647 >= Version; |
1646 | default: |
1647 | return false; |
1648 | } |
1649 | break; |
1650 | case ACCD_enter_data: |
1651 | switch (C) { |
1652 | case ACCC_wait: |
1653 | return 1 <= Version && 2147483647 >= Version; |
1654 | case ACCC_async: |
1655 | return 1 <= Version && 2147483647 >= Version; |
1656 | case ACCC_if: |
1657 | return 1 <= Version && 2147483647 >= Version; |
1658 | case ACCC_attach: |
1659 | return 1 <= Version && 2147483647 >= Version; |
1660 | case ACCC_create: |
1661 | return 1 <= Version && 2147483647 >= Version; |
1662 | case ACCC_copyin: |
1663 | return 1 <= Version && 2147483647 >= Version; |
1664 | default: |
1665 | return false; |
1666 | } |
1667 | break; |
1668 | case ACCD_exit_data: |
1669 | switch (C) { |
1670 | case ACCC_wait: |
1671 | return 1 <= Version && 2147483647 >= Version; |
1672 | case ACCC_async: |
1673 | return 1 <= Version && 2147483647 >= Version; |
1674 | case ACCC_if: |
1675 | return 1 <= Version && 2147483647 >= Version; |
1676 | case ACCC_finalize: |
1677 | return 1 <= Version && 2147483647 >= Version; |
1678 | case ACCC_copyout: |
1679 | return 1 <= Version && 2147483647 >= Version; |
1680 | case ACCC_delete: |
1681 | return 1 <= Version && 2147483647 >= Version; |
1682 | case ACCC_detach: |
1683 | return 1 <= Version && 2147483647 >= Version; |
1684 | default: |
1685 | return false; |
1686 | } |
1687 | break; |
1688 | case ACCD_host_data: |
1689 | switch (C) { |
1690 | case ACCC_if: |
1691 | return 1 <= Version && 2147483647 >= Version; |
1692 | case ACCC_if_present: |
1693 | return 1 <= Version && 2147483647 >= Version; |
1694 | case ACCC_use_device: |
1695 | return 1 <= Version && 2147483647 >= Version; |
1696 | default: |
1697 | return false; |
1698 | } |
1699 | break; |
1700 | case ACCD_init: |
1701 | switch (C) { |
1702 | case ACCC_device_num: |
1703 | return 1 <= Version && 2147483647 >= Version; |
1704 | case ACCC_device_type: |
1705 | return 1 <= Version && 2147483647 >= Version; |
1706 | case ACCC_if: |
1707 | return 1 <= Version && 2147483647 >= Version; |
1708 | default: |
1709 | return false; |
1710 | } |
1711 | break; |
1712 | case ACCD_kernels: |
1713 | switch (C) { |
1714 | case ACCC_attach: |
1715 | return 1 <= Version && 2147483647 >= Version; |
1716 | case ACCC_copy: |
1717 | return 1 <= Version && 2147483647 >= Version; |
1718 | case ACCC_copyin: |
1719 | return 1 <= Version && 2147483647 >= Version; |
1720 | case ACCC_copyout: |
1721 | return 1 <= Version && 2147483647 >= Version; |
1722 | case ACCC_create: |
1723 | return 1 <= Version && 2147483647 >= Version; |
1724 | case ACCC_device_type: |
1725 | return 1 <= Version && 2147483647 >= Version; |
1726 | case ACCC_no_create: |
1727 | return 1 <= Version && 2147483647 >= Version; |
1728 | case ACCC_present: |
1729 | return 1 <= Version && 2147483647 >= Version; |
1730 | case ACCC_deviceptr: |
1731 | return 1 <= Version && 2147483647 >= Version; |
1732 | case ACCC_wait: |
1733 | return 1 <= Version && 2147483647 >= Version; |
1734 | case ACCC_async: |
1735 | return 1 <= Version && 2147483647 >= Version; |
1736 | case ACCC_default: |
1737 | return 1 <= Version && 2147483647 >= Version; |
1738 | case ACCC_if: |
1739 | return 1 <= Version && 2147483647 >= Version; |
1740 | case ACCC_num_gangs: |
1741 | return 1 <= Version && 2147483647 >= Version; |
1742 | case ACCC_num_workers: |
1743 | return 1 <= Version && 2147483647 >= Version; |
1744 | case ACCC_self: |
1745 | return 1 <= Version && 2147483647 >= Version; |
1746 | case ACCC_vector_length: |
1747 | return 1 <= Version && 2147483647 >= Version; |
1748 | default: |
1749 | return false; |
1750 | } |
1751 | break; |
1752 | case ACCD_kernels_loop: |
1753 | switch (C) { |
1754 | case ACCC_attach: |
1755 | return 1 <= Version && 2147483647 >= Version; |
1756 | case ACCC_collapse: |
1757 | return 1 <= Version && 2147483647 >= Version; |
1758 | case ACCC_copy: |
1759 | return 1 <= Version && 2147483647 >= Version; |
1760 | case ACCC_copyin: |
1761 | return 1 <= Version && 2147483647 >= Version; |
1762 | case ACCC_copyout: |
1763 | return 1 <= Version && 2147483647 >= Version; |
1764 | case ACCC_create: |
1765 | return 1 <= Version && 2147483647 >= Version; |
1766 | case ACCC_deviceptr: |
1767 | return 1 <= Version && 2147483647 >= Version; |
1768 | case ACCC_device_type: |
1769 | return 1 <= Version && 2147483647 >= Version; |
1770 | case ACCC_gang: |
1771 | return 1 <= Version && 2147483647 >= Version; |
1772 | case ACCC_no_create: |
1773 | return 1 <= Version && 2147483647 >= Version; |
1774 | case ACCC_num_gangs: |
1775 | return 1 <= Version && 2147483647 >= Version; |
1776 | case ACCC_num_workers: |
1777 | return 1 <= Version && 2147483647 >= Version; |
1778 | case ACCC_present: |
1779 | return 1 <= Version && 2147483647 >= Version; |
1780 | case ACCC_private: |
1781 | return 1 <= Version && 2147483647 >= Version; |
1782 | case ACCC_reduction: |
1783 | return 1 <= Version && 2147483647 >= Version; |
1784 | case ACCC_tile: |
1785 | return 1 <= Version && 2147483647 >= Version; |
1786 | case ACCC_vector: |
1787 | return 1 <= Version && 2147483647 >= Version; |
1788 | case ACCC_vector_length: |
1789 | return 1 <= Version && 2147483647 >= Version; |
1790 | case ACCC_wait: |
1791 | return 1 <= Version && 2147483647 >= Version; |
1792 | case ACCC_worker: |
1793 | return 1 <= Version && 2147483647 >= Version; |
1794 | case ACCC_async: |
1795 | return 1 <= Version && 2147483647 >= Version; |
1796 | case ACCC_default: |
1797 | return 1 <= Version && 2147483647 >= Version; |
1798 | case ACCC_if: |
1799 | return 1 <= Version && 2147483647 >= Version; |
1800 | case ACCC_self: |
1801 | return 1 <= Version && 2147483647 >= Version; |
1802 | case ACCC_auto: |
1803 | return 1 <= Version && 2147483647 >= Version; |
1804 | case ACCC_independent: |
1805 | return 1 <= Version && 2147483647 >= Version; |
1806 | case ACCC_seq: |
1807 | return 1 <= Version && 2147483647 >= Version; |
1808 | default: |
1809 | return false; |
1810 | } |
1811 | break; |
1812 | case ACCD_loop: |
1813 | switch (C) { |
1814 | case ACCC_device_type: |
1815 | return 1 <= Version && 2147483647 >= Version; |
1816 | case ACCC_private: |
1817 | return 1 <= Version && 2147483647 >= Version; |
1818 | case ACCC_reduction: |
1819 | return 1 <= Version && 2147483647 >= Version; |
1820 | case ACCC_collapse: |
1821 | return 1 <= Version && 2147483647 >= Version; |
1822 | case ACCC_gang: |
1823 | return 1 <= Version && 2147483647 >= Version; |
1824 | case ACCC_tile: |
1825 | return 1 <= Version && 2147483647 >= Version; |
1826 | case ACCC_vector: |
1827 | return 1 <= Version && 2147483647 >= Version; |
1828 | case ACCC_worker: |
1829 | return 1 <= Version && 2147483647 >= Version; |
1830 | case ACCC_auto: |
1831 | return 1 <= Version && 2147483647 >= Version; |
1832 | case ACCC_independent: |
1833 | return 1 <= Version && 2147483647 >= Version; |
1834 | case ACCC_seq: |
1835 | return 1 <= Version && 2147483647 >= Version; |
1836 | default: |
1837 | return false; |
1838 | } |
1839 | break; |
1840 | case ACCD_parallel: |
1841 | switch (C) { |
1842 | case ACCC_attach: |
1843 | return 1 <= Version && 2147483647 >= Version; |
1844 | case ACCC_async: |
1845 | return 1 <= Version && 2147483647 >= Version; |
1846 | case ACCC_copy: |
1847 | return 1 <= Version && 2147483647 >= Version; |
1848 | case ACCC_copyin: |
1849 | return 1 <= Version && 2147483647 >= Version; |
1850 | case ACCC_copyout: |
1851 | return 1 <= Version && 2147483647 >= Version; |
1852 | case ACCC_create: |
1853 | return 1 <= Version && 2147483647 >= Version; |
1854 | case ACCC_deviceptr: |
1855 | return 1 <= Version && 2147483647 >= Version; |
1856 | case ACCC_device_type: |
1857 | return 1 <= Version && 2147483647 >= Version; |
1858 | case ACCC_no_create: |
1859 | return 1 <= Version && 2147483647 >= Version; |
1860 | case ACCC_num_gangs: |
1861 | return 1 <= Version && 2147483647 >= Version; |
1862 | case ACCC_num_workers: |
1863 | return 1 <= Version && 2147483647 >= Version; |
1864 | case ACCC_present: |
1865 | return 1 <= Version && 2147483647 >= Version; |
1866 | case ACCC_private: |
1867 | return 1 <= Version && 2147483647 >= Version; |
1868 | case ACCC_firstprivate: |
1869 | return 1 <= Version && 2147483647 >= Version; |
1870 | case ACCC_reduction: |
1871 | return 1 <= Version && 2147483647 >= Version; |
1872 | case ACCC_wait: |
1873 | return 1 <= Version && 2147483647 >= Version; |
1874 | case ACCC_vector_length: |
1875 | return 1 <= Version && 2147483647 >= Version; |
1876 | case ACCC_default: |
1877 | return 1 <= Version && 2147483647 >= Version; |
1878 | case ACCC_if: |
1879 | return 1 <= Version && 2147483647 >= Version; |
1880 | case ACCC_self: |
1881 | return 1 <= Version && 2147483647 >= Version; |
1882 | default: |
1883 | return false; |
1884 | } |
1885 | break; |
1886 | case ACCD_parallel_loop: |
1887 | switch (C) { |
1888 | case ACCC_attach: |
1889 | return 1 <= Version && 2147483647 >= Version; |
1890 | case ACCC_collapse: |
1891 | return 1 <= Version && 2147483647 >= Version; |
1892 | case ACCC_copy: |
1893 | return 1 <= Version && 2147483647 >= Version; |
1894 | case ACCC_copyin: |
1895 | return 1 <= Version && 2147483647 >= Version; |
1896 | case ACCC_copyout: |
1897 | return 1 <= Version && 2147483647 >= Version; |
1898 | case ACCC_create: |
1899 | return 1 <= Version && 2147483647 >= Version; |
1900 | case ACCC_deviceptr: |
1901 | return 1 <= Version && 2147483647 >= Version; |
1902 | case ACCC_device_type: |
1903 | return 1 <= Version && 2147483647 >= Version; |
1904 | case ACCC_firstprivate: |
1905 | return 1 <= Version && 2147483647 >= Version; |
1906 | case ACCC_gang: |
1907 | return 1 <= Version && 2147483647 >= Version; |
1908 | case ACCC_no_create: |
1909 | return 1 <= Version && 2147483647 >= Version; |
1910 | case ACCC_num_gangs: |
1911 | return 1 <= Version && 2147483647 >= Version; |
1912 | case ACCC_num_workers: |
1913 | return 1 <= Version && 2147483647 >= Version; |
1914 | case ACCC_present: |
1915 | return 1 <= Version && 2147483647 >= Version; |
1916 | case ACCC_private: |
1917 | return 1 <= Version && 2147483647 >= Version; |
1918 | case ACCC_reduction: |
1919 | return 1 <= Version && 2147483647 >= Version; |
1920 | case ACCC_tile: |
1921 | return 1 <= Version && 2147483647 >= Version; |
1922 | case ACCC_vector: |
1923 | return 1 <= Version && 2147483647 >= Version; |
1924 | case ACCC_vector_length: |
1925 | return 1 <= Version && 2147483647 >= Version; |
1926 | case ACCC_wait: |
1927 | return 1 <= Version && 2147483647 >= Version; |
1928 | case ACCC_worker: |
1929 | return 1 <= Version && 2147483647 >= Version; |
1930 | case ACCC_async: |
1931 | return 1 <= Version && 2147483647 >= Version; |
1932 | case ACCC_default: |
1933 | return 1 <= Version && 2147483647 >= Version; |
1934 | case ACCC_if: |
1935 | return 1 <= Version && 2147483647 >= Version; |
1936 | case ACCC_self: |
1937 | return 1 <= Version && 2147483647 >= Version; |
1938 | case ACCC_auto: |
1939 | return 1 <= Version && 2147483647 >= Version; |
1940 | case ACCC_independent: |
1941 | return 1 <= Version && 2147483647 >= Version; |
1942 | case ACCC_seq: |
1943 | return 1 <= Version && 2147483647 >= Version; |
1944 | default: |
1945 | return false; |
1946 | } |
1947 | break; |
1948 | case ACCD_routine: |
1949 | switch (C) { |
1950 | case ACCC_bind: |
1951 | return 1 <= Version && 2147483647 >= Version; |
1952 | case ACCC_device_type: |
1953 | return 1 <= Version && 2147483647 >= Version; |
1954 | case ACCC_gang: |
1955 | return 1 <= Version && 2147483647 >= Version; |
1956 | case ACCC_seq: |
1957 | return 1 <= Version && 2147483647 >= Version; |
1958 | case ACCC_vector: |
1959 | return 1 <= Version && 2147483647 >= Version; |
1960 | case ACCC_worker: |
1961 | return 1 <= Version && 2147483647 >= Version; |
1962 | case ACCC_nohost: |
1963 | return 1 <= Version && 2147483647 >= Version; |
1964 | default: |
1965 | return false; |
1966 | } |
1967 | break; |
1968 | case ACCD_serial: |
1969 | switch (C) { |
1970 | case ACCC_attach: |
1971 | return 1 <= Version && 2147483647 >= Version; |
1972 | case ACCC_copy: |
1973 | return 1 <= Version && 2147483647 >= Version; |
1974 | case ACCC_copyin: |
1975 | return 1 <= Version && 2147483647 >= Version; |
1976 | case ACCC_copyout: |
1977 | return 1 <= Version && 2147483647 >= Version; |
1978 | case ACCC_create: |
1979 | return 1 <= Version && 2147483647 >= Version; |
1980 | case ACCC_deviceptr: |
1981 | return 1 <= Version && 2147483647 >= Version; |
1982 | case ACCC_device_type: |
1983 | return 1 <= Version && 2147483647 >= Version; |
1984 | case ACCC_no_create: |
1985 | return 1 <= Version && 2147483647 >= Version; |
1986 | case ACCC_present: |
1987 | return 1 <= Version && 2147483647 >= Version; |
1988 | case ACCC_private: |
1989 | return 1 <= Version && 2147483647 >= Version; |
1990 | case ACCC_firstprivate: |
1991 | return 1 <= Version && 2147483647 >= Version; |
1992 | case ACCC_reduction: |
1993 | return 1 <= Version && 2147483647 >= Version; |
1994 | case ACCC_wait: |
1995 | return 1 <= Version && 2147483647 >= Version; |
1996 | case ACCC_async: |
1997 | return 1 <= Version && 2147483647 >= Version; |
1998 | case ACCC_default: |
1999 | return 1 <= Version && 2147483647 >= Version; |
2000 | case ACCC_if: |
2001 | return 1 <= Version && 2147483647 >= Version; |
2002 | case ACCC_self: |
2003 | return 1 <= Version && 2147483647 >= Version; |
2004 | default: |
2005 | return false; |
2006 | } |
2007 | break; |
2008 | case ACCD_serial_loop: |
2009 | switch (C) { |
2010 | case ACCC_attach: |
2011 | return 1 <= Version && 2147483647 >= Version; |
2012 | case ACCC_collapse: |
2013 | return 1 <= Version && 2147483647 >= Version; |
2014 | case ACCC_copy: |
2015 | return 1 <= Version && 2147483647 >= Version; |
2016 | case ACCC_copyin: |
2017 | return 1 <= Version && 2147483647 >= Version; |
2018 | case ACCC_copyout: |
2019 | return 1 <= Version && 2147483647 >= Version; |
2020 | case ACCC_create: |
2021 | return 1 <= Version && 2147483647 >= Version; |
2022 | case ACCC_deviceptr: |
2023 | return 1 <= Version && 2147483647 >= Version; |
2024 | case ACCC_device_type: |
2025 | return 1 <= Version && 2147483647 >= Version; |
2026 | case ACCC_firstprivate: |
2027 | return 1 <= Version && 2147483647 >= Version; |
2028 | case ACCC_gang: |
2029 | return 1 <= Version && 2147483647 >= Version; |
2030 | case ACCC_no_create: |
2031 | return 1 <= Version && 2147483647 >= Version; |
2032 | case ACCC_present: |
2033 | return 1 <= Version && 2147483647 >= Version; |
2034 | case ACCC_private: |
2035 | return 1 <= Version && 2147483647 >= Version; |
2036 | case ACCC_reduction: |
2037 | return 1 <= Version && 2147483647 >= Version; |
2038 | case ACCC_tile: |
2039 | return 1 <= Version && 2147483647 >= Version; |
2040 | case ACCC_vector: |
2041 | return 1 <= Version && 2147483647 >= Version; |
2042 | case ACCC_wait: |
2043 | return 1 <= Version && 2147483647 >= Version; |
2044 | case ACCC_worker: |
2045 | return 1 <= Version && 2147483647 >= Version; |
2046 | case ACCC_async: |
2047 | return 1 <= Version && 2147483647 >= Version; |
2048 | case ACCC_default: |
2049 | return 1 <= Version && 2147483647 >= Version; |
2050 | case ACCC_if: |
2051 | return 1 <= Version && 2147483647 >= Version; |
2052 | case ACCC_self: |
2053 | return 1 <= Version && 2147483647 >= Version; |
2054 | case ACCC_auto: |
2055 | return 1 <= Version && 2147483647 >= Version; |
2056 | case ACCC_independent: |
2057 | return 1 <= Version && 2147483647 >= Version; |
2058 | case ACCC_seq: |
2059 | return 1 <= Version && 2147483647 >= Version; |
2060 | default: |
2061 | return false; |
2062 | } |
2063 | break; |
2064 | case ACCD_set: |
2065 | switch (C) { |
2066 | case ACCC_default_async: |
2067 | return 1 <= Version && 2147483647 >= Version; |
2068 | case ACCC_device_num: |
2069 | return 1 <= Version && 2147483647 >= Version; |
2070 | case ACCC_device_type: |
2071 | return 1 <= Version && 2147483647 >= Version; |
2072 | case ACCC_if: |
2073 | return 1 <= Version && 2147483647 >= Version; |
2074 | default: |
2075 | return false; |
2076 | } |
2077 | break; |
2078 | case ACCD_shutdown: |
2079 | switch (C) { |
2080 | case ACCC_device_num: |
2081 | return 1 <= Version && 2147483647 >= Version; |
2082 | case ACCC_device_type: |
2083 | return 1 <= Version && 2147483647 >= Version; |
2084 | case ACCC_if: |
2085 | return 1 <= Version && 2147483647 >= Version; |
2086 | default: |
2087 | return false; |
2088 | } |
2089 | break; |
2090 | case ACCD_unknown: |
2091 | return false; |
2092 | break; |
2093 | case ACCD_update: |
2094 | switch (C) { |
2095 | case ACCC_device_type: |
2096 | return 1 <= Version && 2147483647 >= Version; |
2097 | case ACCC_wait: |
2098 | return 1 <= Version && 2147483647 >= Version; |
2099 | case ACCC_async: |
2100 | return 1 <= Version && 2147483647 >= Version; |
2101 | case ACCC_if: |
2102 | return 1 <= Version && 2147483647 >= Version; |
2103 | case ACCC_if_present: |
2104 | return 1 <= Version && 2147483647 >= Version; |
2105 | case ACCC_device: |
2106 | return 1 <= Version && 2147483647 >= Version; |
2107 | case ACCC_host: |
2108 | return 1 <= Version && 2147483647 >= Version; |
2109 | case ACCC_self: |
2110 | return 1 <= Version && 2147483647 >= Version; |
2111 | default: |
2112 | return false; |
2113 | } |
2114 | break; |
2115 | case ACCD_wait: |
2116 | switch (C) { |
2117 | case ACCC_async: |
2118 | return 1 <= Version && 2147483647 >= Version; |
2119 | case ACCC_if: |
2120 | return 1 <= Version && 2147483647 >= Version; |
2121 | default: |
2122 | return false; |
2123 | } |
2124 | break; |
2125 | } |
2126 | llvm_unreachable("Invalid OpenACC Directive kind" ); |
2127 | } |
2128 | |
2129 | llvm::acc::Association llvm::acc::getDirectiveAssociation(llvm::acc::Directive Dir) { |
2130 | switch (Dir) { |
2131 | case llvm::acc::Directive::ACCD_atomic: |
2132 | return llvm::acc::Association::Block; |
2133 | case llvm::acc::Directive::ACCD_cache: |
2134 | return llvm::acc::Association::None; |
2135 | case llvm::acc::Directive::ACCD_data: |
2136 | return llvm::acc::Association::Block; |
2137 | case llvm::acc::Directive::ACCD_declare: |
2138 | return llvm::acc::Association::None; |
2139 | case llvm::acc::Directive::ACCD_enter_data: |
2140 | return llvm::acc::Association::None; |
2141 | case llvm::acc::Directive::ACCD_exit_data: |
2142 | return llvm::acc::Association::None; |
2143 | case llvm::acc::Directive::ACCD_host_data: |
2144 | return llvm::acc::Association::Block; |
2145 | case llvm::acc::Directive::ACCD_init: |
2146 | return llvm::acc::Association::None; |
2147 | case llvm::acc::Directive::ACCD_kernels: |
2148 | return llvm::acc::Association::Block; |
2149 | case llvm::acc::Directive::ACCD_kernels_loop: |
2150 | return llvm::acc::Association::Loop; |
2151 | case llvm::acc::Directive::ACCD_loop: |
2152 | return llvm::acc::Association::Loop; |
2153 | case llvm::acc::Directive::ACCD_parallel: |
2154 | return llvm::acc::Association::Block; |
2155 | case llvm::acc::Directive::ACCD_parallel_loop: |
2156 | return llvm::acc::Association::Loop; |
2157 | case llvm::acc::Directive::ACCD_routine: |
2158 | return llvm::acc::Association::Declaration; |
2159 | case llvm::acc::Directive::ACCD_serial: |
2160 | return llvm::acc::Association::Block; |
2161 | case llvm::acc::Directive::ACCD_serial_loop: |
2162 | return llvm::acc::Association::Loop; |
2163 | case llvm::acc::Directive::ACCD_set: |
2164 | return llvm::acc::Association::None; |
2165 | case llvm::acc::Directive::ACCD_shutdown: |
2166 | return llvm::acc::Association::None; |
2167 | case llvm::acc::Directive::ACCD_unknown: |
2168 | return llvm::acc::Association::None; |
2169 | case llvm::acc::Directive::ACCD_update: |
2170 | return llvm::acc::Association::None; |
2171 | case llvm::acc::Directive::ACCD_wait: |
2172 | return llvm::acc::Association::None; |
2173 | } // switch (Dir) |
2174 | llvm_unreachable("Unexpected directive" ); |
2175 | } |
2176 | |
2177 | llvm::acc::Category llvm::acc::getDirectiveCategory(llvm::acc::Directive Dir) { |
2178 | switch (Dir) { |
2179 | case llvm::acc::ACCD_atomic: |
2180 | return llvm::acc::Category::Executable; |
2181 | case llvm::acc::ACCD_cache: |
2182 | return llvm::acc::Category::Executable; |
2183 | case llvm::acc::ACCD_data: |
2184 | return llvm::acc::Category::Executable; |
2185 | case llvm::acc::ACCD_declare: |
2186 | return llvm::acc::Category::Declarative; |
2187 | case llvm::acc::ACCD_enter_data: |
2188 | return llvm::acc::Category::Executable; |
2189 | case llvm::acc::ACCD_exit_data: |
2190 | return llvm::acc::Category::Executable; |
2191 | case llvm::acc::ACCD_host_data: |
2192 | return llvm::acc::Category::Executable; |
2193 | case llvm::acc::ACCD_init: |
2194 | return llvm::acc::Category::Executable; |
2195 | case llvm::acc::ACCD_kernels: |
2196 | return llvm::acc::Category::Executable; |
2197 | case llvm::acc::ACCD_kernels_loop: |
2198 | return llvm::acc::Category::Executable; |
2199 | case llvm::acc::ACCD_loop: |
2200 | return llvm::acc::Category::Executable; |
2201 | case llvm::acc::ACCD_parallel: |
2202 | return llvm::acc::Category::Executable; |
2203 | case llvm::acc::ACCD_parallel_loop: |
2204 | return llvm::acc::Category::Executable; |
2205 | case llvm::acc::ACCD_routine: |
2206 | return llvm::acc::Category::Declarative; |
2207 | case llvm::acc::ACCD_serial: |
2208 | return llvm::acc::Category::Executable; |
2209 | case llvm::acc::ACCD_serial_loop: |
2210 | return llvm::acc::Category::Executable; |
2211 | case llvm::acc::ACCD_set: |
2212 | return llvm::acc::Category::Executable; |
2213 | case llvm::acc::ACCD_shutdown: |
2214 | return llvm::acc::Category::Executable; |
2215 | case llvm::acc::ACCD_unknown: |
2216 | return llvm::acc::Category::Utility; |
2217 | case llvm::acc::ACCD_update: |
2218 | return llvm::acc::Category::Executable; |
2219 | case llvm::acc::ACCD_wait: |
2220 | return llvm::acc::Category::Executable; |
2221 | } // switch (Dir) |
2222 | llvm_unreachable("Unexpected directive" ); |
2223 | } |
2224 | |
2225 | static_assert(sizeof(llvm::acc::Directive) == sizeof(int)); |
2226 | [[maybe_unused]] static const llvm::acc::Directive LeafConstructTable[][4] = { |
2227 | {llvm::acc::ACCD_atomic, static_cast<llvm::acc::Directive>(0), static_cast<llvm::acc::Directive>(-1), static_cast<llvm::acc::Directive>(-1),}, |
2228 | {llvm::acc::ACCD_cache, static_cast<llvm::acc::Directive>(0), static_cast<llvm::acc::Directive>(-1), static_cast<llvm::acc::Directive>(-1),}, |
2229 | {llvm::acc::ACCD_data, static_cast<llvm::acc::Directive>(0), static_cast<llvm::acc::Directive>(-1), static_cast<llvm::acc::Directive>(-1),}, |
2230 | {llvm::acc::ACCD_declare, static_cast<llvm::acc::Directive>(0), static_cast<llvm::acc::Directive>(-1), static_cast<llvm::acc::Directive>(-1),}, |
2231 | {llvm::acc::ACCD_enter_data, static_cast<llvm::acc::Directive>(0), static_cast<llvm::acc::Directive>(-1), static_cast<llvm::acc::Directive>(-1),}, |
2232 | {llvm::acc::ACCD_exit_data, static_cast<llvm::acc::Directive>(0), static_cast<llvm::acc::Directive>(-1), static_cast<llvm::acc::Directive>(-1),}, |
2233 | {llvm::acc::ACCD_host_data, static_cast<llvm::acc::Directive>(0), static_cast<llvm::acc::Directive>(-1), static_cast<llvm::acc::Directive>(-1),}, |
2234 | {llvm::acc::ACCD_init, static_cast<llvm::acc::Directive>(0), static_cast<llvm::acc::Directive>(-1), static_cast<llvm::acc::Directive>(-1),}, |
2235 | {llvm::acc::ACCD_kernels, static_cast<llvm::acc::Directive>(0), static_cast<llvm::acc::Directive>(-1), static_cast<llvm::acc::Directive>(-1),}, |
2236 | {llvm::acc::ACCD_loop, static_cast<llvm::acc::Directive>(0), static_cast<llvm::acc::Directive>(-1), static_cast<llvm::acc::Directive>(-1),}, |
2237 | {llvm::acc::ACCD_parallel, static_cast<llvm::acc::Directive>(0), static_cast<llvm::acc::Directive>(-1), static_cast<llvm::acc::Directive>(-1),}, |
2238 | {llvm::acc::ACCD_routine, static_cast<llvm::acc::Directive>(0), static_cast<llvm::acc::Directive>(-1), static_cast<llvm::acc::Directive>(-1),}, |
2239 | {llvm::acc::ACCD_serial, static_cast<llvm::acc::Directive>(0), static_cast<llvm::acc::Directive>(-1), static_cast<llvm::acc::Directive>(-1),}, |
2240 | {llvm::acc::ACCD_set, static_cast<llvm::acc::Directive>(0), static_cast<llvm::acc::Directive>(-1), static_cast<llvm::acc::Directive>(-1),}, |
2241 | {llvm::acc::ACCD_shutdown, static_cast<llvm::acc::Directive>(0), static_cast<llvm::acc::Directive>(-1), static_cast<llvm::acc::Directive>(-1),}, |
2242 | {llvm::acc::ACCD_unknown, static_cast<llvm::acc::Directive>(0), static_cast<llvm::acc::Directive>(-1), static_cast<llvm::acc::Directive>(-1),}, |
2243 | {llvm::acc::ACCD_update, static_cast<llvm::acc::Directive>(0), static_cast<llvm::acc::Directive>(-1), static_cast<llvm::acc::Directive>(-1),}, |
2244 | {llvm::acc::ACCD_wait, static_cast<llvm::acc::Directive>(0), static_cast<llvm::acc::Directive>(-1), static_cast<llvm::acc::Directive>(-1),}, |
2245 | {llvm::acc::ACCD_kernels_loop, static_cast<llvm::acc::Directive>(2), llvm::acc::ACCD_kernels, llvm::acc::ACCD_loop,}, |
2246 | {llvm::acc::ACCD_parallel_loop, static_cast<llvm::acc::Directive>(2), llvm::acc::ACCD_parallel, llvm::acc::ACCD_loop,}, |
2247 | {llvm::acc::ACCD_serial_loop, static_cast<llvm::acc::Directive>(2), llvm::acc::ACCD_serial, llvm::acc::ACCD_loop,}, |
2248 | }; |
2249 | |
2250 | [[maybe_unused]] static auto LeafConstructTableEndDirective = LeafConstructTable + 21; |
2251 | |
2252 | [[maybe_unused]] static const int LeafConstructTableOrdering[] = { |
2253 | 0, 1, 2, 3, 4, 5, 6, 7, 8, 18, 9, 10, 19, 11, 12, 20, 13, 14, 15, 16, 17, |
2254 | }; |
2255 | |
2256 | #endif // GEN_DIRECTIVES_IMPL |
2257 | |
2258 | |