1//===--- OMPKinds.def - OpenMP directives, clauses, rt-calls -*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8/// \file
9///
10/// This file defines the list of supported OpenMP runtime
11/// calls, and other things that need to be listed in enums.
12///
13/// This file is under transition to OMP.td with TableGen code generation.
14///
15//===----------------------------------------------------------------------===//
16
17/// OpenMP Directives, combined directives and Clauses
18/// - Moved to OMP.td
19
20/// Types used in runtime structs or runtime functions
21///
22///{
23
24#ifndef OMP_TYPE
25#define OMP_TYPE(VarName, InitValue)
26#endif
27
28#define __OMP_TYPE(VarName) OMP_TYPE(VarName, Type::get##VarName##Ty(Ctx))
29
30__OMP_TYPE(Void)
31__OMP_TYPE(Int1)
32__OMP_TYPE(Int8)
33__OMP_TYPE(Int16)
34__OMP_TYPE(Int32)
35__OMP_TYPE(Int64)
36__OMP_TYPE(Int8Ptr)
37__OMP_TYPE(Int16Ptr)
38__OMP_TYPE(Int32Ptr)
39__OMP_TYPE(Int64Ptr)
40
41OMP_TYPE(SizeTy, M.getDataLayout().getIntPtrType(Ctx))
42OMP_TYPE(LanemaskTy, getLanemaskType())
43
44#define __OMP_PTR_TYPE(NAME, BASE) OMP_TYPE(NAME, BASE->getPointerTo())
45
46__OMP_PTR_TYPE(VoidPtr, Int8)
47__OMP_PTR_TYPE(VoidPtrPtr, VoidPtr)
48__OMP_PTR_TYPE(VoidPtrPtrPtr, VoidPtrPtr)
49
50__OMP_PTR_TYPE(Int8PtrPtr, Int8Ptr)
51__OMP_PTR_TYPE(Int8PtrPtrPtr, Int8PtrPtr)
52
53#undef __OMP_PTR_TYPE
54
55#undef __OMP_TYPE
56#undef OMP_TYPE
57
58///}
59
60/// array types
61///
62///{
63
64#ifndef OMP_ARRAY_TYPE
65#define OMP_ARRAY_TYPE(VarName, ElemTy, ArraySize)
66#endif
67
68#define __OMP_ARRAY_TYPE(VarName, ElemTy, ArraySize)                           \
69  OMP_ARRAY_TYPE(VarName, ElemTy, ArraySize)
70
71__OMP_ARRAY_TYPE(KmpCriticalName, Int32, 8)
72
73#undef __OMP_ARRAY_TYPE
74#undef OMP_ARRAY_TYPE
75
76///}
77
78/// Struct and function types
79///
80///{
81
82#ifndef OMP_STRUCT_TYPE
83#define OMP_STRUCT_TYPE(VarName, StructName, ...)
84#endif
85
86#define __OMP_STRUCT_TYPE(VarName, Name, ...)                                  \
87  OMP_STRUCT_TYPE(VarName, "struct." #Name, __VA_ARGS__)
88
89__OMP_STRUCT_TYPE(Ident, ident_t, Int32, Int32, Int32, Int32, Int8Ptr)
90__OMP_STRUCT_TYPE(AsyncInfo, __tgt_async_info, Int8Ptr)
91
92#undef __OMP_STRUCT_TYPE
93#undef OMP_STRUCT_TYPE
94
95#ifndef OMP_FUNCTION_TYPE
96#define OMP_FUNCTION_TYPE(VarName, IsVarArg, ReturnType, ...)
97#endif
98
99#define __OMP_FUNCTION_TYPE(VarName, IsVarArg, ReturnType, ...)                \
100  OMP_FUNCTION_TYPE(VarName, IsVarArg, ReturnType, __VA_ARGS__)
101
102__OMP_FUNCTION_TYPE(ParallelTask, true, Void, Int32Ptr, Int32Ptr)
103__OMP_FUNCTION_TYPE(ReduceFunction, false, Void, VoidPtr, VoidPtr)
104__OMP_FUNCTION_TYPE(CopyFunction, false, Void, VoidPtr, VoidPtr)
105__OMP_FUNCTION_TYPE(KmpcCtor, false, VoidPtr, VoidPtr)
106__OMP_FUNCTION_TYPE(KmpcDtor, false, Void, VoidPtr)
107__OMP_FUNCTION_TYPE(KmpcCopyCtor, false, VoidPtr, VoidPtr, VoidPtr)
108__OMP_FUNCTION_TYPE(TaskRoutineEntry, false, Int32, Int32,
109                    /* kmp_task_t */ VoidPtr)
110__OMP_FUNCTION_TYPE(ShuffleReduce, false, Void, VoidPtr, Int16, Int16, Int16)
111__OMP_FUNCTION_TYPE(InterWarpCopy, false, Void, VoidPtr, Int32)
112__OMP_FUNCTION_TYPE(GlobalList, false, Void, VoidPtr, Int32, VoidPtr)
113
114#undef __OMP_FUNCTION_TYPE
115#undef OMP_FUNCTION_TYPE
116
117///}
118
119/// Internal Control Variables information
120///
121///{
122
123#ifndef ICV_INIT_VALUE
124#define ICV_INIT_VALUE(Enum, Name)
125#endif
126
127#define __ICV_INIT_VALUE(Name) ICV_INIT_VALUE(ICV_##Name, #Name)
128
129__ICV_INIT_VALUE(ZERO)
130__ICV_INIT_VALUE(FALSE)
131__ICV_INIT_VALUE(IMPLEMENTATION_DEFINED)
132__ICV_INIT_VALUE(LAST)
133
134#undef __ICV_INIT_VALUE
135#undef ICV_INIT_VALUE
136
137#ifndef ICV_DATA_ENV
138#define ICV_DATA_ENV(Enum, Name, EnvVarName, Init)
139#endif
140
141#define __ICV_DATA_ENV(Name, EnvVarName, Init)                                 \
142  ICV_DATA_ENV(ICV_##Name, #Name, #EnvVarName, Init)
143
144__ICV_DATA_ENV(nthreads, OMP_NUM_THREADS, ICV_IMPLEMENTATION_DEFINED)
145__ICV_DATA_ENV(active_levels, NONE, ICV_ZERO)
146__ICV_DATA_ENV(cancel, OMP_CANCELLATION, ICV_FALSE)
147__ICV_DATA_ENV(proc_bind, OMP_PROC_BIND, ICV_IMPLEMENTATION_DEFINED)
148__ICV_DATA_ENV(__last, last, ICV_LAST)
149
150#undef __ICV_DATA_ENV
151#undef ICV_DATA_ENV
152
153#ifndef ICV_RT_SET
154#define ICV_RT_SET(Name, RTL)
155#endif
156
157#define __ICV_RT_SET(Name, RTL) ICV_RT_SET(ICV_##Name, OMPRTL_##RTL)
158
159__ICV_RT_SET(nthreads, omp_set_num_threads)
160
161#undef __ICV_RT_SET
162#undef ICV_RT_SET
163
164#ifndef ICV_RT_GET
165#define ICV_RT_GET(Name, RTL)
166#endif
167
168#define __ICV_RT_GET(Name, RTL) ICV_RT_GET(ICV_##Name, OMPRTL_##RTL)
169
170__ICV_RT_GET(nthreads, omp_get_max_threads)
171__ICV_RT_GET(active_levels, omp_get_active_level)
172__ICV_RT_GET(cancel, omp_get_cancellation)
173__ICV_RT_GET(proc_bind, omp_get_proc_bind)
174
175#undef __ICV_RT_GET
176#undef ICV_RT_GET
177
178///}
179
180/// Runtime library function (and their attributes)
181///
182///{
183
184#ifndef OMP_RTL
185#define OMP_RTL(Enum, Str, IsVarArg, ReturnType, ...)
186#endif
187
188#define __OMP_RTL(Name, IsVarArg, ReturnType, ...)                             \
189  OMP_RTL(OMPRTL_##Name, #Name, IsVarArg, ReturnType, __VA_ARGS__)
190
191
192
193__OMP_RTL(__kmpc_barrier, false, Void, IdentPtr, Int32)
194__OMP_RTL(__kmpc_cancel, false, Int32, IdentPtr, Int32, Int32)
195__OMP_RTL(__kmpc_cancel_barrier, false, Int32, IdentPtr, Int32)
196__OMP_RTL(__kmpc_flush, false, Void, IdentPtr)
197__OMP_RTL(__kmpc_global_thread_num, false, Int32, IdentPtr)
198__OMP_RTL(__kmpc_get_hardware_thread_id_in_block, false, Int32, )
199__OMP_RTL(__kmpc_fork_call, true, Void, IdentPtr, Int32, ParallelTaskPtr)
200__OMP_RTL(__kmpc_omp_taskwait, false, Int32, IdentPtr, Int32)
201__OMP_RTL(__kmpc_omp_taskyield, false, Int32, IdentPtr, Int32, /* Int */ Int32)
202__OMP_RTL(__kmpc_push_num_threads, false, Void, IdentPtr, Int32,
203          /* Int */ Int32)
204__OMP_RTL(__kmpc_push_proc_bind, false, Void, IdentPtr, Int32, /* Int */ Int32)
205__OMP_RTL(__kmpc_omp_reg_task_with_affinity, false, Int32, IdentPtr, Int32,
206          /* kmp_task_t */ VoidPtr, Int32,
207          /* kmp_task_affinity_info_t */ VoidPtr)
208
209__OMP_RTL(__kmpc_get_hardware_num_blocks, false, Int32, )
210__OMP_RTL(__kmpc_get_hardware_num_threads_in_block, false, Int32, )
211
212__OMP_RTL(omp_get_thread_num, false, Int32, )
213__OMP_RTL(omp_get_num_threads, false, Int32, )
214__OMP_RTL(omp_get_max_threads, false, Int32, )
215__OMP_RTL(omp_in_parallel, false, Int32, )
216__OMP_RTL(omp_get_dynamic, false, Int32, )
217__OMP_RTL(omp_get_cancellation, false, Int32, )
218__OMP_RTL(omp_get_nested, false, Int32, )
219__OMP_RTL(omp_get_schedule, false, Void, Int32Ptr, Int32Ptr)
220__OMP_RTL(omp_get_thread_limit, false, Int32, )
221__OMP_RTL(omp_get_supported_active_levels, false, Int32, )
222__OMP_RTL(omp_get_max_active_levels, false, Int32, )
223__OMP_RTL(omp_get_level, false, Int32, )
224__OMP_RTL(omp_get_ancestor_thread_num, false, Int32, Int32)
225__OMP_RTL(omp_get_team_size, false, Int32, Int32)
226__OMP_RTL(omp_get_active_level, false, Int32, )
227__OMP_RTL(omp_in_final, false, Int32, )
228__OMP_RTL(omp_get_proc_bind, false, Int32, )
229__OMP_RTL(omp_get_num_places, false, Int32, )
230__OMP_RTL(omp_get_num_procs, false, Int32, )
231__OMP_RTL(omp_get_place_proc_ids, false, Void, Int32, Int32Ptr)
232__OMP_RTL(omp_get_place_num, false, Int32, )
233__OMP_RTL(omp_get_partition_num_places, false, Int32, )
234__OMP_RTL(omp_get_partition_place_nums, false, Void, Int32Ptr)
235
236__OMP_RTL(omp_set_num_threads, false, Void, Int32)
237__OMP_RTL(omp_set_dynamic, false, Void, Int32)
238__OMP_RTL(omp_set_nested, false, Void, Int32)
239__OMP_RTL(omp_set_schedule, false, Void, Int32, Int32)
240__OMP_RTL(omp_set_max_active_levels, false, Void, Int32)
241
242__OMP_RTL(__kmpc_master, false, Int32, IdentPtr, Int32)
243__OMP_RTL(__kmpc_end_master, false, Void, IdentPtr, Int32)
244__OMP_RTL(__kmpc_masked, false, Int32, IdentPtr, Int32, Int32)
245__OMP_RTL(__kmpc_end_masked, false, Void, IdentPtr, Int32)
246__OMP_RTL(__kmpc_critical, false, Void, IdentPtr, Int32, KmpCriticalNamePtrTy)
247__OMP_RTL(__kmpc_critical_with_hint, false, Void, IdentPtr, Int32,
248          KmpCriticalNamePtrTy, Int32)
249__OMP_RTL(__kmpc_end_critical, false, Void, IdentPtr, Int32,
250          KmpCriticalNamePtrTy)
251
252__OMP_RTL(__kmpc_begin, false, Void, IdentPtr, Int32)
253__OMP_RTL(__kmpc_end, false, Void, IdentPtr)
254
255__OMP_RTL(__kmpc_reduce, false, Int32, IdentPtr, Int32, Int32, SizeTy, VoidPtr,
256          ReduceFunctionPtr, KmpCriticalNamePtrTy)
257__OMP_RTL(__kmpc_reduce_nowait, false, Int32, IdentPtr, Int32, Int32, SizeTy,
258          VoidPtr, ReduceFunctionPtr, KmpCriticalNamePtrTy)
259__OMP_RTL(__kmpc_end_reduce, false, Void, IdentPtr, Int32, KmpCriticalNamePtrTy)
260__OMP_RTL(__kmpc_end_reduce_nowait, false, Void, IdentPtr, Int32,
261          KmpCriticalNamePtrTy)
262
263__OMP_RTL(__kmpc_ordered, false, Void, IdentPtr, Int32)
264__OMP_RTL(__kmpc_end_ordered, false, Void, IdentPtr, Int32)
265
266__OMP_RTL(__kmpc_for_static_init_4, false, Void, IdentPtr, Int32, Int32,
267          Int32Ptr, Int32Ptr, Int32Ptr, Int32Ptr, Int32, Int32)
268__OMP_RTL(__kmpc_for_static_init_4u, false, Void, IdentPtr, Int32, Int32,
269          Int32Ptr, Int32Ptr, Int32Ptr, Int32Ptr, Int32, Int32)
270__OMP_RTL(__kmpc_for_static_init_8, false, Void, IdentPtr, Int32, Int32,
271          Int32Ptr, Int64Ptr, Int64Ptr, Int64Ptr, Int64, Int64)
272__OMP_RTL(__kmpc_for_static_init_8u, false, Void, IdentPtr, Int32, Int32,
273          Int32Ptr, Int64Ptr, Int64Ptr, Int64Ptr, Int64, Int64)
274__OMP_RTL(__kmpc_for_static_fini, false, Void, IdentPtr, Int32)
275__OMP_RTL(__kmpc_dist_dispatch_init_4, false, Void, IdentPtr, Int32, Int32,
276          Int32Ptr, Int32, Int32, Int32, Int32)
277__OMP_RTL(__kmpc_dist_dispatch_init_4u, false, Void, IdentPtr, Int32, Int32,
278          Int32Ptr, Int32, Int32, Int32, Int32)
279__OMP_RTL(__kmpc_dist_dispatch_init_8, false, Void, IdentPtr, Int32, Int32,
280          Int32Ptr, Int64, Int64, Int64, Int64)
281__OMP_RTL(__kmpc_dist_dispatch_init_8u, false, Void, IdentPtr, Int32, Int32,
282          Int32Ptr, Int64, Int64, Int64, Int64)
283__OMP_RTL(__kmpc_dispatch_init_4, false, Void, IdentPtr, Int32, Int32, Int32,
284          Int32, Int32, Int32)
285__OMP_RTL(__kmpc_dispatch_init_4u, false, Void, IdentPtr, Int32, Int32, Int32,
286          Int32, Int32, Int32)
287__OMP_RTL(__kmpc_dispatch_init_8, false, Void, IdentPtr, Int32, Int32, Int64,
288          Int64, Int64, Int64)
289__OMP_RTL(__kmpc_dispatch_init_8u, false, Void, IdentPtr, Int32, Int32, Int64,
290          Int64, Int64, Int64)
291__OMP_RTL(__kmpc_dispatch_next_4, false, Int32, IdentPtr, Int32, Int32Ptr,
292          Int32Ptr, Int32Ptr, Int32Ptr)
293__OMP_RTL(__kmpc_dispatch_next_4u, false, Int32, IdentPtr, Int32, Int32Ptr,
294          Int32Ptr, Int32Ptr, Int32Ptr)
295__OMP_RTL(__kmpc_dispatch_next_8, false, Int32, IdentPtr, Int32, Int32Ptr,
296          Int64Ptr, Int64Ptr, Int64Ptr)
297__OMP_RTL(__kmpc_dispatch_next_8u, false, Int32, IdentPtr, Int32, Int32Ptr,
298          Int64Ptr, Int64Ptr, Int64Ptr)
299__OMP_RTL(__kmpc_dispatch_fini_4, false, Void, IdentPtr, Int32)
300__OMP_RTL(__kmpc_dispatch_fini_4u, false, Void, IdentPtr, Int32)
301__OMP_RTL(__kmpc_dispatch_fini_8, false, Void, IdentPtr, Int32)
302__OMP_RTL(__kmpc_dispatch_fini_8u, false, Void, IdentPtr, Int32)
303__OMP_RTL(__kmpc_team_static_init_4, false, Void, IdentPtr, Int32, Int32Ptr,
304          Int32Ptr, Int32Ptr, Int32Ptr, Int32, Int32)
305__OMP_RTL(__kmpc_team_static_init_4u, false, Void, IdentPtr, Int32, Int32Ptr,
306          Int32Ptr, Int32Ptr, Int32Ptr, Int32, Int32)
307__OMP_RTL(__kmpc_team_static_init_8, false, Void, IdentPtr, Int32, Int32Ptr,
308          Int64Ptr, Int64Ptr, Int64Ptr, Int64, Int64)
309__OMP_RTL(__kmpc_team_static_init_8u, false, Void, IdentPtr, Int32, Int32Ptr,
310          Int64Ptr, Int64Ptr, Int64Ptr, Int64, Int64)
311__OMP_RTL(__kmpc_dist_for_static_init_4, false, Void, IdentPtr, Int32, Int32,
312          Int32Ptr, Int32Ptr, Int32Ptr, Int32Ptr, Int32Ptr, Int32, Int32)
313__OMP_RTL(__kmpc_dist_for_static_init_4u, false, Void, IdentPtr, Int32, Int32,
314          Int32Ptr, Int32Ptr, Int32Ptr, Int32Ptr, Int32Ptr, Int32, Int32)
315__OMP_RTL(__kmpc_dist_for_static_init_8, false, Void, IdentPtr, Int32, Int32,
316          Int32Ptr, Int64Ptr, Int64Ptr, Int64Ptr, Int64Ptr, Int64, Int64)
317__OMP_RTL(__kmpc_dist_for_static_init_8u, false, Void, IdentPtr, Int32, Int32,
318          Int32Ptr, Int64Ptr, Int64Ptr, Int64Ptr, Int64Ptr, Int64, Int64)
319
320__OMP_RTL(__kmpc_single, false, Int32, IdentPtr, Int32)
321__OMP_RTL(__kmpc_end_single, false, Void, IdentPtr, Int32)
322
323__OMP_RTL(__kmpc_omp_task_alloc, false, /* kmp_task_t */ VoidPtr, IdentPtr,
324          Int32, Int32, SizeTy, SizeTy, TaskRoutineEntryPtr)
325__OMP_RTL(__kmpc_omp_task, false, Int32, IdentPtr, Int32,
326          /* kmp_task_t */ VoidPtr)
327__OMP_RTL(__kmpc_end_taskgroup, false, Void, IdentPtr, Int32)
328__OMP_RTL(__kmpc_taskgroup, false, Void, IdentPtr, Int32)
329__OMP_RTL(__kmpc_omp_task_begin_if0, false, Void, IdentPtr, Int32,
330          /* kmp_task_t */ VoidPtr)
331__OMP_RTL(__kmpc_omp_task_complete_if0, false, Void, IdentPtr, Int32,
332          /* kmp_tasK_t */ VoidPtr)
333__OMP_RTL(__kmpc_omp_task_with_deps, false, Int32, IdentPtr, Int32,
334          /* kmp_task_t */ VoidPtr, Int32,
335          /* kmp_depend_info_t */ VoidPtr, Int32,
336          /* kmp_depend_info_t */ VoidPtr)
337__OMP_RTL(__kmpc_taskloop, false, Void, IdentPtr, /* Int */ Int32, VoidPtr,
338          /* Int */ Int32, Int64Ptr, Int64Ptr, Int64, /* Int */ Int32,
339          /* Int */ Int32, Int64, VoidPtr)
340__OMP_RTL(__kmpc_omp_target_task_alloc, false, /* kmp_task_t */ VoidPtr,
341          IdentPtr, Int32, Int32, SizeTy, SizeTy, TaskRoutineEntryPtr, Int64)
342__OMP_RTL(__kmpc_taskred_modifier_init, false, /* kmp_taskgroup */ VoidPtr,
343          IdentPtr, /* Int */ Int32, /* Int */ Int32, /* Int */ Int32, VoidPtr)
344__OMP_RTL(__kmpc_taskred_init, false, /* kmp_taskgroup */ VoidPtr,
345          /* Int */ Int32, /* Int */ Int32, VoidPtr)
346__OMP_RTL(__kmpc_task_reduction_modifier_fini, false, Void, IdentPtr,
347          /* Int */ Int32, /* Int */ Int32)
348__OMP_RTL(__kmpc_task_reduction_get_th_data, false, VoidPtr, Int32, VoidPtr,
349          VoidPtr)
350__OMP_RTL(__kmpc_task_reduction_init, false, VoidPtr, Int32, Int32, VoidPtr)
351__OMP_RTL(__kmpc_task_reduction_modifier_init, false, VoidPtr, VoidPtr, Int32,
352          Int32, Int32, VoidPtr)
353__OMP_RTL(__kmpc_proxy_task_completed_ooo, false, Void, VoidPtr)
354
355__OMP_RTL(__kmpc_omp_wait_deps, false, Void, IdentPtr, Int32, Int32,
356          /* kmp_depend_info_t */ VoidPtr, Int32, VoidPtr)
357__OMP_RTL(__kmpc_cancellationpoint, false, Int32, IdentPtr, Int32, Int32)
358
359__OMP_RTL(__kmpc_fork_teams, true, Void, IdentPtr, Int32, ParallelTaskPtr)
360__OMP_RTL(__kmpc_push_num_teams, false, Void, IdentPtr, Int32, Int32, Int32)
361
362__OMP_RTL(__kmpc_copyprivate, false, Void, IdentPtr, Int32, SizeTy, VoidPtr,
363          CopyFunctionPtr, Int32)
364__OMP_RTL(__kmpc_threadprivate_cached, false, VoidPtr, IdentPtr, Int32, VoidPtr,
365          SizeTy, VoidPtrPtrPtr)
366__OMP_RTL(__kmpc_threadprivate_register, false, Void, IdentPtr, VoidPtr,
367          KmpcCtorPtr, KmpcCopyCtorPtr, KmpcDtorPtr)
368
369__OMP_RTL(__kmpc_doacross_init, false, Void, IdentPtr, Int32, Int32,
370          /* kmp_dim */ VoidPtr)
371__OMP_RTL(__kmpc_doacross_post, false, Void, IdentPtr, Int32, Int64Ptr)
372__OMP_RTL(__kmpc_doacross_wait, false, Void, IdentPtr, Int32, Int64Ptr)
373__OMP_RTL(__kmpc_doacross_fini, false, Void, IdentPtr, Int32)
374
375__OMP_RTL(__kmpc_alloc, false, VoidPtr, /* Int */ Int32, SizeTy, VoidPtr)
376__OMP_RTL(__kmpc_free, false, Void, /* Int */ Int32, VoidPtr, VoidPtr)
377
378__OMP_RTL(__kmpc_init_allocator, false, /* omp_allocator_handle_t */ VoidPtr,
379          /* Int */ Int32, /* omp_memespace_handle_t */ VoidPtr,
380          /* Int */ Int32, /* omp_alloctrait_t */ VoidPtr)
381__OMP_RTL(__kmpc_destroy_allocator, false, Void, /* Int */ Int32,
382          /* omp_allocator_handle_t */ VoidPtr)
383
384__OMP_RTL(__kmpc_push_target_tripcount_mapper, false, Void, IdentPtr, Int64, Int64)
385__OMP_RTL(__tgt_target_mapper, false, Int32, IdentPtr, Int64, VoidPtr, Int32, VoidPtrPtr,
386          VoidPtrPtr, Int64Ptr, Int64Ptr, VoidPtrPtr, VoidPtrPtr)
387__OMP_RTL(__tgt_target_nowait_mapper, false, Int32, IdentPtr, Int64, VoidPtr,
388          Int32, VoidPtrPtr, VoidPtrPtr, Int64Ptr, Int64Ptr, VoidPtrPtr,
389          VoidPtrPtr, Int32, VoidPtr, Int32, VoidPtr)
390__OMP_RTL(__tgt_target_teams_mapper, false, Int32, IdentPtr, Int64, VoidPtr, Int32,
391          VoidPtrPtr, VoidPtrPtr, Int64Ptr, Int64Ptr, VoidPtrPtr, VoidPtrPtr, Int32, Int32)
392__OMP_RTL(__tgt_target_teams_nowait_mapper, false, Int32, IdentPtr, Int64,
393          VoidPtr, Int32, VoidPtrPtr, VoidPtrPtr, Int64Ptr, Int64Ptr,
394          VoidPtrPtr, VoidPtrPtr, Int32, Int32, Int32, VoidPtr, Int32, VoidPtr)
395__OMP_RTL(__tgt_register_requires, false, Void, Int64)
396__OMP_RTL(__tgt_target_data_begin_mapper, false, Void, IdentPtr, Int64, Int32, VoidPtrPtr,
397          VoidPtrPtr, Int64Ptr, Int64Ptr, VoidPtrPtr, VoidPtrPtr)
398__OMP_RTL(__tgt_target_data_begin_nowait_mapper, false, Void, IdentPtr, Int64, Int32,
399          VoidPtrPtr, VoidPtrPtr, Int64Ptr, Int64Ptr, VoidPtrPtr, VoidPtrPtr)
400__OMP_RTL(__tgt_target_data_begin_mapper_issue, false, Void, IdentPtr, Int64, Int32,
401          VoidPtrPtr, VoidPtrPtr, Int64Ptr, Int64Ptr, VoidPtrPtr, VoidPtrPtr, AsyncInfoPtr)
402__OMP_RTL(__tgt_target_data_begin_mapper_wait, false, Void, Int64, AsyncInfoPtr)
403__OMP_RTL(__tgt_target_data_end_mapper, false, Void, IdentPtr, Int64, Int32, VoidPtrPtr,
404          VoidPtrPtr, Int64Ptr, Int64Ptr, VoidPtrPtr, VoidPtrPtr)
405__OMP_RTL(__tgt_target_data_end_nowait_mapper, false, Void, IdentPtr, Int64, Int32,
406          VoidPtrPtr, VoidPtrPtr, Int64Ptr, Int64Ptr, VoidPtrPtr, VoidPtrPtr)
407__OMP_RTL(__tgt_target_data_update_mapper, false, Void, IdentPtr, Int64, Int32,
408          VoidPtrPtr, VoidPtrPtr, Int64Ptr, Int64Ptr, VoidPtrPtr, VoidPtrPtr)
409__OMP_RTL(__tgt_target_data_update_nowait_mapper, false, Void, IdentPtr, Int64, Int32,
410          VoidPtrPtr, VoidPtrPtr, Int64Ptr, Int64Ptr, VoidPtrPtr, VoidPtrPtr)
411__OMP_RTL(__tgt_mapper_num_components, false, Int64, VoidPtr)
412__OMP_RTL(__tgt_push_mapper_component, false, Void, VoidPtr, VoidPtr, VoidPtr,
413          Int64, Int64, VoidPtr)
414__OMP_RTL(__kmpc_task_allow_completion_event, false, VoidPtr, IdentPtr,
415          /* Int */ Int32, /* kmp_task_t */ VoidPtr)
416
417/// OpenMP Device runtime functions
418__OMP_RTL(__kmpc_target_init, false, Int32, IdentPtr, Int1, Int1, Int1)
419__OMP_RTL(__kmpc_target_deinit, false, Void, IdentPtr, Int1, Int1)
420__OMP_RTL(__kmpc_kernel_prepare_parallel, false, Void, VoidPtr)
421__OMP_RTL(__kmpc_parallel_51, false, Void, IdentPtr, Int32, Int32, Int32, Int32,
422          VoidPtr, VoidPtr, VoidPtrPtr, SizeTy)
423__OMP_RTL(__kmpc_kernel_parallel, false, Int1, VoidPtrPtr)
424__OMP_RTL(__kmpc_kernel_end_parallel, false, Void, )
425__OMP_RTL(__kmpc_serialized_parallel, false, Void, IdentPtr, Int32)
426__OMP_RTL(__kmpc_end_serialized_parallel, false, Void, IdentPtr, Int32)
427__OMP_RTL(__kmpc_shuffle_int32, false, Int32, Int32, Int16, Int16)
428__OMP_RTL(__kmpc_nvptx_parallel_reduce_nowait_v2, false, Int32, IdentPtr, Int32,
429          Int32, SizeTy, VoidPtr, ShuffleReducePtr, InterWarpCopyPtr)
430__OMP_RTL(__kmpc_nvptx_end_reduce_nowait, false, Void, Int32)
431__OMP_RTL(__kmpc_nvptx_teams_reduce_nowait_v2, false, Int32, IdentPtr, Int32,
432          VoidPtr, Int32, VoidPtr, ShuffleReducePtr, InterWarpCopyPtr,
433          GlobalListPtr, GlobalListPtr, GlobalListPtr, GlobalListPtr)
434
435__OMP_RTL(__kmpc_shuffle_int64, false, Int64, Int64, Int16, Int16)
436
437__OMP_RTL(__kmpc_alloc_shared, false, VoidPtr, SizeTy)
438__OMP_RTL(__kmpc_free_shared, false, Void, VoidPtr, SizeTy)
439__OMP_RTL(__kmpc_begin_sharing_variables, false, Void, VoidPtrPtrPtr, SizeTy)
440__OMP_RTL(__kmpc_end_sharing_variables, false, Void, )
441__OMP_RTL(__kmpc_get_shared_variables, false, Void, VoidPtrPtrPtr)
442__OMP_RTL(__kmpc_parallel_level, false, Int8, )
443__OMP_RTL(__kmpc_is_spmd_exec_mode, false, Int8, )
444__OMP_RTL(__kmpc_barrier_simple_spmd, false, Void, IdentPtr, Int32)
445
446__OMP_RTL(__kmpc_warp_active_thread_mask, false, LanemaskTy,)
447__OMP_RTL(__kmpc_syncwarp, false, Void, LanemaskTy)
448
449__OMP_RTL(__kmpc_is_generic_main_thread_id, false, Int8, Int32)
450
451__OMP_RTL(__last, false, Void, )
452
453#undef __OMP_RTL
454#undef OMP_RTL
455
456#define ParamAttrs(...) ArrayRef<AttributeSet>({__VA_ARGS__})
457#define EnumAttr(Kind) Attribute::get(Ctx, Attribute::AttrKind::Kind)
458#define EnumAttrInt(Kind, N) Attribute::get(Ctx, Attribute::AttrKind::Kind, N)
459#define AttributeSet(...)                                                      \
460  AttributeSet::get(Ctx, ArrayRef<Attribute>({__VA_ARGS__}))
461
462#ifndef OMP_ATTRS_SET
463#define OMP_ATTRS_SET(VarName, AttrSet)
464#endif
465
466#define __OMP_ATTRS_SET(VarName, AttrSet) OMP_ATTRS_SET(VarName, AttrSet)
467
468__OMP_ATTRS_SET(GetterAttrs,
469                OptimisticAttributes
470                    ? AttributeSet(EnumAttr(NoUnwind), EnumAttr(ReadOnly),
471                                   EnumAttr(NoSync), EnumAttr(NoFree),
472                                   EnumAttr(InaccessibleMemOnly),
473                                   EnumAttr(WillReturn))
474                    : AttributeSet(EnumAttr(NoUnwind)))
475__OMP_ATTRS_SET(GetterArgWriteAttrs,
476                OptimisticAttributes
477                    ? AttributeSet(EnumAttr(NoUnwind), EnumAttr(NoSync),
478                                   EnumAttr(NoFree),
479                                   EnumAttr(InaccessibleMemOrArgMemOnly),
480                                   EnumAttr(WillReturn))
481                    : AttributeSet(EnumAttr(NoUnwind)))
482__OMP_ATTRS_SET(SetterAttrs,
483                OptimisticAttributes
484                    ? AttributeSet(EnumAttr(NoUnwind), EnumAttr(WriteOnly),
485                                   EnumAttr(NoSync), EnumAttr(NoFree),
486                                   EnumAttr(InaccessibleMemOnly),
487                                   EnumAttr(WillReturn))
488                    : AttributeSet(EnumAttr(NoUnwind)))
489
490__OMP_ATTRS_SET(DefaultAttrs,
491                OptimisticAttributes
492                    ? AttributeSet(EnumAttr(NoUnwind), EnumAttr(NoSync),
493                                   EnumAttr(WillReturn), EnumAttr(NoFree))
494                    : AttributeSet(EnumAttr(NoUnwind)))
495
496__OMP_ATTRS_SET(BarrierAttrs,
497                OptimisticAttributes
498                    ? AttributeSet(EnumAttr(NoUnwind), EnumAttr(Convergent))
499                    : AttributeSet(EnumAttr(NoUnwind), EnumAttr(Convergent)))
500
501__OMP_ATTRS_SET(InaccessibleArgOnlyAttrs,
502                OptimisticAttributes
503                    ? AttributeSet(EnumAttr(NoUnwind), EnumAttr(NoSync),
504                                   EnumAttr(InaccessibleMemOrArgMemOnly),
505                                   EnumAttr(WillReturn), EnumAttr(NoFree))
506                    : AttributeSet(EnumAttr(NoUnwind)))
507
508__OMP_ATTRS_SET(NoCaptureAttrs,
509                OptimisticAttributes
510                    ? AttributeSet(EnumAttr(NoCapture))
511                    : AttributeSet(EnumAttr(NoCapture)))
512
513#if 0
514__OMP_ATTRS_SET(InaccessibleOnlyAttrs,
515                OptimisticAttributes
516                    ? AttributeSet(EnumAttr(NoUnwind), EnumAttr(NoSync),
517                                   EnumAttr(InaccessibleMemOnly),
518                                   EnumAttr(WillReturn), EnumAttr(NoFree))
519                    : AttributeSet(EnumAttr(NoUnwind)))
520#endif
521
522__OMP_ATTRS_SET(AllocAttrs,
523                OptimisticAttributes
524                    ? AttributeSet(EnumAttr(NoUnwind), EnumAttr(NoSync),
525                                   EnumAttr(WillReturn))
526                    : AttributeSet(EnumAttr(NoUnwind)))
527
528__OMP_ATTRS_SET(ForkAttrs, OptimisticAttributes
529                               ? AttributeSet(EnumAttr(NoUnwind))
530                               : AttributeSet(EnumAttr(NoUnwind)))
531
532__OMP_ATTRS_SET(ReadOnlyPtrAttrs,
533                OptimisticAttributes
534                    ? AttributeSet(EnumAttr(ReadOnly), EnumAttr(NoFree),
535                                   EnumAttr(NoCapture))
536                    : AttributeSet())
537
538#if 0
539__OMP_ATTRS_SET(WriteOnlyPtrAttrs,
540                OptimisticAttributes
541                    ? AttributeSet(EnumAttr(WriteOnly), EnumAttr(NoFree),
542                                   EnumAttr(NoCapture))
543                    : AttributeSet())
544#endif
545
546__OMP_ATTRS_SET(ArgPtrAttrs,
547                OptimisticAttributes
548                    ? AttributeSet(EnumAttr(NoCapture), EnumAttr(NoFree))
549                    : AttributeSet())
550
551__OMP_ATTRS_SET(ReturnPtrAttrs,
552                OptimisticAttributes
553                    ? AttributeSet(EnumAttr(NoAlias))
554                    : AttributeSet())
555
556#if 0
557__OMP_ATTRS_SET(ReturnAlignedPtrAttrs,
558                OptimisticAttributes
559                    ? AttributeSet(EnumAttr(NoAlias), EnumAttrInt(Alignment, 8),
560                                   EnumAttrInt(DereferenceableOrNull, 8))
561                    : AttributeSet())
562#endif
563
564#undef __OMP_ATTRS_SET
565#undef OMP_ATTRS_SET
566
567#ifndef OMP_RTL_ATTRS
568#define OMP_RTL_ATTRS(Enum, FnAttrSet, RetAttrSet, ArgAttrSets)
569#endif
570
571#define __OMP_RTL_ATTRS(Name, FnAttrSet, RetAttrSet, ArgAttrSets)              \
572  OMP_RTL_ATTRS(OMPRTL_##Name, FnAttrSet, RetAttrSet, ArgAttrSets)
573
574__OMP_RTL_ATTRS(__kmpc_barrier, BarrierAttrs, AttributeSet(),
575                ParamAttrs(ReadOnlyPtrAttrs))
576__OMP_RTL_ATTRS(__kmpc_barrier_simple_spmd, BarrierAttrs, AttributeSet(),
577                ParamAttrs(ReadOnlyPtrAttrs))
578__OMP_RTL_ATTRS(__kmpc_warp_active_thread_mask, BarrierAttrs, AttributeSet(),
579                ParamAttrs())
580__OMP_RTL_ATTRS(__kmpc_syncwarp, BarrierAttrs, AttributeSet(), ParamAttrs())
581__OMP_RTL_ATTRS(__kmpc_cancel, InaccessibleArgOnlyAttrs, AttributeSet(),
582                ParamAttrs(ReadOnlyPtrAttrs))
583__OMP_RTL_ATTRS(__kmpc_cancel_barrier, BarrierAttrs, AttributeSet(),
584                ParamAttrs(ReadOnlyPtrAttrs))
585__OMP_RTL_ATTRS(__kmpc_flush, BarrierAttrs, AttributeSet(),
586                ParamAttrs(ReadOnlyPtrAttrs))
587__OMP_RTL_ATTRS(__kmpc_global_thread_num, GetterAttrs, AttributeSet(),
588                ParamAttrs(ReadOnlyPtrAttrs))
589__OMP_RTL_ATTRS(__kmpc_fork_call, ForkAttrs, AttributeSet(),
590                ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), ReadOnlyPtrAttrs))
591__OMP_RTL_ATTRS(__kmpc_omp_taskwait, BarrierAttrs, AttributeSet(),
592                ParamAttrs(ReadOnlyPtrAttrs))
593__OMP_RTL_ATTRS(__kmpc_omp_taskyield, InaccessibleArgOnlyAttrs, AttributeSet(),
594                ParamAttrs(ReadOnlyPtrAttrs))
595__OMP_RTL_ATTRS(__kmpc_push_num_threads, InaccessibleArgOnlyAttrs,
596                AttributeSet(), ParamAttrs(ReadOnlyPtrAttrs))
597__OMP_RTL_ATTRS(__kmpc_push_proc_bind, InaccessibleArgOnlyAttrs, AttributeSet(),
598                ParamAttrs(ReadOnlyPtrAttrs))
599__OMP_RTL_ATTRS(__kmpc_serialized_parallel, InaccessibleArgOnlyAttrs,
600                AttributeSet(), ParamAttrs(ReadOnlyPtrAttrs))
601__OMP_RTL_ATTRS(__kmpc_end_serialized_parallel, InaccessibleArgOnlyAttrs,
602                AttributeSet(), ParamAttrs(ReadOnlyPtrAttrs))
603__OMP_RTL_ATTRS(__kmpc_omp_reg_task_with_affinity, DefaultAttrs, AttributeSet(),
604                ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), ReadOnlyPtrAttrs,
605                           AttributeSet(), ReadOnlyPtrAttrs))
606
607__OMP_RTL_ATTRS(__kmpc_get_hardware_num_blocks, GetterAttrs, AttributeSet(), ParamAttrs())
608__OMP_RTL_ATTRS(__kmpc_get_hardware_num_threads_in_block, GetterAttrs, AttributeSet(), ParamAttrs())
609
610__OMP_RTL_ATTRS(omp_get_thread_num, GetterAttrs, AttributeSet(), ParamAttrs())
611__OMP_RTL_ATTRS(omp_get_num_threads, GetterAttrs, AttributeSet(), ParamAttrs())
612__OMP_RTL_ATTRS(omp_get_max_threads, GetterAttrs, AttributeSet(), ParamAttrs())
613__OMP_RTL_ATTRS(omp_in_parallel, GetterAttrs, AttributeSet(), ParamAttrs())
614__OMP_RTL_ATTRS(omp_get_dynamic, GetterAttrs, AttributeSet(), ParamAttrs())
615__OMP_RTL_ATTRS(omp_get_cancellation, GetterAttrs, AttributeSet(), ParamAttrs())
616__OMP_RTL_ATTRS(omp_get_nested, GetterAttrs, AttributeSet(), ParamAttrs())
617__OMP_RTL_ATTRS(
618    omp_get_schedule, GetterArgWriteAttrs, AttributeSet(),
619    ParamAttrs(AttributeSet(EnumAttr(NoCapture), EnumAttr(WriteOnly)),
620               AttributeSet(EnumAttr(NoCapture), EnumAttr(WriteOnly))))
621__OMP_RTL_ATTRS(omp_get_thread_limit, GetterAttrs, AttributeSet(), ParamAttrs())
622__OMP_RTL_ATTRS(omp_get_supported_active_levels, GetterAttrs, AttributeSet(),
623                ParamAttrs())
624__OMP_RTL_ATTRS(omp_get_max_active_levels, GetterAttrs, AttributeSet(),
625                ParamAttrs())
626__OMP_RTL_ATTRS(omp_get_level, GetterAttrs, AttributeSet(), ParamAttrs())
627__OMP_RTL_ATTRS(omp_get_ancestor_thread_num, GetterAttrs, AttributeSet(),
628                ParamAttrs())
629__OMP_RTL_ATTRS(omp_get_team_size, GetterAttrs, AttributeSet(), ParamAttrs())
630__OMP_RTL_ATTRS(omp_get_active_level, GetterAttrs, AttributeSet(), ParamAttrs())
631__OMP_RTL_ATTRS(omp_in_final, GetterAttrs, AttributeSet(), ParamAttrs())
632__OMP_RTL_ATTRS(omp_get_proc_bind, GetterAttrs, AttributeSet(), ParamAttrs())
633__OMP_RTL_ATTRS(omp_get_num_places, GetterAttrs, AttributeSet(), ParamAttrs())
634__OMP_RTL_ATTRS(omp_get_num_procs, GetterAttrs, AttributeSet(), ParamAttrs())
635__OMP_RTL_ATTRS(omp_get_place_proc_ids, GetterArgWriteAttrs, AttributeSet(),
636                ParamAttrs(AttributeSet(), AttributeSet(EnumAttr(NoCapture),
637                                                        EnumAttr(WriteOnly))))
638__OMP_RTL_ATTRS(omp_get_place_num, GetterAttrs, AttributeSet(), ParamAttrs())
639__OMP_RTL_ATTRS(omp_get_partition_num_places, GetterAttrs, AttributeSet(),
640                ParamAttrs())
641__OMP_RTL_ATTRS(omp_get_partition_place_nums, GetterAttrs, AttributeSet(),
642                ParamAttrs())
643
644__OMP_RTL_ATTRS(omp_set_num_threads, SetterAttrs, AttributeSet(), ParamAttrs())
645__OMP_RTL_ATTRS(omp_set_dynamic, SetterAttrs, AttributeSet(), ParamAttrs())
646__OMP_RTL_ATTRS(omp_set_nested, SetterAttrs, AttributeSet(), ParamAttrs())
647__OMP_RTL_ATTRS(omp_set_schedule, SetterAttrs, AttributeSet(), ParamAttrs())
648__OMP_RTL_ATTRS(omp_set_max_active_levels, SetterAttrs, AttributeSet(),
649                ParamAttrs())
650
651__OMP_RTL_ATTRS(__kmpc_master, InaccessibleArgOnlyAttrs, AttributeSet(),
652                ParamAttrs(ReadOnlyPtrAttrs))
653__OMP_RTL_ATTRS(__kmpc_end_master, InaccessibleArgOnlyAttrs, AttributeSet(),
654                ParamAttrs(ReadOnlyPtrAttrs))
655__OMP_RTL_ATTRS(__kmpc_masked, InaccessibleArgOnlyAttrs, AttributeSet(),
656                ParamAttrs(ReadOnlyPtrAttrs))
657__OMP_RTL_ATTRS(__kmpc_end_masked, InaccessibleArgOnlyAttrs, AttributeSet(),
658                ParamAttrs(ReadOnlyPtrAttrs))
659__OMP_RTL_ATTRS(__kmpc_critical, BarrierAttrs, AttributeSet(),
660                ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), AttributeSet()))
661__OMP_RTL_ATTRS(__kmpc_critical_with_hint, BarrierAttrs, AttributeSet(),
662                ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), AttributeSet(),
663                           AttributeSet()))
664__OMP_RTL_ATTRS(__kmpc_end_critical, BarrierAttrs, AttributeSet(),
665                ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), AttributeSet()))
666
667__OMP_RTL_ATTRS(__kmpc_begin, DefaultAttrs, AttributeSet(),
668                ParamAttrs(ReadOnlyPtrAttrs))
669__OMP_RTL_ATTRS(__kmpc_end, DefaultAttrs, AttributeSet(),
670                ParamAttrs(ReadOnlyPtrAttrs))
671
672__OMP_RTL_ATTRS(__kmpc_reduce, BarrierAttrs, AttributeSet(),
673                ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), AttributeSet(),
674                           AttributeSet(), ReadOnlyPtrAttrs, AttributeSet()))
675__OMP_RTL_ATTRS(__kmpc_reduce_nowait, BarrierAttrs, AttributeSet(),
676                ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), AttributeSet(),
677                           AttributeSet(), ReadOnlyPtrAttrs, AttributeSet()))
678__OMP_RTL_ATTRS(__kmpc_end_reduce, BarrierAttrs, AttributeSet(),
679                ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), AttributeSet()))
680__OMP_RTL_ATTRS(__kmpc_end_reduce_nowait, BarrierAttrs, AttributeSet(),
681                ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), AttributeSet()))
682
683__OMP_RTL_ATTRS(__kmpc_ordered, BarrierAttrs, AttributeSet(),
684                ParamAttrs(ReadOnlyPtrAttrs))
685__OMP_RTL_ATTRS(__kmpc_end_ordered, BarrierAttrs, AttributeSet(),
686                ParamAttrs(ReadOnlyPtrAttrs))
687
688__OMP_RTL_ATTRS(__kmpc_for_static_init_4, GetterArgWriteAttrs, AttributeSet(),
689                ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), AttributeSet(),
690                           ArgPtrAttrs, ArgPtrAttrs, ArgPtrAttrs, ArgPtrAttrs,
691                           AttributeSet(), AttributeSet()))
692__OMP_RTL_ATTRS(__kmpc_for_static_init_4u, GetterArgWriteAttrs, AttributeSet(),
693                ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), AttributeSet(),
694                           ArgPtrAttrs, ArgPtrAttrs, ArgPtrAttrs, ArgPtrAttrs,
695                           AttributeSet(), AttributeSet()))
696__OMP_RTL_ATTRS(__kmpc_for_static_init_8, GetterArgWriteAttrs, AttributeSet(),
697                ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), AttributeSet(),
698                           ArgPtrAttrs, ArgPtrAttrs, ArgPtrAttrs, ArgPtrAttrs,
699                           AttributeSet(), AttributeSet()))
700__OMP_RTL_ATTRS(__kmpc_for_static_init_8u, GetterArgWriteAttrs, AttributeSet(),
701                ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), AttributeSet(),
702                           ArgPtrAttrs, ArgPtrAttrs, ArgPtrAttrs, ArgPtrAttrs,
703                           AttributeSet(), AttributeSet()))
704__OMP_RTL_ATTRS(__kmpc_for_static_fini, InaccessibleArgOnlyAttrs,
705                AttributeSet(), ParamAttrs(ReadOnlyPtrAttrs))
706__OMP_RTL_ATTRS(__kmpc_dist_dispatch_init_4, GetterArgWriteAttrs,
707                AttributeSet(),
708                ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), AttributeSet(),
709                           ArgPtrAttrs))
710__OMP_RTL_ATTRS(__kmpc_dist_dispatch_init_4u, GetterArgWriteAttrs,
711                AttributeSet(),
712                ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), AttributeSet(),
713                           ArgPtrAttrs))
714__OMP_RTL_ATTRS(__kmpc_dist_dispatch_init_8, GetterArgWriteAttrs,
715                AttributeSet(),
716                ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), AttributeSet(),
717                           ArgPtrAttrs))
718__OMP_RTL_ATTRS(__kmpc_dist_dispatch_init_8u, GetterArgWriteAttrs,
719                AttributeSet(),
720                ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), AttributeSet(),
721                           ArgPtrAttrs))
722__OMP_RTL_ATTRS(__kmpc_dispatch_init_4, GetterArgWriteAttrs, AttributeSet(),
723                ParamAttrs(ReadOnlyPtrAttrs))
724__OMP_RTL_ATTRS(__kmpc_dispatch_init_4u, GetterArgWriteAttrs, AttributeSet(),
725                ParamAttrs(ReadOnlyPtrAttrs))
726__OMP_RTL_ATTRS(__kmpc_dispatch_init_8, GetterArgWriteAttrs, AttributeSet(),
727                ParamAttrs(ReadOnlyPtrAttrs))
728__OMP_RTL_ATTRS(__kmpc_dispatch_init_8u, GetterArgWriteAttrs, AttributeSet(),
729                ParamAttrs(ReadOnlyPtrAttrs))
730__OMP_RTL_ATTRS(__kmpc_dispatch_next_4, GetterArgWriteAttrs, AttributeSet(),
731                ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), ArgPtrAttrs,
732                           ArgPtrAttrs, ArgPtrAttrs, ArgPtrAttrs))
733__OMP_RTL_ATTRS(__kmpc_dispatch_next_4u, GetterArgWriteAttrs, AttributeSet(),
734                ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), ArgPtrAttrs,
735                           ArgPtrAttrs, ArgPtrAttrs, ArgPtrAttrs))
736__OMP_RTL_ATTRS(__kmpc_dispatch_next_8, GetterArgWriteAttrs, AttributeSet(),
737                ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), ArgPtrAttrs,
738                           ArgPtrAttrs, ArgPtrAttrs, ArgPtrAttrs))
739__OMP_RTL_ATTRS(__kmpc_dispatch_next_8u, GetterArgWriteAttrs, AttributeSet(),
740                ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), ArgPtrAttrs,
741                           ArgPtrAttrs, ArgPtrAttrs, ArgPtrAttrs))
742__OMP_RTL_ATTRS(__kmpc_dispatch_fini_4, InaccessibleArgOnlyAttrs,
743                AttributeSet(), ParamAttrs(ReadOnlyPtrAttrs))
744__OMP_RTL_ATTRS(__kmpc_dispatch_fini_4u, InaccessibleArgOnlyAttrs,
745                AttributeSet(), ParamAttrs(ReadOnlyPtrAttrs))
746__OMP_RTL_ATTRS(__kmpc_dispatch_fini_8, InaccessibleArgOnlyAttrs,
747                AttributeSet(), ParamAttrs(ReadOnlyPtrAttrs))
748__OMP_RTL_ATTRS(__kmpc_dispatch_fini_8u, InaccessibleArgOnlyAttrs,
749                AttributeSet(), ParamAttrs(ReadOnlyPtrAttrs))
750__OMP_RTL_ATTRS(__kmpc_team_static_init_4, GetterArgWriteAttrs, AttributeSet(),
751                ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), ArgPtrAttrs,
752                           ArgPtrAttrs, ArgPtrAttrs, ArgPtrAttrs))
753__OMP_RTL_ATTRS(__kmpc_team_static_init_4u, GetterArgWriteAttrs, AttributeSet(),
754                ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), ArgPtrAttrs,
755                           ArgPtrAttrs, ArgPtrAttrs, ArgPtrAttrs))
756__OMP_RTL_ATTRS(__kmpc_team_static_init_8, GetterArgWriteAttrs, AttributeSet(),
757                ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), ArgPtrAttrs,
758                           ArgPtrAttrs, ArgPtrAttrs, ArgPtrAttrs))
759__OMP_RTL_ATTRS(__kmpc_team_static_init_8u, GetterArgWriteAttrs, AttributeSet(),
760                ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), ArgPtrAttrs,
761                           ArgPtrAttrs, ArgPtrAttrs, ArgPtrAttrs))
762__OMP_RTL_ATTRS(__kmpc_dist_for_static_init_4, GetterArgWriteAttrs,
763                AttributeSet(),
764                ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), AttributeSet(),
765                           ArgPtrAttrs, ArgPtrAttrs, ArgPtrAttrs, ArgPtrAttrs,
766                           ArgPtrAttrs))
767__OMP_RTL_ATTRS(__kmpc_dist_for_static_init_4u, GetterArgWriteAttrs,
768                AttributeSet(),
769                ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), AttributeSet(),
770                           ArgPtrAttrs, ArgPtrAttrs, ArgPtrAttrs, ArgPtrAttrs,
771                           ArgPtrAttrs))
772__OMP_RTL_ATTRS(__kmpc_dist_for_static_init_8, GetterArgWriteAttrs,
773                AttributeSet(),
774                ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), AttributeSet(),
775                           ArgPtrAttrs, ArgPtrAttrs, ArgPtrAttrs, ArgPtrAttrs,
776                           ArgPtrAttrs))
777__OMP_RTL_ATTRS(__kmpc_dist_for_static_init_8u, GetterArgWriteAttrs,
778                AttributeSet(),
779                ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), AttributeSet(),
780                           ArgPtrAttrs, ArgPtrAttrs, ArgPtrAttrs, ArgPtrAttrs,
781                           ArgPtrAttrs))
782
783__OMP_RTL_ATTRS(__kmpc_single, BarrierAttrs, AttributeSet(),
784                ParamAttrs(ReadOnlyPtrAttrs))
785__OMP_RTL_ATTRS(__kmpc_end_single, BarrierAttrs, AttributeSet(),
786                ParamAttrs(ReadOnlyPtrAttrs))
787
788__OMP_RTL_ATTRS(__kmpc_omp_task_alloc, DefaultAttrs, ReturnPtrAttrs,
789                ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), AttributeSet(),
790                           AttributeSet(), AttributeSet(), ReadOnlyPtrAttrs))
791__OMP_RTL_ATTRS(__kmpc_omp_task, DefaultAttrs, AttributeSet(),
792                ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), AttributeSet()))
793__OMP_RTL_ATTRS(__kmpc_end_taskgroup, BarrierAttrs, AttributeSet(),
794                ParamAttrs(ReadOnlyPtrAttrs))
795__OMP_RTL_ATTRS(__kmpc_taskgroup, BarrierAttrs, AttributeSet(),
796                ParamAttrs(ReadOnlyPtrAttrs))
797__OMP_RTL_ATTRS(__kmpc_omp_task_begin_if0, DefaultAttrs, AttributeSet(),
798                ParamAttrs(ReadOnlyPtrAttrs))
799__OMP_RTL_ATTRS(__kmpc_omp_task_complete_if0, DefaultAttrs, AttributeSet(),
800                ParamAttrs(ReadOnlyPtrAttrs))
801__OMP_RTL_ATTRS(__kmpc_omp_task_with_deps, DefaultAttrs, AttributeSet(),
802                ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), AttributeSet(),
803                           AttributeSet(), ReadOnlyPtrAttrs, AttributeSet(),
804                           ReadOnlyPtrAttrs))
805__OMP_RTL_ATTRS(__kmpc_taskloop, DefaultAttrs, AttributeSet(),
806                ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), AttributeSet(),
807                           AttributeSet(), ArgPtrAttrs, ArgPtrAttrs,
808                           AttributeSet(), AttributeSet(), AttributeSet(),
809                           AttributeSet(), AttributeSet()))
810__OMP_RTL_ATTRS(__kmpc_omp_target_task_alloc, DefaultAttrs, ReturnPtrAttrs,
811                ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), AttributeSet(),
812                           AttributeSet(), AttributeSet(), ReadOnlyPtrAttrs,
813                           AttributeSet()))
814__OMP_RTL_ATTRS(__kmpc_taskred_modifier_init, DefaultAttrs, ReturnPtrAttrs,
815                ParamAttrs(ReadOnlyPtrAttrs))
816__OMP_RTL_ATTRS(__kmpc_taskred_init, DefaultAttrs, AttributeSet(), ParamAttrs())
817__OMP_RTL_ATTRS(__kmpc_task_reduction_modifier_fini, BarrierAttrs,
818                AttributeSet(), ParamAttrs(ReadOnlyPtrAttrs))
819__OMP_RTL_ATTRS(__kmpc_task_reduction_get_th_data, DefaultAttrs, ReturnPtrAttrs,
820                ParamAttrs())
821__OMP_RTL_ATTRS(__kmpc_task_reduction_init, DefaultAttrs, ReturnPtrAttrs,
822                ParamAttrs())
823__OMP_RTL_ATTRS(__kmpc_task_reduction_modifier_init, DefaultAttrs,
824                ReturnPtrAttrs, ParamAttrs())
825__OMP_RTL_ATTRS(__kmpc_proxy_task_completed_ooo, DefaultAttrs, AttributeSet(),
826                ParamAttrs())
827
828__OMP_RTL_ATTRS(__kmpc_omp_wait_deps, BarrierAttrs, AttributeSet(),
829                ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), AttributeSet(),
830                           ReadOnlyPtrAttrs))
831__OMP_RTL_ATTRS(__kmpc_cancellationpoint, DefaultAttrs, AttributeSet(),
832                ParamAttrs(ReadOnlyPtrAttrs))
833
834__OMP_RTL_ATTRS(__kmpc_fork_teams, ForkAttrs, AttributeSet(),
835                ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), ReadOnlyPtrAttrs))
836__OMP_RTL_ATTRS(__kmpc_push_num_teams, InaccessibleArgOnlyAttrs, AttributeSet(),
837                ParamAttrs(ReadOnlyPtrAttrs))
838
839__OMP_RTL_ATTRS(__kmpc_copyprivate, DefaultAttrs, AttributeSet(),
840                ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), AttributeSet(),
841                           ReadOnlyPtrAttrs))
842__OMP_RTL_ATTRS(__kmpc_threadprivate_cached, DefaultAttrs, ReturnPtrAttrs,
843                ParamAttrs(ReadOnlyPtrAttrs))
844__OMP_RTL_ATTRS(__kmpc_threadprivate_register, DefaultAttrs, AttributeSet(),
845                ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), ReadOnlyPtrAttrs,
846                           ReadOnlyPtrAttrs, ReadOnlyPtrAttrs))
847
848__OMP_RTL_ATTRS(__kmpc_doacross_init, BarrierAttrs, AttributeSet(),
849                ParamAttrs(ReadOnlyPtrAttrs))
850__OMP_RTL_ATTRS(__kmpc_doacross_post, BarrierAttrs, AttributeSet(),
851                ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), ReadOnlyPtrAttrs))
852__OMP_RTL_ATTRS(__kmpc_doacross_wait, BarrierAttrs, AttributeSet(),
853                ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), ReadOnlyPtrAttrs))
854__OMP_RTL_ATTRS(__kmpc_doacross_fini, BarrierAttrs, AttributeSet(),
855                ParamAttrs(ReadOnlyPtrAttrs))
856
857__OMP_RTL_ATTRS(__kmpc_alloc_shared, DefaultAttrs, ReturnPtrAttrs,
858                ParamAttrs())
859__OMP_RTL_ATTRS(__kmpc_free_shared, AllocAttrs, AttributeSet(),
860                ParamAttrs(NoCaptureAttrs))
861
862__OMP_RTL_ATTRS(__kmpc_alloc, DefaultAttrs, ReturnPtrAttrs, ParamAttrs())
863__OMP_RTL_ATTRS(__kmpc_free, AllocAttrs, AttributeSet(), ParamAttrs())
864
865__OMP_RTL_ATTRS(__kmpc_init_allocator, DefaultAttrs, ReturnPtrAttrs,
866                ParamAttrs())
867__OMP_RTL_ATTRS(__kmpc_destroy_allocator, AllocAttrs, AttributeSet(),
868                ParamAttrs())
869
870__OMP_RTL_ATTRS(__kmpc_push_target_tripcount_mapper, SetterAttrs,
871                AttributeSet(), ParamAttrs())
872__OMP_RTL_ATTRS(__tgt_target_mapper, ForkAttrs, AttributeSet(), ParamAttrs())
873__OMP_RTL_ATTRS(__tgt_target_nowait_mapper, ForkAttrs, AttributeSet(),
874                ParamAttrs())
875__OMP_RTL_ATTRS(__tgt_target_teams_mapper, ForkAttrs, AttributeSet(),
876                ParamAttrs())
877__OMP_RTL_ATTRS(__tgt_target_teams_nowait_mapper, ForkAttrs, AttributeSet(),
878                ParamAttrs())
879__OMP_RTL_ATTRS(__tgt_register_requires, ForkAttrs, AttributeSet(),
880                ParamAttrs())
881__OMP_RTL_ATTRS(__tgt_target_data_begin_mapper, ForkAttrs, AttributeSet(),
882                ParamAttrs())
883__OMP_RTL_ATTRS(__tgt_target_data_begin_nowait_mapper, ForkAttrs,
884                AttributeSet(), ParamAttrs())
885__OMP_RTL_ATTRS(__tgt_target_data_end_mapper, ForkAttrs, AttributeSet(),
886                ParamAttrs())
887__OMP_RTL_ATTRS(__tgt_target_data_end_nowait_mapper, ForkAttrs,
888                AttributeSet(), ParamAttrs())
889__OMP_RTL_ATTRS(__tgt_target_data_update_mapper, ForkAttrs, AttributeSet(),
890                ParamAttrs())
891__OMP_RTL_ATTRS(__tgt_target_data_update_nowait_mapper, ForkAttrs,
892                AttributeSet(), ParamAttrs())
893__OMP_RTL_ATTRS(__tgt_mapper_num_components, ForkAttrs, AttributeSet(),
894                ParamAttrs())
895__OMP_RTL_ATTRS(__tgt_push_mapper_component, ForkAttrs, AttributeSet(),
896                ParamAttrs())
897__OMP_RTL_ATTRS(__kmpc_task_allow_completion_event, DefaultAttrs,
898                ReturnPtrAttrs, ParamAttrs(ReadOnlyPtrAttrs))
899
900#undef __OMP_RTL_ATTRS
901#undef OMP_RTL_ATTRS
902#undef AttributeSet
903#undef EnumAttr
904#undef EnumAttrInt
905#undef ParamAttrs
906
907///}
908
909/// KMP ident_t bit flags
910///
911/// In accordance with the values in `openmp/runtime/src/kmp.h`.
912///
913///{
914
915#ifndef OMP_IDENT_FLAG
916#define OMP_IDENT_FLAG(Enum, Str, Value)
917#endif
918
919#define __OMP_IDENT_FLAG(Name, Value)                                          \
920  OMP_IDENT_FLAG(OMP_IDENT_FLAG_##Name, #Name, Value)
921
922__OMP_IDENT_FLAG(KMPC, 0x02)
923__OMP_IDENT_FLAG(BARRIER_EXPL, 0x20)
924__OMP_IDENT_FLAG(BARRIER_IMPL, 0x0040)
925__OMP_IDENT_FLAG(BARRIER_IMPL_MASK, 0x01C0)
926__OMP_IDENT_FLAG(BARRIER_IMPL_FOR, 0x0040)
927__OMP_IDENT_FLAG(BARRIER_IMPL_SECTIONS, 0x00C0)
928__OMP_IDENT_FLAG(BARRIER_IMPL_SINGLE, 0x0140)
929__OMP_IDENT_FLAG(BARRIER_IMPL_WORKSHARE, 0x01C0)
930
931#undef __OMP_IDENT_FLAG
932#undef OMP_IDENT_FLAG
933
934///}
935
936/// KMP cancel kind
937///
938///{
939
940#ifndef OMP_CANCEL_KIND
941#define OMP_CANCEL_KIND(Enum, Str, DirectiveEnum, Value)
942#endif
943
944#define __OMP_CANCEL_KIND(Name, Value)                                         \
945  OMP_CANCEL_KIND(OMP_CANCEL_KIND_##Name, #Name, OMPD_##Name, Value)
946
947__OMP_CANCEL_KIND(parallel, 1)
948__OMP_CANCEL_KIND(for, 2)
949__OMP_CANCEL_KIND(sections, 3)
950__OMP_CANCEL_KIND(taskgroup, 4)
951
952#undef __OMP_CANCEL_KIND
953#undef OMP_CANCEL_KIND
954
955///}
956
957/// Default kinds
958///
959///{
960
961#ifndef OMP_DEFAULT_KIND
962#define OMP_DEFAULT_KIND(Enum, Str)
963#endif
964
965#define __OMP_DEFAULT_KIND(Name) OMP_DEFAULT_KIND(OMP_DEFAULT_##Name, #Name)
966
967__OMP_DEFAULT_KIND(none)
968__OMP_DEFAULT_KIND(shared)
969__OMP_DEFAULT_KIND(firstprivate)
970__OMP_DEFAULT_KIND(unknown)
971
972#undef __OMP_DEFAULT_KIND
973#undef OMP_DEFAULT_KIND
974
975///}
976
977/// Proc bind kinds
978///
979///{
980
981#ifndef OMP_PROC_BIND_KIND
982#define OMP_PROC_BIND_KIND(Enum, Str, Value)
983#endif
984
985#define __OMP_PROC_BIND_KIND(Name, Value)                                      \
986  OMP_PROC_BIND_KIND(OMP_PROC_BIND_##Name, #Name, Value)
987
988__OMP_PROC_BIND_KIND(master, 2)
989__OMP_PROC_BIND_KIND(close, 3)
990__OMP_PROC_BIND_KIND(spread, 4)
991__OMP_PROC_BIND_KIND(primary, 5)
992__OMP_PROC_BIND_KIND(default, 6)
993__OMP_PROC_BIND_KIND(unknown, 7)
994
995#undef __OMP_PROC_BIND_KIND
996#undef OMP_PROC_BIND_KIND
997
998///}
999
1000/// OpenMP context related definitions:
1001///  - trait set selector
1002///  - trait selector
1003///  - trait property
1004///
1005///{
1006
1007#ifndef OMP_TRAIT_SET
1008#define OMP_TRAIT_SET(Enum, Str)
1009#endif
1010#ifndef OMP_TRAIT_SELECTOR
1011#define OMP_TRAIT_SELECTOR(Enum, TraitSetEnum, Str, RequiresProperty)
1012#endif
1013#ifndef OMP_TRAIT_PROPERTY
1014#define OMP_TRAIT_PROPERTY(Enum, TraitSetEnum, TraitSelectorEnum, Str)
1015#endif
1016#ifndef OMP_LAST_TRAIT_PROPERTY
1017#define OMP_LAST_TRAIT_PROPERTY(Enum)
1018#endif
1019
1020#define __OMP_TRAIT_SET(Name) OMP_TRAIT_SET(Name, #Name)
1021#define __OMP_TRAIT_SELECTOR(TraitSet, Name, RequiresProperty)                 \
1022  OMP_TRAIT_SELECTOR(TraitSet##_##Name, TraitSet, #Name, RequiresProperty)
1023#define __OMP_TRAIT_SELECTOR_AND_PROPERTY(TraitSet, Name)                      \
1024  OMP_TRAIT_SELECTOR(TraitSet##_##Name, TraitSet, #Name, false)                \
1025  OMP_TRAIT_PROPERTY(TraitSet##_##Name##_##Name, TraitSet, TraitSet##_##Name,  \
1026                     #Name)
1027#define __OMP_TRAIT_PROPERTY(TraitSet, TraitSelector, Name)                    \
1028  OMP_TRAIT_PROPERTY(TraitSet##_##TraitSelector##_##Name, TraitSet,            \
1029                     TraitSet##_##TraitSelector, #Name)
1030
1031// "invalid" must go first.
1032OMP_TRAIT_SET(invalid, "invalid")
1033OMP_TRAIT_SELECTOR(invalid, invalid, "invalid", false)
1034OMP_TRAIT_PROPERTY(invalid, invalid, invalid, "invalid")
1035
1036__OMP_TRAIT_SET(construct)
1037__OMP_TRAIT_SELECTOR_AND_PROPERTY(construct, target)
1038__OMP_TRAIT_SELECTOR_AND_PROPERTY(construct, teams)
1039__OMP_TRAIT_SELECTOR_AND_PROPERTY(construct, parallel)
1040__OMP_TRAIT_SELECTOR_AND_PROPERTY(construct, for)
1041__OMP_TRAIT_SELECTOR_AND_PROPERTY(construct, simd)
1042
1043__OMP_TRAIT_SET(device)
1044
1045__OMP_TRAIT_SELECTOR(device, kind, true)
1046
1047__OMP_TRAIT_PROPERTY(device, kind, host)
1048__OMP_TRAIT_PROPERTY(device, kind, nohost)
1049__OMP_TRAIT_PROPERTY(device, kind, cpu)
1050__OMP_TRAIT_PROPERTY(device, kind, gpu)
1051__OMP_TRAIT_PROPERTY(device, kind, fpga)
1052__OMP_TRAIT_PROPERTY(device, kind, any)
1053
1054__OMP_TRAIT_SELECTOR(device, arch, true)
1055
1056__OMP_TRAIT_PROPERTY(device, arch, arm)
1057__OMP_TRAIT_PROPERTY(device, arch, armeb)
1058__OMP_TRAIT_PROPERTY(device, arch, aarch64)
1059__OMP_TRAIT_PROPERTY(device, arch, aarch64_be)
1060__OMP_TRAIT_PROPERTY(device, arch, aarch64_32)
1061__OMP_TRAIT_PROPERTY(device, arch, ppc)
1062__OMP_TRAIT_PROPERTY(device, arch, ppcle)
1063__OMP_TRAIT_PROPERTY(device, arch, ppc64)
1064__OMP_TRAIT_PROPERTY(device, arch, ppc64le)
1065__OMP_TRAIT_PROPERTY(device, arch, x86)
1066__OMP_TRAIT_PROPERTY(device, arch, x86_64)
1067__OMP_TRAIT_PROPERTY(device, arch, amdgcn)
1068__OMP_TRAIT_PROPERTY(device, arch, nvptx)
1069__OMP_TRAIT_PROPERTY(device, arch, nvptx64)
1070
1071__OMP_TRAIT_SET(implementation)
1072
1073__OMP_TRAIT_SELECTOR(implementation, vendor, true)
1074
1075__OMP_TRAIT_PROPERTY(implementation, vendor, amd)
1076__OMP_TRAIT_PROPERTY(implementation, vendor, arm)
1077__OMP_TRAIT_PROPERTY(implementation, vendor, bsc)
1078__OMP_TRAIT_PROPERTY(implementation, vendor, cray)
1079__OMP_TRAIT_PROPERTY(implementation, vendor, fujitsu)
1080__OMP_TRAIT_PROPERTY(implementation, vendor, gnu)
1081__OMP_TRAIT_PROPERTY(implementation, vendor, ibm)
1082__OMP_TRAIT_PROPERTY(implementation, vendor, intel)
1083__OMP_TRAIT_PROPERTY(implementation, vendor, llvm)
1084__OMP_TRAIT_PROPERTY(implementation, vendor, pgi)
1085__OMP_TRAIT_PROPERTY(implementation, vendor, ti)
1086__OMP_TRAIT_PROPERTY(implementation, vendor, unknown)
1087
1088__OMP_TRAIT_SELECTOR(implementation, extension, true)
1089__OMP_TRAIT_PROPERTY(implementation, extension, match_all)
1090__OMP_TRAIT_PROPERTY(implementation, extension, match_any)
1091__OMP_TRAIT_PROPERTY(implementation, extension, match_none)
1092__OMP_TRAIT_PROPERTY(implementation, extension, disable_implicit_base)
1093__OMP_TRAIT_PROPERTY(implementation, extension, allow_templates)
1094
1095__OMP_TRAIT_SET(user)
1096
1097__OMP_TRAIT_SELECTOR(user, condition, true)
1098
1099__OMP_TRAIT_PROPERTY(user, condition, true)
1100__OMP_TRAIT_PROPERTY(user, condition, false)
1101__OMP_TRAIT_PROPERTY(user, condition, unknown)
1102
1103__OMP_TRAIT_SELECTOR_AND_PROPERTY(construct, dispatch)
1104
1105// Note that we put isa last so that the other conditions are checked first.
1106// This allows us to issue warnings wrt. isa only if we match otherwise.
1107__OMP_TRAIT_SELECTOR(device, isa, true)
1108
1109// We use "__ANY" as a placeholder in the isa property to denote the
1110// conceptual "any", not the literal `any` used in kind. The string we
1111// we use is not important except that it will show up in diagnostics.
1112OMP_TRAIT_PROPERTY(device_isa___ANY, device, device_isa,
1113                   "<any, entirely target dependent>")
1114
1115
1116#undef OMP_TRAIT_SET
1117#undef __OMP_TRAIT_SET
1118///}
1119
1120/// Traits for the requires directive
1121///
1122/// These will (potentially) become trait selectors for the OpenMP context if
1123/// the OMP_REQUIRES_TRAIT macro is not defined.
1124///
1125///{
1126
1127#ifdef OMP_REQUIRES_TRAIT
1128#define __OMP_REQUIRES_TRAIT(Name)                                             \
1129  OMP_REQUIRES_TRAIT(OMP_REQUIRES_TRAIT_##Name, #Name)
1130#else
1131#define __OMP_REQUIRES_TRAIT(Name)                                             \
1132  __OMP_TRAIT_SELECTOR_AND_PROPERTY(implementation, Name)
1133#endif
1134
1135__OMP_REQUIRES_TRAIT(unified_address)
1136__OMP_REQUIRES_TRAIT(unified_shared_memory)
1137__OMP_REQUIRES_TRAIT(reverse_offload)
1138__OMP_REQUIRES_TRAIT(dynamic_allocators)
1139__OMP_REQUIRES_TRAIT(atomic_default_mem_order)
1140
1141OMP_LAST_TRAIT_PROPERTY(
1142    implementation_atomic_default_mem_order_atomic_default_mem_order)
1143
1144#undef __OMP_TRAIT_SELECTOR_AND_PROPERTY
1145#undef OMP_TRAIT_SELECTOR
1146#undef __OMP_TRAIT_SELECTOR
1147#undef OMP_TRAIT_PROPERTY
1148#undef OMP_LAST_TRAIT_PROPERTY
1149#undef __OMP_TRAIT_PROPERTY
1150#undef __OMP_REQUIRES_TRAIT
1151#undef OMP_REQUIRES_TRAIT
1152///}
1153
1154
1155/// Assumption clauses
1156///
1157///{
1158
1159#ifdef OMP_ASSUME_CLAUSE
1160#define __OMP_ASSUME_CLAUSE(Identifier, StartsWith, HasDirectiveList, HasExpression) \
1161OMP_ASSUME_CLAUSE(Identifier, StartsWith, HasDirectiveList, HasExpression)
1162#else
1163#define __OMP_ASSUME_CLAUSE(...)
1164#endif
1165
1166__OMP_ASSUME_CLAUSE(llvm::StringLiteral("ext_"), true, false, false)
1167__OMP_ASSUME_CLAUSE(llvm::StringLiteral("absent"), false, true, false)
1168__OMP_ASSUME_CLAUSE(llvm::StringLiteral("contains"), false, true, false)
1169__OMP_ASSUME_CLAUSE(llvm::StringLiteral("holds"), false, false, true)
1170__OMP_ASSUME_CLAUSE(llvm::StringLiteral("no_openmp"), false, false, false)
1171__OMP_ASSUME_CLAUSE(llvm::StringLiteral("no_openmp_routines"), false, false, false)
1172__OMP_ASSUME_CLAUSE(llvm::StringLiteral("no_parallelism"), false, false, false)
1173
1174#undef __OMP_ASSUME_CLAUSE
1175#undef OMP_ASSUME_CLAUSE
1176///}
1177