1//===--- OpenMPKinds.def - OpenMP directives and clauses list ---*- C++ -*-===//
2//
3//                     The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9/// \file
10/// \brief This file defines the list of supported OpenMP directives and
11/// clauses.
12///
13//===----------------------------------------------------------------------===//
14
15#ifndef OPENMP_DIRECTIVE
16#  define OPENMP_DIRECTIVE(Name)
17#endif
18#ifndef OPENMP_DIRECTIVE_EXT
19#define OPENMP_DIRECTIVE_EXT(Name, Str)
20#endif
21#ifndef OPENMP_CLAUSE
22#  define OPENMP_CLAUSE(Name, Class)
23#endif
24#ifndef OPENMP_PARALLEL_CLAUSE
25#  define OPENMP_PARALLEL_CLAUSE(Name)
26#endif
27#ifndef OPENMP_SIMD_CLAUSE
28#  define OPENMP_SIMD_CLAUSE(Name)
29#endif
30#ifndef OPENMP_FOR_CLAUSE
31#  define OPENMP_FOR_CLAUSE(Name)
32#endif
33#ifndef OPENMP_FOR_SIMD_CLAUSE
34#  define OPENMP_FOR_SIMD_CLAUSE(Name)
35#endif
36#ifndef OPENMP_SECTIONS_CLAUSE
37#  define OPENMP_SECTIONS_CLAUSE(Name)
38#endif
39#ifndef OPENMP_SINGLE_CLAUSE
40#  define OPENMP_SINGLE_CLAUSE(Name)
41#endif
42#ifndef OPENMP_PARALLEL_FOR_CLAUSE
43#  define OPENMP_PARALLEL_FOR_CLAUSE(Name)
44#endif
45#ifndef OPENMP_PARALLEL_FOR_SIMD_CLAUSE
46#  define OPENMP_PARALLEL_FOR_SIMD_CLAUSE(Name)
47#endif
48#ifndef OPENMP_PARALLEL_SECTIONS_CLAUSE
49#  define OPENMP_PARALLEL_SECTIONS_CLAUSE(Name)
50#endif
51#ifndef OPENMP_TASK_CLAUSE
52#  define OPENMP_TASK_CLAUSE(Name)
53#endif
54#ifndef OPENMP_ATOMIC_CLAUSE
55#  define OPENMP_ATOMIC_CLAUSE(Name)
56#endif
57#ifndef OPENMP_TARGET_CLAUSE
58#  define OPENMP_TARGET_CLAUSE(Name)
59#endif
60#ifndef OPENMP_TARGET_DATA_CLAUSE
61#  define OPENMP_TARGET_DATA_CLAUSE(Name)
62#endif
63#ifndef OPENMP_TEAMS_CLAUSE
64#  define OPENMP_TEAMS_CLAUSE(Name)
65#endif
66#ifndef OPENMP_CANCEL_CLAUSE
67#  define OPENMP_CANCEL_CLAUSE(Name)
68#endif
69#ifndef OPENMP_ORDERED_CLAUSE
70#  define OPENMP_ORDERED_CLAUSE(Name)
71#endif
72#ifndef OPENMP_TASKLOOP_CLAUSE
73#  define OPENMP_TASKLOOP_CLAUSE(Name)
74#endif
75#ifndef OPENMP_TASKLOOP_SIMD_CLAUSE
76#  define OPENMP_TASKLOOP_SIMD_CLAUSE(Name)
77#endif
78#ifndef OPENMP_CRITICAL_CLAUSE
79#  define OPENMP_CRITICAL_CLAUSE(Name)
80#endif
81#ifndef OPENMP_DISTRIBUTE_CLAUSE
82#define OPENMP_DISTRIBUTE_CLAUSE(Name)
83#endif
84#ifndef OPENMP_DEFAULT_KIND
85#  define OPENMP_DEFAULT_KIND(Name)
86#endif
87#ifndef OPENMP_PROC_BIND_KIND
88#  define OPENMP_PROC_BIND_KIND(Name)
89#endif
90#ifndef OPENMP_SCHEDULE_KIND
91#define OPENMP_SCHEDULE_KIND(Name)
92#endif
93#ifndef OPENMP_DEPEND_KIND
94#define OPENMP_DEPEND_KIND(Name)
95#endif
96#ifndef OPENMP_LINEAR_KIND
97#define OPENMP_LINEAR_KIND(Name)
98#endif
99#ifndef OPENMP_MAP_KIND
100#define OPENMP_MAP_KIND(Name)
101#endif
102
103// OpenMP directives.
104OPENMP_DIRECTIVE(threadprivate)
105OPENMP_DIRECTIVE(parallel)
106OPENMP_DIRECTIVE(task)
107OPENMP_DIRECTIVE(simd)
108OPENMP_DIRECTIVE(for)
109OPENMP_DIRECTIVE(sections)
110OPENMP_DIRECTIVE(section)
111OPENMP_DIRECTIVE(single)
112OPENMP_DIRECTIVE(master)
113OPENMP_DIRECTIVE(critical)
114OPENMP_DIRECTIVE(taskyield)
115OPENMP_DIRECTIVE(barrier)
116OPENMP_DIRECTIVE(taskwait)
117OPENMP_DIRECTIVE(taskgroup)
118OPENMP_DIRECTIVE(flush)
119OPENMP_DIRECTIVE(ordered)
120OPENMP_DIRECTIVE(atomic)
121OPENMP_DIRECTIVE(target)
122OPENMP_DIRECTIVE(teams)
123OPENMP_DIRECTIVE(cancel)
124OPENMP_DIRECTIVE_EXT(target_data, "target data")
125OPENMP_DIRECTIVE_EXT(parallel_for, "parallel for")
126OPENMP_DIRECTIVE_EXT(parallel_for_simd, "parallel for simd")
127OPENMP_DIRECTIVE_EXT(parallel_sections, "parallel sections")
128OPENMP_DIRECTIVE_EXT(for_simd, "for simd")
129OPENMP_DIRECTIVE_EXT(cancellation_point, "cancellation point")
130OPENMP_DIRECTIVE(taskloop)
131OPENMP_DIRECTIVE_EXT(taskloop_simd, "taskloop simd")
132OPENMP_DIRECTIVE(distribute)
133
134// OpenMP clauses.
135OPENMP_CLAUSE(if, OMPIfClause)
136OPENMP_CLAUSE(final, OMPFinalClause)
137OPENMP_CLAUSE(num_threads, OMPNumThreadsClause)
138OPENMP_CLAUSE(safelen, OMPSafelenClause)
139OPENMP_CLAUSE(simdlen, OMPSimdlenClause)
140OPENMP_CLAUSE(collapse, OMPCollapseClause)
141OPENMP_CLAUSE(default, OMPDefaultClause)
142OPENMP_CLAUSE(private, OMPPrivateClause)
143OPENMP_CLAUSE(firstprivate, OMPFirstprivateClause)
144OPENMP_CLAUSE(lastprivate, OMPLastprivateClause)
145OPENMP_CLAUSE(shared,  OMPSharedClause)
146OPENMP_CLAUSE(reduction,  OMPReductionClause)
147OPENMP_CLAUSE(linear,  OMPLinearClause)
148OPENMP_CLAUSE(aligned, OMPAlignedClause)
149OPENMP_CLAUSE(copyin,  OMPCopyinClause)
150OPENMP_CLAUSE(copyprivate,  OMPCopyprivateClause)
151OPENMP_CLAUSE(proc_bind, OMPProcBindClause)
152OPENMP_CLAUSE(schedule, OMPScheduleClause)
153OPENMP_CLAUSE(ordered, OMPOrderedClause)
154OPENMP_CLAUSE(nowait, OMPNowaitClause)
155OPENMP_CLAUSE(untied, OMPUntiedClause)
156OPENMP_CLAUSE(mergeable, OMPMergeableClause)
157OPENMP_CLAUSE(flush, OMPFlushClause)
158OPENMP_CLAUSE(read, OMPReadClause)
159OPENMP_CLAUSE(write, OMPWriteClause)
160OPENMP_CLAUSE(update, OMPUpdateClause)
161OPENMP_CLAUSE(capture, OMPCaptureClause)
162OPENMP_CLAUSE(seq_cst, OMPSeqCstClause)
163OPENMP_CLAUSE(depend, OMPDependClause)
164OPENMP_CLAUSE(device, OMPDeviceClause)
165OPENMP_CLAUSE(threads, OMPThreadsClause)
166OPENMP_CLAUSE(simd, OMPSIMDClause)
167OPENMP_CLAUSE(map, OMPMapClause)
168OPENMP_CLAUSE(num_teams, OMPNumTeamsClause)
169OPENMP_CLAUSE(thread_limit, OMPThreadLimitClause)
170OPENMP_CLAUSE(priority, OMPPriorityClause)
171OPENMP_CLAUSE(grainsize, OMPGrainsizeClause)
172OPENMP_CLAUSE(nogroup, OMPNogroupClause)
173OPENMP_CLAUSE(num_tasks, OMPNumTasksClause)
174OPENMP_CLAUSE(hint, OMPHintClause)
175
176// Clauses allowed for OpenMP directive 'parallel'.
177OPENMP_PARALLEL_CLAUSE(if)
178OPENMP_PARALLEL_CLAUSE(num_threads)
179OPENMP_PARALLEL_CLAUSE(default)
180OPENMP_PARALLEL_CLAUSE(proc_bind)
181OPENMP_PARALLEL_CLAUSE(private)
182OPENMP_PARALLEL_CLAUSE(firstprivate)
183OPENMP_PARALLEL_CLAUSE(shared)
184OPENMP_PARALLEL_CLAUSE(reduction)
185OPENMP_PARALLEL_CLAUSE(copyin)
186
187// Clauses allowed for directive 'omp simd'.
188OPENMP_SIMD_CLAUSE(private)
189OPENMP_SIMD_CLAUSE(lastprivate)
190OPENMP_SIMD_CLAUSE(linear)
191OPENMP_SIMD_CLAUSE(aligned)
192OPENMP_SIMD_CLAUSE(safelen)
193OPENMP_SIMD_CLAUSE(simdlen)
194OPENMP_SIMD_CLAUSE(collapse)
195OPENMP_SIMD_CLAUSE(reduction)
196
197// Clauses allowed for directive 'omp for'.
198OPENMP_FOR_CLAUSE(private)
199OPENMP_FOR_CLAUSE(lastprivate)
200OPENMP_FOR_CLAUSE(firstprivate)
201OPENMP_FOR_CLAUSE(reduction)
202OPENMP_FOR_CLAUSE(collapse)
203OPENMP_FOR_CLAUSE(schedule)
204OPENMP_FOR_CLAUSE(ordered)
205OPENMP_FOR_CLAUSE(nowait)
206OPENMP_FOR_CLAUSE(linear)
207
208// Clauses allowed for directive 'omp for simd'.
209OPENMP_FOR_SIMD_CLAUSE(private)
210OPENMP_FOR_SIMD_CLAUSE(firstprivate)
211OPENMP_FOR_SIMD_CLAUSE(lastprivate)
212OPENMP_FOR_SIMD_CLAUSE(reduction)
213OPENMP_FOR_SIMD_CLAUSE(schedule)
214OPENMP_FOR_SIMD_CLAUSE(collapse)
215OPENMP_FOR_SIMD_CLAUSE(nowait)
216OPENMP_FOR_SIMD_CLAUSE(safelen)
217OPENMP_FOR_SIMD_CLAUSE(simdlen)
218OPENMP_FOR_SIMD_CLAUSE(linear)
219OPENMP_FOR_SIMD_CLAUSE(aligned)
220
221// Clauses allowed for OpenMP directive 'omp sections'.
222OPENMP_SECTIONS_CLAUSE(private)
223OPENMP_SECTIONS_CLAUSE(lastprivate)
224OPENMP_SECTIONS_CLAUSE(firstprivate)
225OPENMP_SECTIONS_CLAUSE(reduction)
226OPENMP_SECTIONS_CLAUSE(nowait)
227
228// Clauses allowed for directive 'omp single'.
229OPENMP_SINGLE_CLAUSE(private)
230OPENMP_SINGLE_CLAUSE(firstprivate)
231OPENMP_SINGLE_CLAUSE(copyprivate)
232OPENMP_SINGLE_CLAUSE(nowait)
233
234// Clauses allowed for OpenMP directive 'cancel'.
235OPENMP_CANCEL_CLAUSE(if)
236
237// Static attributes for 'default' clause.
238OPENMP_DEFAULT_KIND(none)
239OPENMP_DEFAULT_KIND(shared)
240
241// Static attributes for 'proc_bind' clause.
242OPENMP_PROC_BIND_KIND(master)
243OPENMP_PROC_BIND_KIND(close)
244OPENMP_PROC_BIND_KIND(spread)
245
246// Static attributes for 'schedule' clause.
247OPENMP_SCHEDULE_KIND(static)
248OPENMP_SCHEDULE_KIND(dynamic)
249OPENMP_SCHEDULE_KIND(guided)
250OPENMP_SCHEDULE_KIND(auto)
251OPENMP_SCHEDULE_KIND(runtime)
252
253// Static attributes for 'depend' clause.
254OPENMP_DEPEND_KIND(in)
255OPENMP_DEPEND_KIND(out)
256OPENMP_DEPEND_KIND(inout)
257OPENMP_DEPEND_KIND(source)
258
259// Modifiers for 'linear' clause.
260OPENMP_LINEAR_KIND(val)
261OPENMP_LINEAR_KIND(ref)
262OPENMP_LINEAR_KIND(uval)
263
264// Clauses allowed for OpenMP directive 'parallel for'.
265OPENMP_PARALLEL_FOR_CLAUSE(if)
266OPENMP_PARALLEL_FOR_CLAUSE(num_threads)
267OPENMP_PARALLEL_FOR_CLAUSE(default)
268OPENMP_PARALLEL_FOR_CLAUSE(proc_bind)
269OPENMP_PARALLEL_FOR_CLAUSE(private)
270OPENMP_PARALLEL_FOR_CLAUSE(firstprivate)
271OPENMP_PARALLEL_FOR_CLAUSE(shared)
272OPENMP_PARALLEL_FOR_CLAUSE(reduction)
273OPENMP_PARALLEL_FOR_CLAUSE(copyin)
274OPENMP_PARALLEL_FOR_CLAUSE(lastprivate)
275OPENMP_PARALLEL_FOR_CLAUSE(collapse)
276OPENMP_PARALLEL_FOR_CLAUSE(schedule)
277OPENMP_PARALLEL_FOR_CLAUSE(ordered)
278OPENMP_PARALLEL_FOR_CLAUSE(linear)
279
280// Clauses allowed for OpenMP directive 'parallel for simd'.
281OPENMP_PARALLEL_FOR_SIMD_CLAUSE(if)
282OPENMP_PARALLEL_FOR_SIMD_CLAUSE(num_threads)
283OPENMP_PARALLEL_FOR_SIMD_CLAUSE(default)
284OPENMP_PARALLEL_FOR_SIMD_CLAUSE(proc_bind)
285OPENMP_PARALLEL_FOR_SIMD_CLAUSE(private)
286OPENMP_PARALLEL_FOR_SIMD_CLAUSE(firstprivate)
287OPENMP_PARALLEL_FOR_SIMD_CLAUSE(shared)
288OPENMP_PARALLEL_FOR_SIMD_CLAUSE(reduction)
289OPENMP_PARALLEL_FOR_SIMD_CLAUSE(copyin)
290OPENMP_PARALLEL_FOR_SIMD_CLAUSE(lastprivate)
291OPENMP_PARALLEL_FOR_SIMD_CLAUSE(collapse)
292OPENMP_PARALLEL_FOR_SIMD_CLAUSE(schedule)
293OPENMP_PARALLEL_FOR_SIMD_CLAUSE(safelen)
294OPENMP_PARALLEL_FOR_SIMD_CLAUSE(simdlen)
295OPENMP_PARALLEL_FOR_SIMD_CLAUSE(linear)
296OPENMP_PARALLEL_FOR_SIMD_CLAUSE(aligned)
297
298// Clauses allowed for OpenMP directive 'parallel sections'.
299OPENMP_PARALLEL_SECTIONS_CLAUSE(if)
300OPENMP_PARALLEL_SECTIONS_CLAUSE(num_threads)
301OPENMP_PARALLEL_SECTIONS_CLAUSE(default)
302OPENMP_PARALLEL_SECTIONS_CLAUSE(proc_bind)
303OPENMP_PARALLEL_SECTIONS_CLAUSE(private)
304OPENMP_PARALLEL_SECTIONS_CLAUSE(firstprivate)
305OPENMP_PARALLEL_SECTIONS_CLAUSE(shared)
306OPENMP_PARALLEL_SECTIONS_CLAUSE(reduction)
307OPENMP_PARALLEL_SECTIONS_CLAUSE(copyin)
308OPENMP_PARALLEL_SECTIONS_CLAUSE(lastprivate)
309
310// Clauses allowed for OpenMP directive 'task'.
311OPENMP_TASK_CLAUSE(if)
312OPENMP_TASK_CLAUSE(final)
313OPENMP_TASK_CLAUSE(default)
314OPENMP_TASK_CLAUSE(private)
315OPENMP_TASK_CLAUSE(firstprivate)
316OPENMP_TASK_CLAUSE(shared)
317OPENMP_TASK_CLAUSE(untied)
318OPENMP_TASK_CLAUSE(mergeable)
319OPENMP_TASK_CLAUSE(depend)
320OPENMP_TASK_CLAUSE(priority)
321
322// Clauses allowed for OpenMP directive 'atomic'.
323OPENMP_ATOMIC_CLAUSE(read)
324OPENMP_ATOMIC_CLAUSE(write)
325OPENMP_ATOMIC_CLAUSE(update)
326OPENMP_ATOMIC_CLAUSE(capture)
327OPENMP_ATOMIC_CLAUSE(seq_cst)
328
329// Clauses allowed for OpenMP directive 'target'.
330// TODO More clauses for 'target' directive.
331OPENMP_TARGET_CLAUSE(if)
332OPENMP_TARGET_CLAUSE(device)
333OPENMP_TARGET_CLAUSE(map)
334
335// Clauses allowed for OpenMP directive 'target data'.
336// TODO More clauses for 'target data' directive.
337OPENMP_TARGET_DATA_CLAUSE(if)
338OPENMP_TARGET_DATA_CLAUSE(device)
339OPENMP_TARGET_DATA_CLAUSE(map)
340
341// Clauses allowed for OpenMP directive 'teams'.
342// TODO More clauses for 'teams' directive.
343OPENMP_TEAMS_CLAUSE(default)
344OPENMP_TEAMS_CLAUSE(private)
345OPENMP_TEAMS_CLAUSE(firstprivate)
346OPENMP_TEAMS_CLAUSE(shared)
347OPENMP_TEAMS_CLAUSE(reduction)
348OPENMP_TEAMS_CLAUSE(num_teams)
349OPENMP_TEAMS_CLAUSE(thread_limit)
350
351// Clauses allowed for OpenMP directive 'ordered'.
352// TODO More clauses for 'ordered' directive.
353OPENMP_ORDERED_CLAUSE(threads)
354OPENMP_ORDERED_CLAUSE(simd)
355OPENMP_ORDERED_CLAUSE(depend)
356
357// Map types and map type modifier for 'map' clause.
358OPENMP_MAP_KIND(alloc)
359OPENMP_MAP_KIND(to)
360OPENMP_MAP_KIND(from)
361OPENMP_MAP_KIND(tofrom)
362OPENMP_MAP_KIND(delete)
363OPENMP_MAP_KIND(release)
364OPENMP_MAP_KIND(always)
365
366// Clauses allowed for OpenMP directive 'taskloop'.
367OPENMP_TASKLOOP_CLAUSE(if)
368OPENMP_TASKLOOP_CLAUSE(shared)
369OPENMP_TASKLOOP_CLAUSE(private)
370OPENMP_TASKLOOP_CLAUSE(firstprivate)
371OPENMP_TASKLOOP_CLAUSE(lastprivate)
372OPENMP_TASKLOOP_CLAUSE(default)
373OPENMP_TASKLOOP_CLAUSE(collapse)
374OPENMP_TASKLOOP_CLAUSE(final)
375OPENMP_TASKLOOP_CLAUSE(untied)
376OPENMP_TASKLOOP_CLAUSE(mergeable)
377OPENMP_TASKLOOP_CLAUSE(priority)
378OPENMP_TASKLOOP_CLAUSE(grainsize)
379OPENMP_TASKLOOP_CLAUSE(nogroup)
380OPENMP_TASKLOOP_CLAUSE(num_tasks)
381
382// Clauses allowed for OpenMP directive 'taskloop simd'.
383OPENMP_TASKLOOP_SIMD_CLAUSE(if)
384OPENMP_TASKLOOP_SIMD_CLAUSE(shared)
385OPENMP_TASKLOOP_SIMD_CLAUSE(private)
386OPENMP_TASKLOOP_SIMD_CLAUSE(firstprivate)
387OPENMP_TASKLOOP_SIMD_CLAUSE(lastprivate)
388OPENMP_TASKLOOP_SIMD_CLAUSE(default)
389OPENMP_TASKLOOP_SIMD_CLAUSE(collapse)
390OPENMP_TASKLOOP_SIMD_CLAUSE(final)
391OPENMP_TASKLOOP_SIMD_CLAUSE(untied)
392OPENMP_TASKLOOP_SIMD_CLAUSE(mergeable)
393OPENMP_TASKLOOP_SIMD_CLAUSE(priority)
394OPENMP_TASKLOOP_SIMD_CLAUSE(linear)
395OPENMP_TASKLOOP_SIMD_CLAUSE(aligned)
396OPENMP_TASKLOOP_SIMD_CLAUSE(safelen)
397OPENMP_TASKLOOP_SIMD_CLAUSE(simdlen)
398OPENMP_TASKLOOP_SIMD_CLAUSE(grainsize)
399OPENMP_TASKLOOP_SIMD_CLAUSE(nogroup)
400OPENMP_TASKLOOP_SIMD_CLAUSE(num_tasks)
401
402// Clauses allowed for OpenMP directive 'critical'.
403OPENMP_CRITICAL_CLAUSE(hint)
404
405// Clauses allowed for OpenMP directive 'distribute'
406OPENMP_DISTRIBUTE_CLAUSE(private)
407OPENMP_DISTRIBUTE_CLAUSE(firstprivate)
408OPENMP_DISTRIBUTE_CLAUSE(lastprivate)
409OPENMP_DISTRIBUTE_CLAUSE(collapse)
410
411#undef OPENMP_TASKLOOP_SIMD_CLAUSE
412#undef OPENMP_TASKLOOP_CLAUSE
413#undef OPENMP_LINEAR_KIND
414#undef OPENMP_DEPEND_KIND
415#undef OPENMP_SCHEDULE_KIND
416#undef OPENMP_PROC_BIND_KIND
417#undef OPENMP_DEFAULT_KIND
418#undef OPENMP_DIRECTIVE
419#undef OPENMP_DIRECTIVE_EXT
420#undef OPENMP_CLAUSE
421#undef OPENMP_CRITICAL_CLAUSE
422#undef OPENMP_ORDERED_CLAUSE
423#undef OPENMP_CANCEL_CLAUSE
424#undef OPENMP_SINGLE_CLAUSE
425#undef OPENMP_SECTIONS_CLAUSE
426#undef OPENMP_PARALLEL_CLAUSE
427#undef OPENMP_PARALLEL_FOR_CLAUSE
428#undef OPENMP_PARALLEL_FOR_SIMD_CLAUSE
429#undef OPENMP_PARALLEL_SECTIONS_CLAUSE
430#undef OPENMP_TASK_CLAUSE
431#undef OPENMP_ATOMIC_CLAUSE
432#undef OPENMP_TARGET_CLAUSE
433#undef OPENMP_TARGET_DATA_CLAUSE
434#undef OPENMP_TEAMS_CLAUSE
435#undef OPENMP_SIMD_CLAUSE
436#undef OPENMP_FOR_CLAUSE
437#undef OPENMP_FOR_SIMD_CLAUSE
438#undef OPENMP_MAP_KIND
439#undef OPENMP_DISTRIBUTE_CLAUSE
440