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