1#ifndef LLVM_OpenMP_INC
2#define LLVM_OpenMP_INC
3
4#include "llvm/ADT/ArrayRef.h"
5#include "llvm/ADT/BitmaskEnum.h"
6#include "llvm/ADT/Sequence.h"
7#include "llvm/ADT/StringRef.h"
8#include "llvm/Frontend/Directive/Spelling.h"
9#include "llvm/Support/Compiler.h"
10#include <cstddef>
11#include <utility>
12
13namespace llvm {
14
15namespace omp {
16
17LLVM_ENABLE_BITMASK_ENUMS_IN_NAMESPACE();
18
19enum class Association {
20 Block,
21 First_ = Block,
22 Declaration,
23 Delimited,
24 LoopNest,
25 LoopSeq,
26 None,
27 Separating,
28 Last_ = Separating,
29};
30
31static constexpr std::size_t Association_enumSize = 7;
32
33enum class Category {
34 Declarative,
35 First_ = Declarative,
36 Executable,
37 Informational,
38 Meta,
39 Subsidiary,
40 Utility,
41 Last_ = Utility,
42};
43
44static constexpr std::size_t Category_enumSize = 6;
45
46enum class SourceLanguage : uint32_t {
47 C = 1U,
48 Fortran = 2U,
49 LLVM_MARK_AS_BITMASK_ENUM(/*LargestValue=*/Fortran)
50};
51
52static constexpr std::size_t SourceLanguage_enumSize = 2;
53
54enum class Directive {
55 OMPD_allocate,
56 First_ = OMPD_allocate,
57 OMPD_allocators,
58 OMPD_assume,
59 OMPD_assumes,
60 OMPD_atomic,
61 OMPD_barrier,
62 OMPD_begin_assumes,
63 OMPD_begin_declare_target,
64 OMPD_begin_declare_variant,
65 OMPD_cancel,
66 OMPD_cancellation_point,
67 OMPD_critical,
68 OMPD_declare_induction,
69 OMPD_declare_mapper,
70 OMPD_declare_reduction,
71 OMPD_declare_simd,
72 OMPD_declare_target,
73 OMPD_declare_variant,
74 OMPD_depobj,
75 OMPD_distribute,
76 OMPD_distribute_parallel_do,
77 OMPD_distribute_parallel_do_simd,
78 OMPD_distribute_parallel_for,
79 OMPD_distribute_parallel_for_simd,
80 OMPD_distribute_simd,
81 OMPD_do,
82 OMPD_do_simd,
83 OMPD_end_assumes,
84 OMPD_end_declare_target,
85 OMPD_end_declare_variant,
86 OMPD_end_do,
87 OMPD_end_do_simd,
88 OMPD_end_scope,
89 OMPD_end_sections,
90 OMPD_end_single,
91 OMPD_end_workdistribute,
92 OMPD_end_workshare,
93 OMPD_error,
94 OMPD_flush,
95 OMPD_for,
96 OMPD_for_simd,
97 OMPD_fuse,
98 OMPD_groupprivate,
99 OMPD_interchange,
100 OMPD_masked_taskloop,
101 OMPD_masked_taskloop_simd,
102 OMPD_master,
103 OMPD_master_taskloop,
104 OMPD_master_taskloop_simd,
105 OMPD_metadirective,
106 OMPD_nothing,
107 OMPD_ordered,
108 OMPD_parallel,
109 OMPD_parallel_do,
110 OMPD_parallel_do_simd,
111 OMPD_parallel_for,
112 OMPD_parallel_for_simd,
113 OMPD_parallel_masked,
114 OMPD_parallel_masked_taskloop,
115 OMPD_parallel_masked_taskloop_simd,
116 OMPD_parallel_master,
117 OMPD_parallel_master_taskloop,
118 OMPD_parallel_master_taskloop_simd,
119 OMPD_parallel_sections,
120 OMPD_parallel_workshare,
121 OMPD_requires,
122 OMPD_reverse,
123 OMPD_scan,
124 OMPD_scope,
125 OMPD_section,
126 OMPD_sections,
127 OMPD_simd,
128 OMPD_single,
129 OMPD_stripe,
130 OMPD_target,
131 OMPD_target_data,
132 OMPD_target_enter_data,
133 OMPD_target_exit_data,
134 OMPD_target_parallel,
135 OMPD_target_parallel_do,
136 OMPD_target_parallel_do_simd,
137 OMPD_target_parallel_for,
138 OMPD_target_parallel_for_simd,
139 OMPD_target_simd,
140 OMPD_target_teams,
141 OMPD_target_teams_distribute,
142 OMPD_target_teams_distribute_parallel_do,
143 OMPD_target_teams_distribute_parallel_do_simd,
144 OMPD_target_teams_distribute_parallel_for,
145 OMPD_target_teams_distribute_parallel_for_simd,
146 OMPD_target_teams_distribute_simd,
147 OMPD_target_teams_workdistribute,
148 OMPD_target_update,
149 OMPD_task,
150 OMPD_taskgroup,
151 OMPD_taskloop,
152 OMPD_taskloop_simd,
153 OMPD_taskwait,
154 OMPD_taskyield,
155 OMPD_taskgraph,
156 OMPD_teams,
157 OMPD_teams_distribute,
158 OMPD_teams_distribute_parallel_do,
159 OMPD_teams_distribute_parallel_do_simd,
160 OMPD_teams_distribute_parallel_for,
161 OMPD_teams_distribute_parallel_for_simd,
162 OMPD_teams_distribute_simd,
163 OMPD_teams_workdistribute,
164 OMPD_threadprivate,
165 OMPD_tile,
166 OMPD_unknown,
167 OMPD_unroll,
168 OMPD_workdistribute,
169 OMPD_workshare,
170 OMPD_dispatch,
171 OMPD_interop,
172 OMPD_loop,
173 OMPD_masked,
174 OMPD_parallel_loop,
175 OMPD_target_loop,
176 OMPD_target_parallel_loop,
177 OMPD_target_teams_loop,
178 OMPD_teams_loop,
179 Last_ = OMPD_teams_loop,
180};
181
182static constexpr std::size_t Directive_enumSize = 123;
183
184constexpr auto OMPD_allocate = Directive::OMPD_allocate;
185constexpr auto OMPD_allocators = Directive::OMPD_allocators;
186constexpr auto OMPD_assume = Directive::OMPD_assume;
187constexpr auto OMPD_assumes = Directive::OMPD_assumes;
188constexpr auto OMPD_atomic = Directive::OMPD_atomic;
189constexpr auto OMPD_barrier = Directive::OMPD_barrier;
190constexpr auto OMPD_begin_assumes = Directive::OMPD_begin_assumes;
191constexpr auto OMPD_begin_declare_target = Directive::OMPD_begin_declare_target;
192constexpr auto OMPD_begin_declare_variant = Directive::OMPD_begin_declare_variant;
193constexpr auto OMPD_cancel = Directive::OMPD_cancel;
194constexpr auto OMPD_cancellation_point = Directive::OMPD_cancellation_point;
195constexpr auto OMPD_critical = Directive::OMPD_critical;
196constexpr auto OMPD_declare_induction = Directive::OMPD_declare_induction;
197constexpr auto OMPD_declare_mapper = Directive::OMPD_declare_mapper;
198constexpr auto OMPD_declare_reduction = Directive::OMPD_declare_reduction;
199constexpr auto OMPD_declare_simd = Directive::OMPD_declare_simd;
200constexpr auto OMPD_declare_target = Directive::OMPD_declare_target;
201constexpr auto OMPD_declare_variant = Directive::OMPD_declare_variant;
202constexpr auto OMPD_depobj = Directive::OMPD_depobj;
203constexpr auto OMPD_distribute = Directive::OMPD_distribute;
204constexpr auto OMPD_distribute_parallel_do = Directive::OMPD_distribute_parallel_do;
205constexpr auto OMPD_distribute_parallel_do_simd = Directive::OMPD_distribute_parallel_do_simd;
206constexpr auto OMPD_distribute_parallel_for = Directive::OMPD_distribute_parallel_for;
207constexpr auto OMPD_distribute_parallel_for_simd = Directive::OMPD_distribute_parallel_for_simd;
208constexpr auto OMPD_distribute_simd = Directive::OMPD_distribute_simd;
209constexpr auto OMPD_do = Directive::OMPD_do;
210constexpr auto OMPD_do_simd = Directive::OMPD_do_simd;
211constexpr auto OMPD_end_assumes = Directive::OMPD_end_assumes;
212constexpr auto OMPD_end_declare_target = Directive::OMPD_end_declare_target;
213constexpr auto OMPD_end_declare_variant = Directive::OMPD_end_declare_variant;
214constexpr auto OMPD_end_do = Directive::OMPD_end_do;
215constexpr auto OMPD_end_do_simd = Directive::OMPD_end_do_simd;
216constexpr auto OMPD_end_scope = Directive::OMPD_end_scope;
217constexpr auto OMPD_end_sections = Directive::OMPD_end_sections;
218constexpr auto OMPD_end_single = Directive::OMPD_end_single;
219constexpr auto OMPD_end_workdistribute = Directive::OMPD_end_workdistribute;
220constexpr auto OMPD_end_workshare = Directive::OMPD_end_workshare;
221constexpr auto OMPD_error = Directive::OMPD_error;
222constexpr auto OMPD_flush = Directive::OMPD_flush;
223constexpr auto OMPD_for = Directive::OMPD_for;
224constexpr auto OMPD_for_simd = Directive::OMPD_for_simd;
225constexpr auto OMPD_fuse = Directive::OMPD_fuse;
226constexpr auto OMPD_groupprivate = Directive::OMPD_groupprivate;
227constexpr auto OMPD_interchange = Directive::OMPD_interchange;
228constexpr auto OMPD_masked_taskloop = Directive::OMPD_masked_taskloop;
229constexpr auto OMPD_masked_taskloop_simd = Directive::OMPD_masked_taskloop_simd;
230constexpr auto OMPD_master = Directive::OMPD_master;
231constexpr auto OMPD_master_taskloop = Directive::OMPD_master_taskloop;
232constexpr auto OMPD_master_taskloop_simd = Directive::OMPD_master_taskloop_simd;
233constexpr auto OMPD_metadirective = Directive::OMPD_metadirective;
234constexpr auto OMPD_nothing = Directive::OMPD_nothing;
235constexpr auto OMPD_ordered = Directive::OMPD_ordered;
236constexpr auto OMPD_parallel = Directive::OMPD_parallel;
237constexpr auto OMPD_parallel_do = Directive::OMPD_parallel_do;
238constexpr auto OMPD_parallel_do_simd = Directive::OMPD_parallel_do_simd;
239constexpr auto OMPD_parallel_for = Directive::OMPD_parallel_for;
240constexpr auto OMPD_parallel_for_simd = Directive::OMPD_parallel_for_simd;
241constexpr auto OMPD_parallel_masked = Directive::OMPD_parallel_masked;
242constexpr auto OMPD_parallel_masked_taskloop = Directive::OMPD_parallel_masked_taskloop;
243constexpr auto OMPD_parallel_masked_taskloop_simd = Directive::OMPD_parallel_masked_taskloop_simd;
244constexpr auto OMPD_parallel_master = Directive::OMPD_parallel_master;
245constexpr auto OMPD_parallel_master_taskloop = Directive::OMPD_parallel_master_taskloop;
246constexpr auto OMPD_parallel_master_taskloop_simd = Directive::OMPD_parallel_master_taskloop_simd;
247constexpr auto OMPD_parallel_sections = Directive::OMPD_parallel_sections;
248constexpr auto OMPD_parallel_workshare = Directive::OMPD_parallel_workshare;
249constexpr auto OMPD_requires = Directive::OMPD_requires;
250constexpr auto OMPD_reverse = Directive::OMPD_reverse;
251constexpr auto OMPD_scan = Directive::OMPD_scan;
252constexpr auto OMPD_scope = Directive::OMPD_scope;
253constexpr auto OMPD_section = Directive::OMPD_section;
254constexpr auto OMPD_sections = Directive::OMPD_sections;
255constexpr auto OMPD_simd = Directive::OMPD_simd;
256constexpr auto OMPD_single = Directive::OMPD_single;
257constexpr auto OMPD_stripe = Directive::OMPD_stripe;
258constexpr auto OMPD_target = Directive::OMPD_target;
259constexpr auto OMPD_target_data = Directive::OMPD_target_data;
260constexpr auto OMPD_target_enter_data = Directive::OMPD_target_enter_data;
261constexpr auto OMPD_target_exit_data = Directive::OMPD_target_exit_data;
262constexpr auto OMPD_target_parallel = Directive::OMPD_target_parallel;
263constexpr auto OMPD_target_parallel_do = Directive::OMPD_target_parallel_do;
264constexpr auto OMPD_target_parallel_do_simd = Directive::OMPD_target_parallel_do_simd;
265constexpr auto OMPD_target_parallel_for = Directive::OMPD_target_parallel_for;
266constexpr auto OMPD_target_parallel_for_simd = Directive::OMPD_target_parallel_for_simd;
267constexpr auto OMPD_target_simd = Directive::OMPD_target_simd;
268constexpr auto OMPD_target_teams = Directive::OMPD_target_teams;
269constexpr auto OMPD_target_teams_distribute = Directive::OMPD_target_teams_distribute;
270constexpr auto OMPD_target_teams_distribute_parallel_do = Directive::OMPD_target_teams_distribute_parallel_do;
271constexpr auto OMPD_target_teams_distribute_parallel_do_simd = Directive::OMPD_target_teams_distribute_parallel_do_simd;
272constexpr auto OMPD_target_teams_distribute_parallel_for = Directive::OMPD_target_teams_distribute_parallel_for;
273constexpr auto OMPD_target_teams_distribute_parallel_for_simd = Directive::OMPD_target_teams_distribute_parallel_for_simd;
274constexpr auto OMPD_target_teams_distribute_simd = Directive::OMPD_target_teams_distribute_simd;
275constexpr auto OMPD_target_teams_workdistribute = Directive::OMPD_target_teams_workdistribute;
276constexpr auto OMPD_target_update = Directive::OMPD_target_update;
277constexpr auto OMPD_task = Directive::OMPD_task;
278constexpr auto OMPD_taskgroup = Directive::OMPD_taskgroup;
279constexpr auto OMPD_taskloop = Directive::OMPD_taskloop;
280constexpr auto OMPD_taskloop_simd = Directive::OMPD_taskloop_simd;
281constexpr auto OMPD_taskwait = Directive::OMPD_taskwait;
282constexpr auto OMPD_taskyield = Directive::OMPD_taskyield;
283constexpr auto OMPD_taskgraph = Directive::OMPD_taskgraph;
284constexpr auto OMPD_teams = Directive::OMPD_teams;
285constexpr auto OMPD_teams_distribute = Directive::OMPD_teams_distribute;
286constexpr auto OMPD_teams_distribute_parallel_do = Directive::OMPD_teams_distribute_parallel_do;
287constexpr auto OMPD_teams_distribute_parallel_do_simd = Directive::OMPD_teams_distribute_parallel_do_simd;
288constexpr auto OMPD_teams_distribute_parallel_for = Directive::OMPD_teams_distribute_parallel_for;
289constexpr auto OMPD_teams_distribute_parallel_for_simd = Directive::OMPD_teams_distribute_parallel_for_simd;
290constexpr auto OMPD_teams_distribute_simd = Directive::OMPD_teams_distribute_simd;
291constexpr auto OMPD_teams_workdistribute = Directive::OMPD_teams_workdistribute;
292constexpr auto OMPD_threadprivate = Directive::OMPD_threadprivate;
293constexpr auto OMPD_tile = Directive::OMPD_tile;
294constexpr auto OMPD_unknown = Directive::OMPD_unknown;
295constexpr auto OMPD_unroll = Directive::OMPD_unroll;
296constexpr auto OMPD_workdistribute = Directive::OMPD_workdistribute;
297constexpr auto OMPD_workshare = Directive::OMPD_workshare;
298constexpr auto OMPD_dispatch = Directive::OMPD_dispatch;
299constexpr auto OMPD_interop = Directive::OMPD_interop;
300constexpr auto OMPD_loop = Directive::OMPD_loop;
301constexpr auto OMPD_masked = Directive::OMPD_masked;
302constexpr auto OMPD_parallel_loop = Directive::OMPD_parallel_loop;
303constexpr auto OMPD_target_loop = Directive::OMPD_target_loop;
304constexpr auto OMPD_target_parallel_loop = Directive::OMPD_target_parallel_loop;
305constexpr auto OMPD_target_teams_loop = Directive::OMPD_target_teams_loop;
306constexpr auto OMPD_teams_loop = Directive::OMPD_teams_loop;
307
308enum class Clause {
309 OMPC_absent,
310 First_ = OMPC_absent,
311 OMPC_acq_rel,
312 OMPC_acquire,
313 OMPC_adjust_args,
314 OMPC_affinity,
315 OMPC_align,
316 OMPC_aligned,
317 OMPC_allocate,
318 OMPC_allocator,
319 OMPC_append_args,
320 OMPC_apply,
321 OMPC_at,
322 OMPC_atomic_default_mem_order,
323 OMPC_bind,
324 OMPC_cancellation_construct_type,
325 OMPC_capture,
326 OMPC_collapse,
327 OMPC_collector,
328 OMPC_combiner,
329 OMPC_compare,
330 OMPC_contains,
331 OMPC_copyprivate,
332 OMPC_copyin,
333 OMPC_counts,
334 OMPC_default,
335 OMPC_defaultmap,
336 OMPC_depend,
337 OMPC_depobj,
338 OMPC_depth,
339 OMPC_destroy,
340 OMPC_detach,
341 OMPC_device,
342 OMPC_device_safesync,
343 OMPC_device_type,
344 OMPC_dist_schedule,
345 OMPC_doacross,
346 OMPC_dyn_groupprivate,
347 OMPC_dynamic_allocators,
348 OMPC_enter,
349 OMPC_exclusive,
350 OMPC_fail,
351 OMPC_filter,
352 OMPC_final,
353 OMPC_firstprivate,
354 OMPC_flush,
355 OMPC_from,
356 OMPC_full,
357 OMPC_grainsize,
358 OMPC_graph_id,
359 OMPC_graph_reset,
360 OMPC_groupprivate,
361 OMPC_has_device_addr,
362 OMPC_hint,
363 OMPC_holds,
364 OMPC_if,
365 OMPC_in_reduction,
366 OMPC_inbranch,
367 OMPC_inclusive,
368 OMPC_indirect,
369 OMPC_induction,
370 OMPC_inductor,
371 OMPC_init,
372 OMPC_init_complete,
373 OMPC_initializer,
374 OMPC_interop,
375 OMPC_is_device_ptr,
376 OMPC_lastprivate,
377 OMPC_linear,
378 OMPC_link,
379 OMPC_local,
380 OMPC_looprange,
381 OMPC_map,
382 OMPC_match,
383 OMPC_memory_order,
384 OMPC_memscope,
385 OMPC_mergeable,
386 OMPC_message,
387 OMPC_nogroup,
388 OMPC_no_openmp,
389 OMPC_no_openmp_constructs,
390 OMPC_no_openmp_routines,
391 OMPC_no_parallelism,
392 OMPC_nowait,
393 OMPC_nocontext,
394 OMPC_nontemporal,
395 OMPC_notinbranch,
396 OMPC_novariants,
397 OMPC_num_tasks,
398 OMPC_num_teams,
399 OMPC_num_threads,
400 OMPC_ompx_attribute,
401 OMPC_ompx_bare,
402 OMPC_ompx_dyn_cgroup_mem,
403 OMPC_order,
404 OMPC_ordered,
405 OMPC_otherwise,
406 OMPC_partial,
407 OMPC_permutation,
408 OMPC_priority,
409 OMPC_private,
410 OMPC_proc_bind,
411 OMPC_read,
412 OMPC_reduction,
413 OMPC_relaxed,
414 OMPC_release,
415 OMPC_replayable,
416 OMPC_reverse_offload,
417 OMPC_safelen,
418 OMPC_safesync,
419 OMPC_schedule,
420 OMPC_self_maps,
421 OMPC_seq_cst,
422 OMPC_severity,
423 OMPC_shared,
424 OMPC_simd,
425 OMPC_simdlen,
426 OMPC_sizes,
427 OMPC_task_reduction,
428 OMPC_thread_limit,
429 OMPC_threadprivate,
430 OMPC_threads,
431 OMPC_threadset,
432 OMPC_to,
433 OMPC_transparent,
434 OMPC_unified_address,
435 OMPC_unified_shared_memory,
436 OMPC_uniform,
437 OMPC_unknown,
438 OMPC_untied,
439 OMPC_update,
440 OMPC_use,
441 OMPC_use_device_addr,
442 OMPC_use_device_ptr,
443 OMPC_uses_allocators,
444 OMPC_weak,
445 OMPC_when,
446 OMPC_write,
447 Last_ = OMPC_write,
448};
449
450static constexpr std::size_t Clause_enumSize = 137;
451
452constexpr auto OMPC_absent = Clause::OMPC_absent;
453constexpr auto OMPC_acq_rel = Clause::OMPC_acq_rel;
454constexpr auto OMPC_acquire = Clause::OMPC_acquire;
455constexpr auto OMPC_adjust_args = Clause::OMPC_adjust_args;
456constexpr auto OMPC_affinity = Clause::OMPC_affinity;
457constexpr auto OMPC_align = Clause::OMPC_align;
458constexpr auto OMPC_aligned = Clause::OMPC_aligned;
459constexpr auto OMPC_allocate = Clause::OMPC_allocate;
460constexpr auto OMPC_allocator = Clause::OMPC_allocator;
461constexpr auto OMPC_append_args = Clause::OMPC_append_args;
462constexpr auto OMPC_apply = Clause::OMPC_apply;
463constexpr auto OMPC_at = Clause::OMPC_at;
464constexpr auto OMPC_atomic_default_mem_order = Clause::OMPC_atomic_default_mem_order;
465constexpr auto OMPC_bind = Clause::OMPC_bind;
466constexpr auto OMPC_cancellation_construct_type = Clause::OMPC_cancellation_construct_type;
467constexpr auto OMPC_capture = Clause::OMPC_capture;
468constexpr auto OMPC_collapse = Clause::OMPC_collapse;
469constexpr auto OMPC_collector = Clause::OMPC_collector;
470constexpr auto OMPC_combiner = Clause::OMPC_combiner;
471constexpr auto OMPC_compare = Clause::OMPC_compare;
472constexpr auto OMPC_contains = Clause::OMPC_contains;
473constexpr auto OMPC_copyprivate = Clause::OMPC_copyprivate;
474constexpr auto OMPC_copyin = Clause::OMPC_copyin;
475constexpr auto OMPC_counts = Clause::OMPC_counts;
476constexpr auto OMPC_default = Clause::OMPC_default;
477constexpr auto OMPC_defaultmap = Clause::OMPC_defaultmap;
478constexpr auto OMPC_depend = Clause::OMPC_depend;
479constexpr auto OMPC_depobj = Clause::OMPC_depobj;
480constexpr auto OMPC_depth = Clause::OMPC_depth;
481constexpr auto OMPC_destroy = Clause::OMPC_destroy;
482constexpr auto OMPC_detach = Clause::OMPC_detach;
483constexpr auto OMPC_device = Clause::OMPC_device;
484constexpr auto OMPC_device_safesync = Clause::OMPC_device_safesync;
485constexpr auto OMPC_device_type = Clause::OMPC_device_type;
486constexpr auto OMPC_dist_schedule = Clause::OMPC_dist_schedule;
487constexpr auto OMPC_doacross = Clause::OMPC_doacross;
488constexpr auto OMPC_dyn_groupprivate = Clause::OMPC_dyn_groupprivate;
489constexpr auto OMPC_dynamic_allocators = Clause::OMPC_dynamic_allocators;
490constexpr auto OMPC_enter = Clause::OMPC_enter;
491constexpr auto OMPC_exclusive = Clause::OMPC_exclusive;
492constexpr auto OMPC_fail = Clause::OMPC_fail;
493constexpr auto OMPC_filter = Clause::OMPC_filter;
494constexpr auto OMPC_final = Clause::OMPC_final;
495constexpr auto OMPC_firstprivate = Clause::OMPC_firstprivate;
496constexpr auto OMPC_flush = Clause::OMPC_flush;
497constexpr auto OMPC_from = Clause::OMPC_from;
498constexpr auto OMPC_full = Clause::OMPC_full;
499constexpr auto OMPC_grainsize = Clause::OMPC_grainsize;
500constexpr auto OMPC_graph_id = Clause::OMPC_graph_id;
501constexpr auto OMPC_graph_reset = Clause::OMPC_graph_reset;
502constexpr auto OMPC_groupprivate = Clause::OMPC_groupprivate;
503constexpr auto OMPC_has_device_addr = Clause::OMPC_has_device_addr;
504constexpr auto OMPC_hint = Clause::OMPC_hint;
505constexpr auto OMPC_holds = Clause::OMPC_holds;
506constexpr auto OMPC_if = Clause::OMPC_if;
507constexpr auto OMPC_in_reduction = Clause::OMPC_in_reduction;
508constexpr auto OMPC_inbranch = Clause::OMPC_inbranch;
509constexpr auto OMPC_inclusive = Clause::OMPC_inclusive;
510constexpr auto OMPC_indirect = Clause::OMPC_indirect;
511constexpr auto OMPC_induction = Clause::OMPC_induction;
512constexpr auto OMPC_inductor = Clause::OMPC_inductor;
513constexpr auto OMPC_init = Clause::OMPC_init;
514constexpr auto OMPC_init_complete = Clause::OMPC_init_complete;
515constexpr auto OMPC_initializer = Clause::OMPC_initializer;
516constexpr auto OMPC_interop = Clause::OMPC_interop;
517constexpr auto OMPC_is_device_ptr = Clause::OMPC_is_device_ptr;
518constexpr auto OMPC_lastprivate = Clause::OMPC_lastprivate;
519constexpr auto OMPC_linear = Clause::OMPC_linear;
520constexpr auto OMPC_link = Clause::OMPC_link;
521constexpr auto OMPC_local = Clause::OMPC_local;
522constexpr auto OMPC_looprange = Clause::OMPC_looprange;
523constexpr auto OMPC_map = Clause::OMPC_map;
524constexpr auto OMPC_match = Clause::OMPC_match;
525constexpr auto OMPC_memory_order = Clause::OMPC_memory_order;
526constexpr auto OMPC_memscope = Clause::OMPC_memscope;
527constexpr auto OMPC_mergeable = Clause::OMPC_mergeable;
528constexpr auto OMPC_message = Clause::OMPC_message;
529constexpr auto OMPC_nogroup = Clause::OMPC_nogroup;
530constexpr auto OMPC_no_openmp = Clause::OMPC_no_openmp;
531constexpr auto OMPC_no_openmp_constructs = Clause::OMPC_no_openmp_constructs;
532constexpr auto OMPC_no_openmp_routines = Clause::OMPC_no_openmp_routines;
533constexpr auto OMPC_no_parallelism = Clause::OMPC_no_parallelism;
534constexpr auto OMPC_nowait = Clause::OMPC_nowait;
535constexpr auto OMPC_nocontext = Clause::OMPC_nocontext;
536constexpr auto OMPC_nontemporal = Clause::OMPC_nontemporal;
537constexpr auto OMPC_notinbranch = Clause::OMPC_notinbranch;
538constexpr auto OMPC_novariants = Clause::OMPC_novariants;
539constexpr auto OMPC_num_tasks = Clause::OMPC_num_tasks;
540constexpr auto OMPC_num_teams = Clause::OMPC_num_teams;
541constexpr auto OMPC_num_threads = Clause::OMPC_num_threads;
542constexpr auto OMPC_ompx_attribute = Clause::OMPC_ompx_attribute;
543constexpr auto OMPC_ompx_bare = Clause::OMPC_ompx_bare;
544constexpr auto OMPC_ompx_dyn_cgroup_mem = Clause::OMPC_ompx_dyn_cgroup_mem;
545constexpr auto OMPC_order = Clause::OMPC_order;
546constexpr auto OMPC_ordered = Clause::OMPC_ordered;
547constexpr auto OMPC_otherwise = Clause::OMPC_otherwise;
548constexpr auto OMPC_partial = Clause::OMPC_partial;
549constexpr auto OMPC_permutation = Clause::OMPC_permutation;
550constexpr auto OMPC_priority = Clause::OMPC_priority;
551constexpr auto OMPC_private = Clause::OMPC_private;
552constexpr auto OMPC_proc_bind = Clause::OMPC_proc_bind;
553constexpr auto OMPC_read = Clause::OMPC_read;
554constexpr auto OMPC_reduction = Clause::OMPC_reduction;
555constexpr auto OMPC_relaxed = Clause::OMPC_relaxed;
556constexpr auto OMPC_release = Clause::OMPC_release;
557constexpr auto OMPC_replayable = Clause::OMPC_replayable;
558constexpr auto OMPC_reverse_offload = Clause::OMPC_reverse_offload;
559constexpr auto OMPC_safelen = Clause::OMPC_safelen;
560constexpr auto OMPC_safesync = Clause::OMPC_safesync;
561constexpr auto OMPC_schedule = Clause::OMPC_schedule;
562constexpr auto OMPC_self_maps = Clause::OMPC_self_maps;
563constexpr auto OMPC_seq_cst = Clause::OMPC_seq_cst;
564constexpr auto OMPC_severity = Clause::OMPC_severity;
565constexpr auto OMPC_shared = Clause::OMPC_shared;
566constexpr auto OMPC_simd = Clause::OMPC_simd;
567constexpr auto OMPC_simdlen = Clause::OMPC_simdlen;
568constexpr auto OMPC_sizes = Clause::OMPC_sizes;
569constexpr auto OMPC_task_reduction = Clause::OMPC_task_reduction;
570constexpr auto OMPC_thread_limit = Clause::OMPC_thread_limit;
571constexpr auto OMPC_threadprivate = Clause::OMPC_threadprivate;
572constexpr auto OMPC_threads = Clause::OMPC_threads;
573constexpr auto OMPC_threadset = Clause::OMPC_threadset;
574constexpr auto OMPC_to = Clause::OMPC_to;
575constexpr auto OMPC_transparent = Clause::OMPC_transparent;
576constexpr auto OMPC_unified_address = Clause::OMPC_unified_address;
577constexpr auto OMPC_unified_shared_memory = Clause::OMPC_unified_shared_memory;
578constexpr auto OMPC_uniform = Clause::OMPC_uniform;
579constexpr auto OMPC_unknown = Clause::OMPC_unknown;
580constexpr auto OMPC_untied = Clause::OMPC_untied;
581constexpr auto OMPC_update = Clause::OMPC_update;
582constexpr auto OMPC_use = Clause::OMPC_use;
583constexpr auto OMPC_use_device_addr = Clause::OMPC_use_device_addr;
584constexpr auto OMPC_use_device_ptr = Clause::OMPC_use_device_ptr;
585constexpr auto OMPC_uses_allocators = Clause::OMPC_uses_allocators;
586constexpr auto OMPC_weak = Clause::OMPC_weak;
587constexpr auto OMPC_when = Clause::OMPC_when;
588constexpr auto OMPC_write = Clause::OMPC_write;
589
590enum class BindKind {
591 OMP_BIND_parallel=1,
592 OMP_BIND_teams=2,
593 OMP_BIND_thread=3,
594};
595
596constexpr auto OMP_BIND_parallel = BindKind::OMP_BIND_parallel;
597constexpr auto OMP_BIND_teams = BindKind::OMP_BIND_teams;
598constexpr auto OMP_BIND_thread = BindKind::OMP_BIND_thread;
599
600enum class CancellationConstructType {
601 OMP_CANCELLATION_CONSTRUCT_Parallel=1,
602 OMP_CANCELLATION_CONSTRUCT_Loop=2,
603 OMP_CANCELLATION_CONSTRUCT_Sections=3,
604 OMP_CANCELLATION_CONSTRUCT_Taskgroup=4,
605 OMP_CANCELLATION_CONSTRUCT_None=5,
606};
607
608constexpr auto OMP_CANCELLATION_CONSTRUCT_Parallel = CancellationConstructType::OMP_CANCELLATION_CONSTRUCT_Parallel;
609constexpr auto OMP_CANCELLATION_CONSTRUCT_Loop = CancellationConstructType::OMP_CANCELLATION_CONSTRUCT_Loop;
610constexpr auto OMP_CANCELLATION_CONSTRUCT_Sections = CancellationConstructType::OMP_CANCELLATION_CONSTRUCT_Sections;
611constexpr auto OMP_CANCELLATION_CONSTRUCT_Taskgroup = CancellationConstructType::OMP_CANCELLATION_CONSTRUCT_Taskgroup;
612constexpr auto OMP_CANCELLATION_CONSTRUCT_None = CancellationConstructType::OMP_CANCELLATION_CONSTRUCT_None;
613
614enum class GrainsizeType {
615 OMP_GRAINSIZE_Strict=1,
616 OMP_GRAINSIZE_Unknown=2,
617};
618
619constexpr auto OMP_GRAINSIZE_Strict = GrainsizeType::OMP_GRAINSIZE_Strict;
620constexpr auto OMP_GRAINSIZE_Unknown = GrainsizeType::OMP_GRAINSIZE_Unknown;
621
622enum class MemoryOrderKind {
623 OMP_MEMORY_ORDER_SeqCst=1,
624 OMP_MEMORY_ORDER_AcqRel=2,
625 OMP_MEMORY_ORDER_Acquire=3,
626 OMP_MEMORY_ORDER_Release=4,
627 OMP_MEMORY_ORDER_Relaxed=5,
628 OMP_MEMORY_ORDER_Default=6,
629};
630
631constexpr auto OMP_MEMORY_ORDER_SeqCst = MemoryOrderKind::OMP_MEMORY_ORDER_SeqCst;
632constexpr auto OMP_MEMORY_ORDER_AcqRel = MemoryOrderKind::OMP_MEMORY_ORDER_AcqRel;
633constexpr auto OMP_MEMORY_ORDER_Acquire = MemoryOrderKind::OMP_MEMORY_ORDER_Acquire;
634constexpr auto OMP_MEMORY_ORDER_Release = MemoryOrderKind::OMP_MEMORY_ORDER_Release;
635constexpr auto OMP_MEMORY_ORDER_Relaxed = MemoryOrderKind::OMP_MEMORY_ORDER_Relaxed;
636constexpr auto OMP_MEMORY_ORDER_Default = MemoryOrderKind::OMP_MEMORY_ORDER_Default;
637
638enum class NumTasksType {
639 OMP_NUMTASKS_Strict=1,
640 OMP_NUMTASKS_Unknown=2,
641};
642
643constexpr auto OMP_NUMTASKS_Strict = NumTasksType::OMP_NUMTASKS_Strict;
644constexpr auto OMP_NUMTASKS_Unknown = NumTasksType::OMP_NUMTASKS_Unknown;
645
646enum class NumThreadsType {
647 OMP_NUMTHREADS_Strict=1,
648 OMP_NUMTHREADS_Unknown=2,
649};
650
651constexpr auto OMP_NUMTHREADS_Strict = NumThreadsType::OMP_NUMTHREADS_Strict;
652constexpr auto OMP_NUMTHREADS_Unknown = NumThreadsType::OMP_NUMTHREADS_Unknown;
653
654enum class OrderKind {
655 OMP_ORDER_unknown=2,
656 OMP_ORDER_concurrent=1,
657};
658
659constexpr auto OMP_ORDER_unknown = OrderKind::OMP_ORDER_unknown;
660constexpr auto OMP_ORDER_concurrent = OrderKind::OMP_ORDER_concurrent;
661
662enum class ProcBindKind {
663 OMP_PROC_BIND_primary=5,
664 OMP_PROC_BIND_master=2,
665 OMP_PROC_BIND_close=3,
666 OMP_PROC_BIND_spread=4,
667 OMP_PROC_BIND_default=6,
668 OMP_PROC_BIND_unknown=7,
669};
670
671constexpr auto OMP_PROC_BIND_primary = ProcBindKind::OMP_PROC_BIND_primary;
672constexpr auto OMP_PROC_BIND_master = ProcBindKind::OMP_PROC_BIND_master;
673constexpr auto OMP_PROC_BIND_close = ProcBindKind::OMP_PROC_BIND_close;
674constexpr auto OMP_PROC_BIND_spread = ProcBindKind::OMP_PROC_BIND_spread;
675constexpr auto OMP_PROC_BIND_default = ProcBindKind::OMP_PROC_BIND_default;
676constexpr auto OMP_PROC_BIND_unknown = ProcBindKind::OMP_PROC_BIND_unknown;
677
678enum class ScheduleKind {
679 OMP_SCHEDULE_Static=2,
680 OMP_SCHEDULE_Dynamic=3,
681 OMP_SCHEDULE_Guided=4,
682 OMP_SCHEDULE_Auto=5,
683 OMP_SCHEDULE_Runtime=6,
684 OMP_SCHEDULE_Distribute=7,
685 OMP_SCHEDULE_Default=8,
686};
687
688constexpr auto OMP_SCHEDULE_Static = ScheduleKind::OMP_SCHEDULE_Static;
689constexpr auto OMP_SCHEDULE_Dynamic = ScheduleKind::OMP_SCHEDULE_Dynamic;
690constexpr auto OMP_SCHEDULE_Guided = ScheduleKind::OMP_SCHEDULE_Guided;
691constexpr auto OMP_SCHEDULE_Auto = ScheduleKind::OMP_SCHEDULE_Auto;
692constexpr auto OMP_SCHEDULE_Runtime = ScheduleKind::OMP_SCHEDULE_Runtime;
693constexpr auto OMP_SCHEDULE_Distribute = ScheduleKind::OMP_SCHEDULE_Distribute;
694constexpr auto OMP_SCHEDULE_Default = ScheduleKind::OMP_SCHEDULE_Default;
695
696// Enumeration helper functions
697LLVM_ABI std::pair<Directive, directive::VersionRange> getOpenMPDirectiveKindAndVersions(StringRef Str);
698inline Directive getOpenMPDirectiveKind(StringRef Str) {
699 return getOpenMPDirectiveKindAndVersions(Str).first;
700}
701
702LLVM_ABI StringRef getOpenMPDirectiveName(Directive D, unsigned Ver = 0);
703
704LLVM_ABI std::pair<Clause, directive::VersionRange> getOpenMPClauseKindAndVersions(StringRef Str);
705
706inline Clause getOpenMPClauseKind(StringRef Str) {
707 return getOpenMPClauseKindAndVersions(Str).first;
708}
709
710LLVM_ABI StringRef getOpenMPClauseName(Clause C, unsigned Ver = 0);
711
712/// Return true if \p C is a valid clause for \p D in version \p Version.
713LLVM_ABI bool isAllowedClauseForDirective(Directive D, Clause C, unsigned Version);
714
715constexpr std::size_t getMaxLeafCount() { return 6; }
716LLVM_ABI Association getDirectiveAssociation(Directive D);
717LLVM_ABI Category getDirectiveCategory(Directive D);
718LLVM_ABI SourceLanguage getDirectiveLanguages(Directive D);
719LLVM_ABI BindKind getBindKind(StringRef Str);
720LLVM_ABI StringRef getOpenMPBindKindName(BindKind x);
721LLVM_ABI CancellationConstructType getCancellationConstructType(StringRef Str);
722LLVM_ABI StringRef getOpenMPCancellationConstructTypeName(CancellationConstructType x);
723LLVM_ABI GrainsizeType getGrainsizeType(StringRef Str);
724LLVM_ABI StringRef getOpenMPGrainsizeTypeName(GrainsizeType x);
725LLVM_ABI MemoryOrderKind getMemoryOrderKind(StringRef Str);
726LLVM_ABI StringRef getOpenMPMemoryOrderKindName(MemoryOrderKind x);
727LLVM_ABI NumTasksType getNumTasksType(StringRef Str);
728LLVM_ABI StringRef getOpenMPNumTasksTypeName(NumTasksType x);
729LLVM_ABI NumThreadsType getNumThreadsType(StringRef Str);
730LLVM_ABI StringRef getOpenMPNumThreadsTypeName(NumThreadsType x);
731LLVM_ABI OrderKind getOrderKind(StringRef Str);
732LLVM_ABI StringRef getOpenMPOrderKindName(OrderKind x);
733LLVM_ABI ProcBindKind getProcBindKind(StringRef Str);
734LLVM_ABI StringRef getOpenMPProcBindKindName(ProcBindKind x);
735LLVM_ABI ScheduleKind getScheduleKind(StringRef Str);
736LLVM_ABI StringRef getOpenMPScheduleKindName(ScheduleKind x);
737
738} // namespace omp
739
740template <> struct enum_iteration_traits<omp::Association> {
741 static constexpr bool is_iterable = true;
742};
743
744template <> struct enum_iteration_traits<omp::Category> {
745 static constexpr bool is_iterable = true;
746};
747
748template <> struct enum_iteration_traits<omp::Directive> {
749 static constexpr bool is_iterable = true;
750};
751
752template <> struct enum_iteration_traits<omp::Clause> {
753 static constexpr bool is_iterable = true;
754};
755
756} // namespace llvm
757
758#endif // LLVM_OpenMP_INC
759
760