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 | |
41 | OMP_TYPE(SizeTy, M.getDataLayout().getIntPtrType(Ctx)) |
42 | OMP_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. |
1019 | OMP_TRAIT_SET(invalid, "invalid" ) |
1020 | OMP_TRAIT_SELECTOR(invalid, invalid, "invalid" , false) |
1021 | OMP_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. |
1099 | OMP_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 | |
1128 | OMP_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) \ |
1148 | OMP_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 | |