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_fork_call, true, Void, IdentPtr, Int32, ParallelTaskPtr)
199__OMP_RTL(__kmpc_omp_taskwait, false, Int32, IdentPtr, Int32)
200__OMP_RTL(__kmpc_omp_taskyield, false, Int32, IdentPtr, Int32, /* Int */ Int32)
201__OMP_RTL(__kmpc_push_num_threads, false, Void, IdentPtr, Int32,
202 /* Int */ Int32)
203__OMP_RTL(__kmpc_push_proc_bind, false, Void, IdentPtr, Int32, /* Int */ Int32)
204__OMP_RTL(__kmpc_omp_reg_task_with_affinity, false, Int32, IdentPtr, Int32,
205 /* kmp_task_t */ VoidPtr, Int32,
206 /* kmp_task_affinity_info_t */ VoidPtr)
207
208__OMP_RTL(omp_get_thread_num, false, Int32, )
209__OMP_RTL(omp_get_num_threads, false, Int32, )
210__OMP_RTL(omp_get_max_threads, false, Int32, )
211__OMP_RTL(omp_in_parallel, false, Int32, )
212__OMP_RTL(omp_get_dynamic, false, Int32, )
213__OMP_RTL(omp_get_cancellation, false, Int32, )
214__OMP_RTL(omp_get_nested, false, Int32, )
215__OMP_RTL(omp_get_schedule, false, Void, Int32Ptr, Int32Ptr)
216__OMP_RTL(omp_get_thread_limit, false, Int32, )
217__OMP_RTL(omp_get_supported_active_levels, false, Int32, )
218__OMP_RTL(omp_get_max_active_levels, false, Int32, )
219__OMP_RTL(omp_get_level, false, Int32, )
220__OMP_RTL(omp_get_ancestor_thread_num, false, Int32, Int32)
221__OMP_RTL(omp_get_team_size, false, Int32, Int32)
222__OMP_RTL(omp_get_active_level, false, Int32, )
223__OMP_RTL(omp_in_final, false, Int32, )
224__OMP_RTL(omp_get_proc_bind, false, Int32, )
225__OMP_RTL(omp_get_num_places, false, Int32, )
226__OMP_RTL(omp_get_num_procs, false, Int32, )
227__OMP_RTL(omp_get_place_proc_ids, false, Void, Int32, Int32Ptr)
228__OMP_RTL(omp_get_place_num, false, Int32, )
229__OMP_RTL(omp_get_partition_num_places, false, Int32, )
230__OMP_RTL(omp_get_partition_place_nums, false, Void, Int32Ptr)
231
232__OMP_RTL(omp_set_num_threads, false, Void, Int32)
233__OMP_RTL(omp_set_dynamic, false, Void, Int32)
234__OMP_RTL(omp_set_nested, false, Void, Int32)
235__OMP_RTL(omp_set_schedule, false, Void, Int32, Int32)
236__OMP_RTL(omp_set_max_active_levels, false, Void, Int32)
237
238__OMP_RTL(__kmpc_master, false, Int32, IdentPtr, Int32)
239__OMP_RTL(__kmpc_end_master, false, Void, IdentPtr, Int32)
240__OMP_RTL(__kmpc_masked, false, Int32, IdentPtr, Int32, Int32)
241__OMP_RTL(__kmpc_end_masked, false, Void, IdentPtr, Int32)
242__OMP_RTL(__kmpc_critical, false, Void, IdentPtr, Int32, KmpCriticalNamePtrTy)
243__OMP_RTL(__kmpc_critical_with_hint, false, Void, IdentPtr, Int32,
244 KmpCriticalNamePtrTy, Int32)
245__OMP_RTL(__kmpc_end_critical, false, Void, IdentPtr, Int32,
246 KmpCriticalNamePtrTy)
247
248__OMP_RTL(__kmpc_begin, false, Void, IdentPtr, Int32)
249__OMP_RTL(__kmpc_end, false, Void, IdentPtr)
250
251__OMP_RTL(__kmpc_reduce, false, Int32, IdentPtr, Int32, Int32, SizeTy, VoidPtr,
252 ReduceFunctionPtr, KmpCriticalNamePtrTy)
253__OMP_RTL(__kmpc_reduce_nowait, false, Int32, IdentPtr, Int32, Int32, SizeTy,
254 VoidPtr, ReduceFunctionPtr, KmpCriticalNamePtrTy)
255__OMP_RTL(__kmpc_end_reduce, false, Void, IdentPtr, Int32, KmpCriticalNamePtrTy)
256__OMP_RTL(__kmpc_end_reduce_nowait, false, Void, IdentPtr, Int32,
257 KmpCriticalNamePtrTy)
258
259__OMP_RTL(__kmpc_ordered, false, Void, IdentPtr, Int32)
260__OMP_RTL(__kmpc_end_ordered, false, Void, IdentPtr, Int32)
261
262__OMP_RTL(__kmpc_for_static_init_4, false, Void, IdentPtr, Int32, Int32,
263 Int32Ptr, Int32Ptr, Int32Ptr, Int32Ptr, Int32, Int32)
264__OMP_RTL(__kmpc_for_static_init_4u, false, Void, IdentPtr, Int32, Int32,
265 Int32Ptr, Int32Ptr, Int32Ptr, Int32Ptr, Int32, Int32)
266__OMP_RTL(__kmpc_for_static_init_8, false, Void, IdentPtr, Int32, Int32,
267 Int32Ptr, Int64Ptr, Int64Ptr, Int64Ptr, Int64, Int64)
268__OMP_RTL(__kmpc_for_static_init_8u, false, Void, IdentPtr, Int32, Int32,
269 Int32Ptr, Int64Ptr, Int64Ptr, Int64Ptr, Int64, Int64)
270__OMP_RTL(__kmpc_for_static_fini, false, Void, IdentPtr, Int32)
271__OMP_RTL(__kmpc_dist_dispatch_init_4, false, Void, IdentPtr, Int32, Int32,
272 Int32Ptr, Int32, Int32, Int32, Int32)
273__OMP_RTL(__kmpc_dist_dispatch_init_4u, false, Void, IdentPtr, Int32, Int32,
274 Int32Ptr, Int32, Int32, Int32, Int32)
275__OMP_RTL(__kmpc_dist_dispatch_init_8, false, Void, IdentPtr, Int32, Int32,
276 Int32Ptr, Int64, Int64, Int64, Int64)
277__OMP_RTL(__kmpc_dist_dispatch_init_8u, false, Void, IdentPtr, Int32, Int32,
278 Int32Ptr, Int64, Int64, Int64, Int64)
279__OMP_RTL(__kmpc_dispatch_init_4, false, Void, IdentPtr, Int32, Int32, Int32,
280 Int32, Int32, Int32)
281__OMP_RTL(__kmpc_dispatch_init_4u, false, Void, IdentPtr, Int32, Int32, Int32,
282 Int32, Int32, Int32)
283__OMP_RTL(__kmpc_dispatch_init_8, false, Void, IdentPtr, Int32, Int32, Int64,
284 Int64, Int64, Int64)
285__OMP_RTL(__kmpc_dispatch_init_8u, false, Void, IdentPtr, Int32, Int32, Int64,
286 Int64, Int64, Int64)
287__OMP_RTL(__kmpc_dispatch_next_4, false, Int32, IdentPtr, Int32, Int32Ptr,
288 Int32Ptr, Int32Ptr, Int32Ptr)
289__OMP_RTL(__kmpc_dispatch_next_4u, false, Int32, IdentPtr, Int32, Int32Ptr,
290 Int32Ptr, Int32Ptr, Int32Ptr)
291__OMP_RTL(__kmpc_dispatch_next_8, false, Int32, IdentPtr, Int32, Int32Ptr,
292 Int64Ptr, Int64Ptr, Int64Ptr)
293__OMP_RTL(__kmpc_dispatch_next_8u, false, Int32, IdentPtr, Int32, Int32Ptr,
294 Int64Ptr, Int64Ptr, Int64Ptr)
295__OMP_RTL(__kmpc_dispatch_fini_4, false, Void, IdentPtr, Int32)
296__OMP_RTL(__kmpc_dispatch_fini_4u, false, Void, IdentPtr, Int32)
297__OMP_RTL(__kmpc_dispatch_fini_8, false, Void, IdentPtr, Int32)
298__OMP_RTL(__kmpc_dispatch_fini_8u, false, Void, IdentPtr, Int32)
299__OMP_RTL(__kmpc_team_static_init_4, false, Void, IdentPtr, Int32, Int32Ptr,
300 Int32Ptr, Int32Ptr, Int32Ptr, Int32, Int32)
301__OMP_RTL(__kmpc_team_static_init_4u, false, Void, IdentPtr, Int32, Int32Ptr,
302 Int32Ptr, Int32Ptr, Int32Ptr, Int32, Int32)
303__OMP_RTL(__kmpc_team_static_init_8, false, Void, IdentPtr, Int32, Int32Ptr,
304 Int64Ptr, Int64Ptr, Int64Ptr, Int64, Int64)
305__OMP_RTL(__kmpc_team_static_init_8u, false, Void, IdentPtr, Int32, Int32Ptr,
306 Int64Ptr, Int64Ptr, Int64Ptr, Int64, Int64)
307__OMP_RTL(__kmpc_dist_for_static_init_4, false, Void, IdentPtr, Int32, Int32,
308 Int32Ptr, Int32Ptr, Int32Ptr, Int32Ptr, Int32Ptr, Int32, Int32)
309__OMP_RTL(__kmpc_dist_for_static_init_4u, false, Void, IdentPtr, Int32, Int32,
310 Int32Ptr, Int32Ptr, Int32Ptr, Int32Ptr, Int32Ptr, Int32, Int32)
311__OMP_RTL(__kmpc_dist_for_static_init_8, false, Void, IdentPtr, Int32, Int32,
312 Int32Ptr, Int64Ptr, Int64Ptr, Int64Ptr, Int64Ptr, Int64, Int64)
313__OMP_RTL(__kmpc_dist_for_static_init_8u, false, Void, IdentPtr, Int32, Int32,
314 Int32Ptr, Int64Ptr, Int64Ptr, Int64Ptr, Int64Ptr, Int64, Int64)
315
316__OMP_RTL(__kmpc_single, false, Int32, IdentPtr, Int32)
317__OMP_RTL(__kmpc_end_single, false, Void, IdentPtr, Int32)
318
319__OMP_RTL(__kmpc_omp_task_alloc, false, /* kmp_task_t */ VoidPtr, IdentPtr,
320 Int32, Int32, SizeTy, SizeTy, TaskRoutineEntryPtr)
321__OMP_RTL(__kmpc_omp_task, false, Int32, IdentPtr, Int32,
322 /* kmp_task_t */ VoidPtr)
323__OMP_RTL(__kmpc_end_taskgroup, false, Void, IdentPtr, Int32)
324__OMP_RTL(__kmpc_taskgroup, false, Void, IdentPtr, Int32)
325__OMP_RTL(__kmpc_omp_task_begin_if0, false, Void, IdentPtr, Int32,
326 /* kmp_task_t */ VoidPtr)
327__OMP_RTL(__kmpc_omp_task_complete_if0, false, Void, IdentPtr, Int32,
328 /* kmp_tasK_t */ VoidPtr)
329__OMP_RTL(__kmpc_omp_task_with_deps, false, Int32, IdentPtr, Int32,
330 /* kmp_task_t */ VoidPtr, Int32,
331 /* kmp_depend_info_t */ VoidPtr, Int32,
332 /* kmp_depend_info_t */ VoidPtr)
333__OMP_RTL(__kmpc_taskloop, false, Void, IdentPtr, /* Int */ Int32, VoidPtr,
334 /* Int */ Int32, Int64Ptr, Int64Ptr, Int64, /* Int */ Int32,
335 /* Int */ Int32, Int64, VoidPtr)
336__OMP_RTL(__kmpc_omp_target_task_alloc, false, /* kmp_task_t */ VoidPtr,
337 IdentPtr, Int32, Int32, SizeTy, SizeTy, TaskRoutineEntryPtr, Int64)
338__OMP_RTL(__kmpc_taskred_modifier_init, false, /* kmp_taskgroup */ VoidPtr,
339 IdentPtr, /* Int */ Int32, /* Int */ Int32, /* Int */ Int32, VoidPtr)
340__OMP_RTL(__kmpc_taskred_init, false, /* kmp_taskgroup */ VoidPtr,
341 /* Int */ Int32, /* Int */ Int32, VoidPtr)
342__OMP_RTL(__kmpc_task_reduction_modifier_fini, false, Void, IdentPtr,
343 /* Int */ Int32, /* Int */ Int32)
344__OMP_RTL(__kmpc_task_reduction_get_th_data, false, VoidPtr, Int32, VoidPtr,
345 VoidPtr)
346__OMP_RTL(__kmpc_task_reduction_init, false, VoidPtr, Int32, Int32, VoidPtr)
347__OMP_RTL(__kmpc_task_reduction_modifier_init, false, VoidPtr, VoidPtr, Int32,
348 Int32, Int32, VoidPtr)
349__OMP_RTL(__kmpc_proxy_task_completed_ooo, false, Void, VoidPtr)
350
351__OMP_RTL(__kmpc_omp_wait_deps, false, Void, IdentPtr, Int32, Int32,
352 /* kmp_depend_info_t */ VoidPtr, Int32, VoidPtr)
353__OMP_RTL(__kmpc_cancellationpoint, false, Int32, IdentPtr, Int32, Int32)
354
355__OMP_RTL(__kmpc_fork_teams, true, Void, IdentPtr, Int32, ParallelTaskPtr)
356__OMP_RTL(__kmpc_push_num_teams, false, Void, IdentPtr, Int32, Int32, Int32)
357
358__OMP_RTL(__kmpc_copyprivate, false, Void, IdentPtr, Int32, SizeTy, VoidPtr,
359 CopyFunctionPtr, Int32)
360__OMP_RTL(__kmpc_threadprivate_cached, false, VoidPtr, IdentPtr, Int32, VoidPtr,
361 SizeTy, VoidPtrPtrPtr)
362__OMP_RTL(__kmpc_threadprivate_register, false, Void, IdentPtr, VoidPtr,
363 KmpcCtorPtr, KmpcCopyCtorPtr, KmpcDtorPtr)
364
365__OMP_RTL(__kmpc_doacross_init, false, Void, IdentPtr, Int32, Int32,
366 /* kmp_dim */ VoidPtr)
367__OMP_RTL(__kmpc_doacross_post, false, Void, IdentPtr, Int32, Int64Ptr)
368__OMP_RTL(__kmpc_doacross_wait, false, Void, IdentPtr, Int32, Int64Ptr)
369__OMP_RTL(__kmpc_doacross_fini, false, Void, IdentPtr, Int32)
370
371__OMP_RTL(__kmpc_alloc, false, VoidPtr, /* Int */ Int32, SizeTy, VoidPtr)
372__OMP_RTL(__kmpc_free, false, Void, /* Int */ Int32, VoidPtr, VoidPtr)
373
374__OMP_RTL(__kmpc_init_allocator, false, /* omp_allocator_handle_t */ VoidPtr,
375 /* Int */ Int32, /* omp_memespace_handle_t */ VoidPtr,
376 /* Int */ Int32, /* omp_alloctrait_t */ VoidPtr)
377__OMP_RTL(__kmpc_destroy_allocator, false, Void, /* Int */ Int32,
378 /* omp_allocator_handle_t */ VoidPtr)
379
380__OMP_RTL(__kmpc_push_target_tripcount_mapper, false, Void, IdentPtr, Int64, Int64)
381__OMP_RTL(__tgt_target_mapper, false, Int32, IdentPtr, Int64, VoidPtr, Int32, VoidPtrPtr,
382 VoidPtrPtr, Int64Ptr, Int64Ptr, VoidPtrPtr, VoidPtrPtr)
383__OMP_RTL(__tgt_target_nowait_mapper, false, Int32, IdentPtr, Int64, VoidPtr, Int32,
384 VoidPtrPtr, VoidPtrPtr, Int64Ptr, Int64Ptr, VoidPtrPtr, VoidPtrPtr)
385__OMP_RTL(__tgt_target_teams_mapper, false, Int32, IdentPtr, Int64, VoidPtr, Int32,
386 VoidPtrPtr, VoidPtrPtr, Int64Ptr, Int64Ptr, VoidPtrPtr, VoidPtrPtr, Int32, Int32)
387__OMP_RTL(__tgt_target_teams_nowait_mapper, false, Int32, IdentPtr, Int64, VoidPtr, Int32,
388 VoidPtrPtr, VoidPtrPtr, Int64Ptr, Int64Ptr, VoidPtrPtr, VoidPtrPtr, Int32, Int32)
389__OMP_RTL(__tgt_register_requires, false, Void, Int64)
390__OMP_RTL(__tgt_target_data_begin_mapper, false, Void, IdentPtr, Int64, Int32, VoidPtrPtr,
391 VoidPtrPtr, Int64Ptr, Int64Ptr, VoidPtrPtr, VoidPtrPtr)
392__OMP_RTL(__tgt_target_data_begin_nowait_mapper, false, Void, IdentPtr, Int64, Int32,
393 VoidPtrPtr, VoidPtrPtr, Int64Ptr, Int64Ptr, VoidPtrPtr, VoidPtrPtr)
394__OMP_RTL(__tgt_target_data_begin_mapper_issue, false, Void, IdentPtr, Int64, Int32,
395 VoidPtrPtr, VoidPtrPtr, Int64Ptr, Int64Ptr, VoidPtrPtr, VoidPtrPtr, AsyncInfoPtr)
396__OMP_RTL(__tgt_target_data_begin_mapper_wait, false, Void, Int64, AsyncInfoPtr)
397__OMP_RTL(__tgt_target_data_end_mapper, false, Void, IdentPtr, Int64, Int32, VoidPtrPtr,
398 VoidPtrPtr, Int64Ptr, Int64Ptr, VoidPtrPtr, VoidPtrPtr)
399__OMP_RTL(__tgt_target_data_end_nowait_mapper, false, Void, IdentPtr, Int64, Int32,
400 VoidPtrPtr, VoidPtrPtr, Int64Ptr, Int64Ptr, VoidPtrPtr, VoidPtrPtr)
401__OMP_RTL(__tgt_target_data_update_mapper, false, Void, IdentPtr, Int64, Int32,
402 VoidPtrPtr, VoidPtrPtr, Int64Ptr, Int64Ptr, VoidPtrPtr, VoidPtrPtr)
403__OMP_RTL(__tgt_target_data_update_nowait_mapper, false, Void, IdentPtr, Int64, Int32,
404 VoidPtrPtr, VoidPtrPtr, Int64Ptr, Int64Ptr, VoidPtrPtr, VoidPtrPtr)
405__OMP_RTL(__tgt_mapper_num_components, false, Int64, VoidPtr)
406__OMP_RTL(__tgt_push_mapper_component, false, Void, VoidPtr, VoidPtr, VoidPtr,
407 Int64, Int64, VoidPtr)
408__OMP_RTL(__kmpc_task_allow_completion_event, false, VoidPtr, IdentPtr,
409 /* Int */ Int32, /* kmp_task_t */ VoidPtr)
410
411/// OpenMP Device runtime functions
412__OMP_RTL(__kmpc_kernel_init, false, Void, Int32, Int16)
413__OMP_RTL(__kmpc_kernel_deinit, false, Void, Int16)
414__OMP_RTL(__kmpc_spmd_kernel_init, false, Void, Int32, Int16)
415__OMP_RTL(__kmpc_spmd_kernel_deinit_v2, false, Void, Int16)
416__OMP_RTL(__kmpc_kernel_prepare_parallel, false, Void, VoidPtr)
417__OMP_RTL(__kmpc_parallel_51, false, Void, IdentPtr, Int32, Int32, Int32, Int32,
418 VoidPtr, VoidPtr, VoidPtrPtr, SizeTy)
419__OMP_RTL(__kmpc_kernel_parallel, false, Int1, VoidPtrPtr)
420__OMP_RTL(__kmpc_kernel_end_parallel, false, Void, )
421__OMP_RTL(__kmpc_serialized_parallel, false, Void, IdentPtr, Int32)
422__OMP_RTL(__kmpc_end_serialized_parallel, false, Void, IdentPtr, Int32)
423__OMP_RTL(__kmpc_shuffle_int32, false, Int32, Int32, Int16, Int16)
424__OMP_RTL(__kmpc_nvptx_parallel_reduce_nowait_v2, false, Int32, IdentPtr, Int32,
425 Int32, SizeTy, VoidPtr, ShuffleReducePtr, InterWarpCopyPtr)
426__OMP_RTL(__kmpc_nvptx_end_reduce_nowait, false, Void, Int32)
427__OMP_RTL(__kmpc_nvptx_teams_reduce_nowait_v2, false, Int32, IdentPtr, Int32,
428 VoidPtr, Int32, VoidPtr, ShuffleReducePtr, InterWarpCopyPtr,
429 GlobalListPtr, GlobalListPtr, GlobalListPtr, GlobalListPtr)
430
431__OMP_RTL(__kmpc_shuffle_int64, false, Int64, Int64, Int16, Int16)
432__OMP_RTL(__kmpc_data_sharing_init_stack, false, Void, )
433__OMP_RTL(__kmpc_data_sharing_init_stack_spmd, false, Void, )
434
435__OMP_RTL(__kmpc_data_sharing_coalesced_push_stack, false, VoidPtr, SizeTy, Int16)
436__OMP_RTL(__kmpc_data_sharing_push_stack, false, VoidPtr, SizeTy, Int16)
437__OMP_RTL(__kmpc_data_sharing_pop_stack, false, Void, VoidPtr)
438__OMP_RTL(__kmpc_begin_sharing_variables, false, Void, VoidPtrPtrPtr, SizeTy)
439__OMP_RTL(__kmpc_end_sharing_variables, false, Void, )
440__OMP_RTL(__kmpc_get_shared_variables, false, Void, VoidPtrPtrPtr)
441__OMP_RTL(__kmpc_parallel_level, false, Int16, IdentPtr, Int32)
442__OMP_RTL(__kmpc_is_spmd_exec_mode, false, Int8, )
443__OMP_RTL(__kmpc_get_team_static_memory, false, Void, Int16, VoidPtr, SizeTy,
444 Int16, VoidPtrPtr)
445__OMP_RTL(__kmpc_restore_team_static_memory, false, Void, Int16, Int16)
446__OMP_RTL(__kmpc_barrier_simple_spmd, false, Void, IdentPtr, Int32)
447
448__OMP_RTL(__kmpc_warp_active_thread_mask, false, LanemaskTy,)
449__OMP_RTL(__kmpc_syncwarp, false, Void, LanemaskTy)
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#if 0
509__OMP_ATTRS_SET(InaccessibleOnlyAttrs,
510 OptimisticAttributes
511 ? AttributeSet(EnumAttr(NoUnwind), EnumAttr(NoSync),
512 EnumAttr(InaccessibleMemOnly),
513 EnumAttr(WillReturn), EnumAttr(NoFree))
514 : AttributeSet(EnumAttr(NoUnwind)))
515#endif
516
517__OMP_ATTRS_SET(AllocAttrs,
518 OptimisticAttributes
519 ? AttributeSet(EnumAttr(NoUnwind), EnumAttr(NoSync),
520 EnumAttr(WillReturn))
521 : AttributeSet(EnumAttr(NoUnwind)))
522
523__OMP_ATTRS_SET(ForkAttrs, OptimisticAttributes
524 ? AttributeSet(EnumAttr(NoUnwind))
525 : AttributeSet(EnumAttr(NoUnwind)))
526
527__OMP_ATTRS_SET(ReadOnlyPtrAttrs,
528 OptimisticAttributes
529 ? AttributeSet(EnumAttr(ReadOnly), EnumAttr(NoFree),
530 EnumAttr(NoCapture))
531 : AttributeSet())
532
533#if 0
534__OMP_ATTRS_SET(WriteOnlyPtrAttrs,
535 OptimisticAttributes
536 ? AttributeSet(EnumAttr(WriteOnly), EnumAttr(NoFree),
537 EnumAttr(NoCapture))
538 : AttributeSet())
539#endif
540
541__OMP_ATTRS_SET(ArgPtrAttrs,
542 OptimisticAttributes
543 ? AttributeSet(EnumAttr(NoCapture), EnumAttr(NoFree))
544 : AttributeSet())
545
546__OMP_ATTRS_SET(ReturnPtrAttrs,
547 OptimisticAttributes
548 ? AttributeSet(EnumAttr(NoAlias))
549 : AttributeSet())
550
551#if 0
552__OMP_ATTRS_SET(ReturnAlignedPtrAttrs,
553 OptimisticAttributes
554 ? AttributeSet(EnumAttr(NoAlias), EnumAttrInt(Alignment, 8),
555 EnumAttrInt(DereferenceableOrNull, 8))
556 : AttributeSet())
557#endif
558
559#undef __OMP_ATTRS_SET
560#undef OMP_ATTRS_SET
561
562#ifndef OMP_RTL_ATTRS
563#define OMP_RTL_ATTRS(Enum, FnAttrSet, RetAttrSet, ArgAttrSets)
564#endif
565
566#define __OMP_RTL_ATTRS(Name, FnAttrSet, RetAttrSet, ArgAttrSets) \
567 OMP_RTL_ATTRS(OMPRTL_##Name, FnAttrSet, RetAttrSet, ArgAttrSets)
568
569__OMP_RTL_ATTRS(__kmpc_barrier, BarrierAttrs, AttributeSet(),
570 ParamAttrs(ReadOnlyPtrAttrs))
571__OMP_RTL_ATTRS(__kmpc_barrier_simple_spmd, BarrierAttrs, AttributeSet(),
572 ParamAttrs(ReadOnlyPtrAttrs))
573__OMP_RTL_ATTRS(__kmpc_warp_active_thread_mask, BarrierAttrs, AttributeSet(),
574 ParamAttrs())
575__OMP_RTL_ATTRS(__kmpc_syncwarp, BarrierAttrs, AttributeSet(), ParamAttrs())
576__OMP_RTL_ATTRS(__kmpc_cancel, InaccessibleArgOnlyAttrs, AttributeSet(),
577 ParamAttrs(ReadOnlyPtrAttrs))
578__OMP_RTL_ATTRS(__kmpc_cancel_barrier, BarrierAttrs, AttributeSet(),
579 ParamAttrs(ReadOnlyPtrAttrs))
580__OMP_RTL_ATTRS(__kmpc_flush, BarrierAttrs, AttributeSet(),
581 ParamAttrs(ReadOnlyPtrAttrs))
582__OMP_RTL_ATTRS(__kmpc_global_thread_num, GetterAttrs, AttributeSet(),
583 ParamAttrs(ReadOnlyPtrAttrs))
584__OMP_RTL_ATTRS(__kmpc_fork_call, ForkAttrs, AttributeSet(),
585 ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), ReadOnlyPtrAttrs))
586__OMP_RTL_ATTRS(__kmpc_omp_taskwait, BarrierAttrs, AttributeSet(),
587 ParamAttrs(ReadOnlyPtrAttrs))
588__OMP_RTL_ATTRS(__kmpc_omp_taskyield, InaccessibleArgOnlyAttrs, AttributeSet(),
589 ParamAttrs(ReadOnlyPtrAttrs))
590__OMP_RTL_ATTRS(__kmpc_push_num_threads, InaccessibleArgOnlyAttrs,
591 AttributeSet(), ParamAttrs(ReadOnlyPtrAttrs))
592__OMP_RTL_ATTRS(__kmpc_push_proc_bind, InaccessibleArgOnlyAttrs, AttributeSet(),
593 ParamAttrs(ReadOnlyPtrAttrs))
594__OMP_RTL_ATTRS(__kmpc_serialized_parallel, InaccessibleArgOnlyAttrs,
595 AttributeSet(), ParamAttrs(ReadOnlyPtrAttrs))
596__OMP_RTL_ATTRS(__kmpc_end_serialized_parallel, InaccessibleArgOnlyAttrs,
597 AttributeSet(), ParamAttrs(ReadOnlyPtrAttrs))
598__OMP_RTL_ATTRS(__kmpc_omp_reg_task_with_affinity, DefaultAttrs, AttributeSet(),
599 ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), ReadOnlyPtrAttrs,
600 AttributeSet(), ReadOnlyPtrAttrs))
601
602__OMP_RTL_ATTRS(omp_get_thread_num, GetterAttrs, AttributeSet(), ParamAttrs())
603__OMP_RTL_ATTRS(omp_get_num_threads, GetterAttrs, AttributeSet(), ParamAttrs())
604__OMP_RTL_ATTRS(omp_get_max_threads, GetterAttrs, AttributeSet(), ParamAttrs())
605__OMP_RTL_ATTRS(omp_in_parallel, GetterAttrs, AttributeSet(), ParamAttrs())
606__OMP_RTL_ATTRS(omp_get_dynamic, GetterAttrs, AttributeSet(), ParamAttrs())
607__OMP_RTL_ATTRS(omp_get_cancellation, GetterAttrs, AttributeSet(), ParamAttrs())
608__OMP_RTL_ATTRS(omp_get_nested, GetterAttrs, AttributeSet(), ParamAttrs())
609__OMP_RTL_ATTRS(
610 omp_get_schedule, GetterArgWriteAttrs, AttributeSet(),
611 ParamAttrs(AttributeSet(EnumAttr(NoCapture), EnumAttr(WriteOnly)),
612 AttributeSet(EnumAttr(NoCapture), EnumAttr(WriteOnly))))
613__OMP_RTL_ATTRS(omp_get_thread_limit, GetterAttrs, AttributeSet(), ParamAttrs())
614__OMP_RTL_ATTRS(omp_get_supported_active_levels, GetterAttrs, AttributeSet(),
615 ParamAttrs())
616__OMP_RTL_ATTRS(omp_get_max_active_levels, GetterAttrs, AttributeSet(),
617 ParamAttrs())
618__OMP_RTL_ATTRS(omp_get_level, GetterAttrs, AttributeSet(), ParamAttrs())
619__OMP_RTL_ATTRS(omp_get_ancestor_thread_num, GetterAttrs, AttributeSet(),
620 ParamAttrs())
621__OMP_RTL_ATTRS(omp_get_team_size, GetterAttrs, AttributeSet(), ParamAttrs())
622__OMP_RTL_ATTRS(omp_get_active_level, GetterAttrs, AttributeSet(), ParamAttrs())
623__OMP_RTL_ATTRS(omp_in_final, GetterAttrs, AttributeSet(), ParamAttrs())
624__OMP_RTL_ATTRS(omp_get_proc_bind, GetterAttrs, AttributeSet(), ParamAttrs())
625__OMP_RTL_ATTRS(omp_get_num_places, GetterAttrs, AttributeSet(), ParamAttrs())
626__OMP_RTL_ATTRS(omp_get_num_procs, GetterAttrs, AttributeSet(), ParamAttrs())
627__OMP_RTL_ATTRS(omp_get_place_proc_ids, GetterArgWriteAttrs, AttributeSet(),
628 ParamAttrs(AttributeSet(), AttributeSet(EnumAttr(NoCapture),
629 EnumAttr(WriteOnly))))
630__OMP_RTL_ATTRS(omp_get_place_num, GetterAttrs, AttributeSet(), ParamAttrs())
631__OMP_RTL_ATTRS(omp_get_partition_num_places, GetterAttrs, AttributeSet(),
632 ParamAttrs())
633__OMP_RTL_ATTRS(omp_get_partition_place_nums, GetterAttrs, AttributeSet(),
634 ParamAttrs())
635
636__OMP_RTL_ATTRS(omp_set_num_threads, SetterAttrs, AttributeSet(), ParamAttrs())
637__OMP_RTL_ATTRS(omp_set_dynamic, SetterAttrs, AttributeSet(), ParamAttrs())
638__OMP_RTL_ATTRS(omp_set_nested, SetterAttrs, AttributeSet(), ParamAttrs())
639__OMP_RTL_ATTRS(omp_set_schedule, SetterAttrs, AttributeSet(), ParamAttrs())
640__OMP_RTL_ATTRS(omp_set_max_active_levels, SetterAttrs, AttributeSet(),
641 ParamAttrs())
642
643__OMP_RTL_ATTRS(__kmpc_master, InaccessibleArgOnlyAttrs, AttributeSet(),
644 ParamAttrs(ReadOnlyPtrAttrs))
645__OMP_RTL_ATTRS(__kmpc_end_master, InaccessibleArgOnlyAttrs, AttributeSet(),
646 ParamAttrs(ReadOnlyPtrAttrs))
647__OMP_RTL_ATTRS(__kmpc_masked, InaccessibleArgOnlyAttrs, AttributeSet(),
648 ParamAttrs(ReadOnlyPtrAttrs))
649__OMP_RTL_ATTRS(__kmpc_end_masked, InaccessibleArgOnlyAttrs, AttributeSet(),
650 ParamAttrs(ReadOnlyPtrAttrs))
651__OMP_RTL_ATTRS(__kmpc_critical, BarrierAttrs, AttributeSet(),
652 ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), AttributeSet()))
653__OMP_RTL_ATTRS(__kmpc_critical_with_hint, BarrierAttrs, AttributeSet(),
654 ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), AttributeSet(),
655 AttributeSet()))
656__OMP_RTL_ATTRS(__kmpc_end_critical, BarrierAttrs, AttributeSet(),
657 ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), AttributeSet()))
658
659__OMP_RTL_ATTRS(__kmpc_begin, DefaultAttrs, AttributeSet(),
660 ParamAttrs(ReadOnlyPtrAttrs))
661__OMP_RTL_ATTRS(__kmpc_end, DefaultAttrs, AttributeSet(),
662 ParamAttrs(ReadOnlyPtrAttrs))
663
664__OMP_RTL_ATTRS(__kmpc_reduce, BarrierAttrs, AttributeSet(),
665 ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), AttributeSet(),
666 AttributeSet(), ReadOnlyPtrAttrs, AttributeSet()))
667__OMP_RTL_ATTRS(__kmpc_reduce_nowait, BarrierAttrs, AttributeSet(),
668 ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), AttributeSet(),
669 AttributeSet(), ReadOnlyPtrAttrs, AttributeSet()))
670__OMP_RTL_ATTRS(__kmpc_end_reduce, BarrierAttrs, AttributeSet(),
671 ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), AttributeSet()))
672__OMP_RTL_ATTRS(__kmpc_end_reduce_nowait, BarrierAttrs, AttributeSet(),
673 ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), AttributeSet()))
674
675__OMP_RTL_ATTRS(__kmpc_ordered, BarrierAttrs, AttributeSet(),
676 ParamAttrs(ReadOnlyPtrAttrs))
677__OMP_RTL_ATTRS(__kmpc_end_ordered, BarrierAttrs, AttributeSet(),
678 ParamAttrs(ReadOnlyPtrAttrs))
679
680__OMP_RTL_ATTRS(__kmpc_for_static_init_4, GetterArgWriteAttrs, AttributeSet(),
681 ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), AttributeSet(),
682 ArgPtrAttrs, ArgPtrAttrs, ArgPtrAttrs, ArgPtrAttrs,
683 AttributeSet(), AttributeSet()))
684__OMP_RTL_ATTRS(__kmpc_for_static_init_4u, GetterArgWriteAttrs, AttributeSet(),
685 ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), AttributeSet(),
686 ArgPtrAttrs, ArgPtrAttrs, ArgPtrAttrs, ArgPtrAttrs,
687 AttributeSet(), AttributeSet()))
688__OMP_RTL_ATTRS(__kmpc_for_static_init_8, GetterArgWriteAttrs, AttributeSet(),
689 ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), AttributeSet(),
690 ArgPtrAttrs, ArgPtrAttrs, ArgPtrAttrs, ArgPtrAttrs,
691 AttributeSet(), AttributeSet()))
692__OMP_RTL_ATTRS(__kmpc_for_static_init_8u, GetterArgWriteAttrs, AttributeSet(),
693 ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), AttributeSet(),
694 ArgPtrAttrs, ArgPtrAttrs, ArgPtrAttrs, ArgPtrAttrs,
695 AttributeSet(), AttributeSet()))
696__OMP_RTL_ATTRS(__kmpc_for_static_fini, InaccessibleArgOnlyAttrs,
697 AttributeSet(), ParamAttrs(ReadOnlyPtrAttrs))
698__OMP_RTL_ATTRS(__kmpc_dist_dispatch_init_4, GetterArgWriteAttrs,
699 AttributeSet(),
700 ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), AttributeSet(),
701 ArgPtrAttrs))
702__OMP_RTL_ATTRS(__kmpc_dist_dispatch_init_4u, GetterArgWriteAttrs,
703 AttributeSet(),
704 ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), AttributeSet(),
705 ArgPtrAttrs))
706__OMP_RTL_ATTRS(__kmpc_dist_dispatch_init_8, GetterArgWriteAttrs,
707 AttributeSet(),
708 ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), AttributeSet(),
709 ArgPtrAttrs))
710__OMP_RTL_ATTRS(__kmpc_dist_dispatch_init_8u, GetterArgWriteAttrs,
711 AttributeSet(),
712 ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), AttributeSet(),
713 ArgPtrAttrs))
714__OMP_RTL_ATTRS(__kmpc_dispatch_init_4, GetterArgWriteAttrs, AttributeSet(),
715 ParamAttrs(ReadOnlyPtrAttrs))
716__OMP_RTL_ATTRS(__kmpc_dispatch_init_4u, GetterArgWriteAttrs, AttributeSet(),
717 ParamAttrs(ReadOnlyPtrAttrs))
718__OMP_RTL_ATTRS(__kmpc_dispatch_init_8, GetterArgWriteAttrs, AttributeSet(),
719 ParamAttrs(ReadOnlyPtrAttrs))
720__OMP_RTL_ATTRS(__kmpc_dispatch_init_8u, GetterArgWriteAttrs, AttributeSet(),
721 ParamAttrs(ReadOnlyPtrAttrs))
722__OMP_RTL_ATTRS(__kmpc_dispatch_next_4, GetterArgWriteAttrs, AttributeSet(),
723 ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), ArgPtrAttrs,
724 ArgPtrAttrs, ArgPtrAttrs, ArgPtrAttrs))
725__OMP_RTL_ATTRS(__kmpc_dispatch_next_4u, GetterArgWriteAttrs, AttributeSet(),
726 ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), ArgPtrAttrs,
727 ArgPtrAttrs, ArgPtrAttrs, ArgPtrAttrs))
728__OMP_RTL_ATTRS(__kmpc_dispatch_next_8, GetterArgWriteAttrs, AttributeSet(),
729 ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), ArgPtrAttrs,
730 ArgPtrAttrs, ArgPtrAttrs, ArgPtrAttrs))
731__OMP_RTL_ATTRS(__kmpc_dispatch_next_8u, GetterArgWriteAttrs, AttributeSet(),
732 ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), ArgPtrAttrs,
733 ArgPtrAttrs, ArgPtrAttrs, ArgPtrAttrs))
734__OMP_RTL_ATTRS(__kmpc_dispatch_fini_4, InaccessibleArgOnlyAttrs,
735 AttributeSet(), ParamAttrs(ReadOnlyPtrAttrs))
736__OMP_RTL_ATTRS(__kmpc_dispatch_fini_4u, InaccessibleArgOnlyAttrs,
737 AttributeSet(), ParamAttrs(ReadOnlyPtrAttrs))
738__OMP_RTL_ATTRS(__kmpc_dispatch_fini_8, InaccessibleArgOnlyAttrs,
739 AttributeSet(), ParamAttrs(ReadOnlyPtrAttrs))
740__OMP_RTL_ATTRS(__kmpc_dispatch_fini_8u, InaccessibleArgOnlyAttrs,
741 AttributeSet(), ParamAttrs(ReadOnlyPtrAttrs))
742__OMP_RTL_ATTRS(__kmpc_team_static_init_4, GetterArgWriteAttrs, AttributeSet(),
743 ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), ArgPtrAttrs,
744 ArgPtrAttrs, ArgPtrAttrs, ArgPtrAttrs))
745__OMP_RTL_ATTRS(__kmpc_team_static_init_4u, GetterArgWriteAttrs, AttributeSet(),
746 ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), ArgPtrAttrs,
747 ArgPtrAttrs, ArgPtrAttrs, ArgPtrAttrs))
748__OMP_RTL_ATTRS(__kmpc_team_static_init_8, GetterArgWriteAttrs, AttributeSet(),
749 ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), ArgPtrAttrs,
750 ArgPtrAttrs, ArgPtrAttrs, ArgPtrAttrs))
751__OMP_RTL_ATTRS(__kmpc_team_static_init_8u, GetterArgWriteAttrs, AttributeSet(),
752 ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), ArgPtrAttrs,
753 ArgPtrAttrs, ArgPtrAttrs, ArgPtrAttrs))
754__OMP_RTL_ATTRS(__kmpc_dist_for_static_init_4, GetterArgWriteAttrs,
755 AttributeSet(),
756 ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), AttributeSet(),
757 ArgPtrAttrs, ArgPtrAttrs, ArgPtrAttrs, ArgPtrAttrs,
758 ArgPtrAttrs))
759__OMP_RTL_ATTRS(__kmpc_dist_for_static_init_4u, GetterArgWriteAttrs,
760 AttributeSet(),
761 ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), AttributeSet(),
762 ArgPtrAttrs, ArgPtrAttrs, ArgPtrAttrs, ArgPtrAttrs,
763 ArgPtrAttrs))
764__OMP_RTL_ATTRS(__kmpc_dist_for_static_init_8, GetterArgWriteAttrs,
765 AttributeSet(),
766 ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), AttributeSet(),
767 ArgPtrAttrs, ArgPtrAttrs, ArgPtrAttrs, ArgPtrAttrs,
768 ArgPtrAttrs))
769__OMP_RTL_ATTRS(__kmpc_dist_for_static_init_8u, GetterArgWriteAttrs,
770 AttributeSet(),
771 ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), AttributeSet(),
772 ArgPtrAttrs, ArgPtrAttrs, ArgPtrAttrs, ArgPtrAttrs,
773 ArgPtrAttrs))
774
775__OMP_RTL_ATTRS(__kmpc_single, BarrierAttrs, AttributeSet(),
776 ParamAttrs(ReadOnlyPtrAttrs))
777__OMP_RTL_ATTRS(__kmpc_end_single, BarrierAttrs, AttributeSet(),
778 ParamAttrs(ReadOnlyPtrAttrs))
779
780__OMP_RTL_ATTRS(__kmpc_omp_task_alloc, DefaultAttrs, ReturnPtrAttrs,
781 ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), AttributeSet(),
782 AttributeSet(), AttributeSet(), ReadOnlyPtrAttrs))
783__OMP_RTL_ATTRS(__kmpc_omp_task, DefaultAttrs, AttributeSet(),
784 ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), AttributeSet()))
785__OMP_RTL_ATTRS(__kmpc_end_taskgroup, BarrierAttrs, AttributeSet(),
786 ParamAttrs(ReadOnlyPtrAttrs))
787__OMP_RTL_ATTRS(__kmpc_taskgroup, BarrierAttrs, AttributeSet(),
788 ParamAttrs(ReadOnlyPtrAttrs))
789__OMP_RTL_ATTRS(__kmpc_omp_task_begin_if0, DefaultAttrs, AttributeSet(),
790 ParamAttrs(ReadOnlyPtrAttrs))
791__OMP_RTL_ATTRS(__kmpc_omp_task_complete_if0, DefaultAttrs, AttributeSet(),
792 ParamAttrs(ReadOnlyPtrAttrs))
793__OMP_RTL_ATTRS(__kmpc_omp_task_with_deps, DefaultAttrs, AttributeSet(),
794 ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), AttributeSet(),
795 AttributeSet(), ReadOnlyPtrAttrs, AttributeSet(),
796 ReadOnlyPtrAttrs))
797__OMP_RTL_ATTRS(__kmpc_taskloop, DefaultAttrs, AttributeSet(),
798 ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), AttributeSet(),
799 AttributeSet(), ArgPtrAttrs, ArgPtrAttrs,
800 AttributeSet(), AttributeSet(), AttributeSet(),
801 AttributeSet(), AttributeSet()))
802__OMP_RTL_ATTRS(__kmpc_omp_target_task_alloc, DefaultAttrs, ReturnPtrAttrs,
803 ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), AttributeSet(),
804 AttributeSet(), AttributeSet(), ReadOnlyPtrAttrs,
805 AttributeSet()))
806__OMP_RTL_ATTRS(__kmpc_taskred_modifier_init, DefaultAttrs, ReturnPtrAttrs,
807 ParamAttrs(ReadOnlyPtrAttrs))
808__OMP_RTL_ATTRS(__kmpc_taskred_init, DefaultAttrs, AttributeSet(), ParamAttrs())
809__OMP_RTL_ATTRS(__kmpc_task_reduction_modifier_fini, BarrierAttrs,
810 AttributeSet(), ParamAttrs(ReadOnlyPtrAttrs))
811__OMP_RTL_ATTRS(__kmpc_task_reduction_get_th_data, DefaultAttrs, ReturnPtrAttrs,
812 ParamAttrs())
813__OMP_RTL_ATTRS(__kmpc_task_reduction_init, DefaultAttrs, ReturnPtrAttrs,
814 ParamAttrs())
815__OMP_RTL_ATTRS(__kmpc_task_reduction_modifier_init, DefaultAttrs,
816 ReturnPtrAttrs, ParamAttrs())
817__OMP_RTL_ATTRS(__kmpc_proxy_task_completed_ooo, DefaultAttrs, AttributeSet(),
818 ParamAttrs())
819
820__OMP_RTL_ATTRS(__kmpc_omp_wait_deps, BarrierAttrs, AttributeSet(),
821 ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), AttributeSet(),
822 ReadOnlyPtrAttrs))
823__OMP_RTL_ATTRS(__kmpc_cancellationpoint, DefaultAttrs, AttributeSet(),
824 ParamAttrs(ReadOnlyPtrAttrs))
825
826__OMP_RTL_ATTRS(__kmpc_fork_teams, ForkAttrs, AttributeSet(),
827 ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), ReadOnlyPtrAttrs))
828__OMP_RTL_ATTRS(__kmpc_push_num_teams, InaccessibleArgOnlyAttrs, AttributeSet(),
829 ParamAttrs(ReadOnlyPtrAttrs))
830
831__OMP_RTL_ATTRS(__kmpc_copyprivate, DefaultAttrs, AttributeSet(),
832 ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), AttributeSet(),
833 ReadOnlyPtrAttrs))
834__OMP_RTL_ATTRS(__kmpc_threadprivate_cached, DefaultAttrs, ReturnPtrAttrs,
835 ParamAttrs(ReadOnlyPtrAttrs))
836__OMP_RTL_ATTRS(__kmpc_threadprivate_register, DefaultAttrs, AttributeSet(),
837 ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), ReadOnlyPtrAttrs,
838 ReadOnlyPtrAttrs, ReadOnlyPtrAttrs))
839
840__OMP_RTL_ATTRS(__kmpc_doacross_init, BarrierAttrs, AttributeSet(),
841 ParamAttrs(ReadOnlyPtrAttrs))
842__OMP_RTL_ATTRS(__kmpc_doacross_post, BarrierAttrs, AttributeSet(),
843 ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), ReadOnlyPtrAttrs))
844__OMP_RTL_ATTRS(__kmpc_doacross_wait, BarrierAttrs, AttributeSet(),
845 ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), ReadOnlyPtrAttrs))
846__OMP_RTL_ATTRS(__kmpc_doacross_fini, BarrierAttrs, AttributeSet(),
847 ParamAttrs(ReadOnlyPtrAttrs))
848
849__OMP_RTL_ATTRS(__kmpc_alloc, DefaultAttrs, ReturnPtrAttrs, ParamAttrs())
850__OMP_RTL_ATTRS(__kmpc_free, AllocAttrs, AttributeSet(), ParamAttrs())
851
852__OMP_RTL_ATTRS(__kmpc_init_allocator, DefaultAttrs, ReturnPtrAttrs,
853 ParamAttrs())
854__OMP_RTL_ATTRS(__kmpc_destroy_allocator, AllocAttrs, AttributeSet(),
855 ParamAttrs())
856
857__OMP_RTL_ATTRS(__kmpc_push_target_tripcount_mapper, SetterAttrs,
858 AttributeSet(), ParamAttrs())
859__OMP_RTL_ATTRS(__tgt_target_mapper, ForkAttrs, AttributeSet(), ParamAttrs())
860__OMP_RTL_ATTRS(__tgt_target_nowait_mapper, ForkAttrs, AttributeSet(),
861 ParamAttrs())
862__OMP_RTL_ATTRS(__tgt_target_teams_mapper, ForkAttrs, AttributeSet(),
863 ParamAttrs())
864__OMP_RTL_ATTRS(__tgt_target_teams_nowait_mapper, ForkAttrs, AttributeSet(),
865 ParamAttrs())
866__OMP_RTL_ATTRS(__tgt_register_requires, ForkAttrs, AttributeSet(),
867 ParamAttrs())
868__OMP_RTL_ATTRS(__tgt_target_data_begin_mapper, ForkAttrs, AttributeSet(),
869 ParamAttrs())
870__OMP_RTL_ATTRS(__tgt_target_data_begin_nowait_mapper, ForkAttrs,
871 AttributeSet(), ParamAttrs())
872__OMP_RTL_ATTRS(__tgt_target_data_end_mapper, ForkAttrs, AttributeSet(),
873 ParamAttrs())
874__OMP_RTL_ATTRS(__tgt_target_data_end_nowait_mapper, ForkAttrs,
875 AttributeSet(), ParamAttrs())
876__OMP_RTL_ATTRS(__tgt_target_data_update_mapper, ForkAttrs, AttributeSet(),
877 ParamAttrs())
878__OMP_RTL_ATTRS(__tgt_target_data_update_nowait_mapper, ForkAttrs,
879 AttributeSet(), ParamAttrs())
880__OMP_RTL_ATTRS(__tgt_mapper_num_components, ForkAttrs, AttributeSet(),
881 ParamAttrs())
882__OMP_RTL_ATTRS(__tgt_push_mapper_component, ForkAttrs, AttributeSet(),
883 ParamAttrs())
884__OMP_RTL_ATTRS(__kmpc_task_allow_completion_event, DefaultAttrs,
885 ReturnPtrAttrs, ParamAttrs(ReadOnlyPtrAttrs))
886
887#undef __OMP_RTL_ATTRS
888#undef OMP_RTL_ATTRS
889#undef AttributeSet
890#undef EnumAttr
891#undef EnumAttrInt
892#undef ParamAttrs
893
894///}
895
896/// KMP ident_t bit flags
897///
898/// In accordance with the values in `openmp/runtime/src/kmp.h`.
899///
900///{
901
902#ifndef OMP_IDENT_FLAG
903#define OMP_IDENT_FLAG(Enum, Str, Value)
904#endif
905
906#define __OMP_IDENT_FLAG(Name, Value) \
907 OMP_IDENT_FLAG(OMP_IDENT_FLAG_##Name, #Name, Value)
908
909__OMP_IDENT_FLAG(KMPC, 0x02)
910__OMP_IDENT_FLAG(BARRIER_EXPL, 0x20)
911__OMP_IDENT_FLAG(BARRIER_IMPL, 0x0040)
912__OMP_IDENT_FLAG(BARRIER_IMPL_MASK, 0x01C0)
913__OMP_IDENT_FLAG(BARRIER_IMPL_FOR, 0x0040)
914__OMP_IDENT_FLAG(BARRIER_IMPL_SECTIONS, 0x00C0)
915__OMP_IDENT_FLAG(BARRIER_IMPL_SINGLE, 0x0140)
916__OMP_IDENT_FLAG(BARRIER_IMPL_WORKSHARE, 0x01C0)
917
918#undef __OMP_IDENT_FLAG
919#undef OMP_IDENT_FLAG
920
921///}
922
923/// KMP cancel kind
924///
925///{
926
927#ifndef OMP_CANCEL_KIND
928#define OMP_CANCEL_KIND(Enum, Str, DirectiveEnum, Value)
929#endif
930
931#define __OMP_CANCEL_KIND(Name, Value) \
932 OMP_CANCEL_KIND(OMP_CANCEL_KIND_##Name, #Name, OMPD_##Name, Value)
933
934__OMP_CANCEL_KIND(parallel, 1)
935__OMP_CANCEL_KIND(for, 2)
936__OMP_CANCEL_KIND(sections, 3)
937__OMP_CANCEL_KIND(taskgroup, 4)
938
939#undef __OMP_CANCEL_KIND
940#undef OMP_CANCEL_KIND
941
942///}
943
944/// Default kinds
945///
946///{
947
948#ifndef OMP_DEFAULT_KIND
949#define OMP_DEFAULT_KIND(Enum, Str)
950#endif
951
952#define __OMP_DEFAULT_KIND(Name) OMP_DEFAULT_KIND(OMP_DEFAULT_##Name, #Name)
953
954__OMP_DEFAULT_KIND(none)
955__OMP_DEFAULT_KIND(shared)
956__OMP_DEFAULT_KIND(firstprivate)
957__OMP_DEFAULT_KIND(unknown)
958
959#undef __OMP_DEFAULT_KIND
960#undef OMP_DEFAULT_KIND
961
962///}
963
964/// Proc bind kinds
965///
966///{
967
968#ifndef OMP_PROC_BIND_KIND
969#define OMP_PROC_BIND_KIND(Enum, Str, Value)
970#endif
971
972#define __OMP_PROC_BIND_KIND(Name, Value) \
973 OMP_PROC_BIND_KIND(OMP_PROC_BIND_##Name, #Name, Value)
974
975__OMP_PROC_BIND_KIND(master, 2)
976__OMP_PROC_BIND_KIND(close, 3)
977__OMP_PROC_BIND_KIND(spread, 4)
978__OMP_PROC_BIND_KIND(primary, 5)
979__OMP_PROC_BIND_KIND(default, 6)
980__OMP_PROC_BIND_KIND(unknown, 7)
981
982#undef __OMP_PROC_BIND_KIND
983#undef OMP_PROC_BIND_KIND
984
985///}
986
987/// OpenMP context related definitions:
988/// - trait set selector
989/// - trait selector
990/// - trait property
991///
992///{
993
994#ifndef OMP_TRAIT_SET
995#define OMP_TRAIT_SET(Enum, Str)
996#endif
997#ifndef OMP_TRAIT_SELECTOR
998#define OMP_TRAIT_SELECTOR(Enum, TraitSetEnum, Str, RequiresProperty)
999#endif
1000#ifndef OMP_TRAIT_PROPERTY
1001#define OMP_TRAIT_PROPERTY(Enum, TraitSetEnum, TraitSelectorEnum, Str)
1002#endif
1003#ifndef OMP_LAST_TRAIT_PROPERTY
1004#define OMP_LAST_TRAIT_PROPERTY(Enum)
1005#endif
1006
1007#define __OMP_TRAIT_SET(Name) OMP_TRAIT_SET(Name, #Name)
1008#define __OMP_TRAIT_SELECTOR(TraitSet, Name, RequiresProperty) \
1009 OMP_TRAIT_SELECTOR(TraitSet##_##Name, TraitSet, #Name, RequiresProperty)
1010#define __OMP_TRAIT_SELECTOR_AND_PROPERTY(TraitSet, Name) \
1011 OMP_TRAIT_SELECTOR(TraitSet##_##Name, TraitSet, #Name, false) \
1012 OMP_TRAIT_PROPERTY(TraitSet##_##Name##_##Name, TraitSet, TraitSet##_##Name, \
1013 #Name)
1014#define __OMP_TRAIT_PROPERTY(TraitSet, TraitSelector, Name) \
1015 OMP_TRAIT_PROPERTY(TraitSet##_##TraitSelector##_##Name, TraitSet, \
1016 TraitSet##_##TraitSelector, #Name)
1017
1018// "invalid" must go first.
1019OMP_TRAIT_SET(invalid, "invalid")
1020OMP_TRAIT_SELECTOR(invalid, invalid, "invalid", false)
1021OMP_TRAIT_PROPERTY(invalid, invalid, invalid, "invalid")
1022
1023__OMP_TRAIT_SET(construct)
1024__OMP_TRAIT_SELECTOR_AND_PROPERTY(construct, target)
1025__OMP_TRAIT_SELECTOR_AND_PROPERTY(construct, teams)
1026__OMP_TRAIT_SELECTOR_AND_PROPERTY(construct, parallel)
1027__OMP_TRAIT_SELECTOR_AND_PROPERTY(construct, for)
1028__OMP_TRAIT_SELECTOR_AND_PROPERTY(construct, simd)
1029
1030__OMP_TRAIT_SET(device)
1031
1032__OMP_TRAIT_SELECTOR(device, kind, true)
1033
1034__OMP_TRAIT_PROPERTY(device, kind, host)
1035__OMP_TRAIT_PROPERTY(device, kind, nohost)
1036__OMP_TRAIT_PROPERTY(device, kind, cpu)
1037__OMP_TRAIT_PROPERTY(device, kind, gpu)
1038__OMP_TRAIT_PROPERTY(device, kind, fpga)
1039__OMP_TRAIT_PROPERTY(device, kind, any)
1040
1041__OMP_TRAIT_SELECTOR(device, arch, true)
1042
1043__OMP_TRAIT_PROPERTY(device, arch, arm)
1044__OMP_TRAIT_PROPERTY(device, arch, armeb)
1045__OMP_TRAIT_PROPERTY(device, arch, aarch64)
1046__OMP_TRAIT_PROPERTY(device, arch, aarch64_be)
1047__OMP_TRAIT_PROPERTY(device, arch, aarch64_32)
1048__OMP_TRAIT_PROPERTY(device, arch, ppc)
1049__OMP_TRAIT_PROPERTY(device, arch, ppcle)
1050__OMP_TRAIT_PROPERTY(device, arch, ppc64)
1051__OMP_TRAIT_PROPERTY(device, arch, ppc64le)
1052__OMP_TRAIT_PROPERTY(device, arch, x86)
1053__OMP_TRAIT_PROPERTY(device, arch, x86_64)
1054__OMP_TRAIT_PROPERTY(device, arch, amdgcn)
1055__OMP_TRAIT_PROPERTY(device, arch, nvptx)
1056__OMP_TRAIT_PROPERTY(device, arch, nvptx64)
1057
1058__OMP_TRAIT_SET(implementation)
1059
1060__OMP_TRAIT_SELECTOR(implementation, vendor, true)
1061
1062__OMP_TRAIT_PROPERTY(implementation, vendor, amd)
1063__OMP_TRAIT_PROPERTY(implementation, vendor, arm)
1064__OMP_TRAIT_PROPERTY(implementation, vendor, bsc)
1065__OMP_TRAIT_PROPERTY(implementation, vendor, cray)
1066__OMP_TRAIT_PROPERTY(implementation, vendor, fujitsu)
1067__OMP_TRAIT_PROPERTY(implementation, vendor, gnu)
1068__OMP_TRAIT_PROPERTY(implementation, vendor, ibm)
1069__OMP_TRAIT_PROPERTY(implementation, vendor, intel)
1070__OMP_TRAIT_PROPERTY(implementation, vendor, llvm)
1071__OMP_TRAIT_PROPERTY(implementation, vendor, pgi)
1072__OMP_TRAIT_PROPERTY(implementation, vendor, ti)
1073__OMP_TRAIT_PROPERTY(implementation, vendor, unknown)
1074
1075__OMP_TRAIT_SELECTOR(implementation, extension, true)
1076__OMP_TRAIT_PROPERTY(implementation, extension, match_all)
1077__OMP_TRAIT_PROPERTY(implementation, extension, match_any)
1078__OMP_TRAIT_PROPERTY(implementation, extension, match_none)
1079__OMP_TRAIT_PROPERTY(implementation, extension, disable_implicit_base)
1080__OMP_TRAIT_PROPERTY(implementation, extension, allow_templates)
1081
1082__OMP_TRAIT_SET(user)
1083
1084__OMP_TRAIT_SELECTOR(user, condition, true)
1085
1086__OMP_TRAIT_PROPERTY(user, condition, true)
1087__OMP_TRAIT_PROPERTY(user, condition, false)
1088__OMP_TRAIT_PROPERTY(user, condition, unknown)
1089
1090__OMP_TRAIT_SELECTOR_AND_PROPERTY(construct, dispatch)
1091
1092// Note that we put isa last so that the other conditions are checked first.
1093// This allows us to issue warnings wrt. isa only if we match otherwise.
1094__OMP_TRAIT_SELECTOR(device, isa, true)
1095
1096// We use "__ANY" as a placeholder in the isa property to denote the
1097// conceptual "any", not the literal `any` used in kind. The string we
1098// we use is not important except that it will show up in diagnostics.
1099OMP_TRAIT_PROPERTY(device_isa___ANY, device, device_isa,
1100 "<any, entirely target dependent>")
1101
1102
1103#undef OMP_TRAIT_SET
1104#undef __OMP_TRAIT_SET
1105///}
1106
1107/// Traits for the requires directive
1108///
1109/// These will (potentially) become trait selectors for the OpenMP context if
1110/// the OMP_REQUIRES_TRAIT macro is not defined.
1111///
1112///{
1113
1114#ifdef OMP_REQUIRES_TRAIT
1115#define __OMP_REQUIRES_TRAIT(Name) \
1116 OMP_REQUIRES_TRAIT(OMP_REQUIRES_TRAIT_##Name, #Name)
1117#else
1118#define __OMP_REQUIRES_TRAIT(Name) \
1119 __OMP_TRAIT_SELECTOR_AND_PROPERTY(implementation, Name)
1120#endif
1121
1122__OMP_REQUIRES_TRAIT(unified_address)
1123__OMP_REQUIRES_TRAIT(unified_shared_memory)
1124__OMP_REQUIRES_TRAIT(reverse_offload)
1125__OMP_REQUIRES_TRAIT(dynamic_allocators)
1126__OMP_REQUIRES_TRAIT(atomic_default_mem_order)
1127
1128OMP_LAST_TRAIT_PROPERTY(
1129 implementation_atomic_default_mem_order_atomic_default_mem_order)
1130
1131#undef __OMP_TRAIT_SELECTOR_AND_PROPERTY
1132#undef OMP_TRAIT_SELECTOR
1133#undef __OMP_TRAIT_SELECTOR
1134#undef OMP_TRAIT_PROPERTY
1135#undef OMP_LAST_TRAIT_PROPERTY
1136#undef __OMP_TRAIT_PROPERTY
1137#undef __OMP_REQUIRES_TRAIT
1138#undef OMP_REQUIRES_TRAIT
1139///}
1140
1141
1142/// Assumption clauses
1143///
1144///{
1145
1146#ifdef OMP_ASSUME_CLAUSE
1147#define __OMP_ASSUME_CLAUSE(Identifier, StartsWith, HasDirectiveList, HasExpression) \
1148OMP_ASSUME_CLAUSE(Identifier, StartsWith, HasDirectiveList, HasExpression)
1149#else
1150#define __OMP_ASSUME_CLAUSE(...)
1151#endif
1152
1153__OMP_ASSUME_CLAUSE(llvm::StringLiteral("ext_"), true, false, false)
1154__OMP_ASSUME_CLAUSE(llvm::StringLiteral("absent"), false, true, false)
1155__OMP_ASSUME_CLAUSE(llvm::StringLiteral("contains"), false, true, false)
1156__OMP_ASSUME_CLAUSE(llvm::StringLiteral("holds"), false, false, true)
1157__OMP_ASSUME_CLAUSE(llvm::StringLiteral("no_openmp"), false, false, false)
1158__OMP_ASSUME_CLAUSE(llvm::StringLiteral("no_openmp_routines"), false, false, false)
1159__OMP_ASSUME_CLAUSE(llvm::StringLiteral("no_parallelism"), false, false, false)
1160
1161#undef __OMP_ASSUME_CLAUSE
1162#undef OMP_ASSUME_CLAUSE
1163///}
1164