1 //===--- OpenMPKinds.def - OpenMP directives and clauses list ---*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 /// \brief This file defines the list of supported OpenMP directives and
13 //===----------------------------------------------------------------------===//
15 #ifndef OPENMP_DIRECTIVE
16 # define OPENMP_DIRECTIVE(Name)
18 #ifndef OPENMP_DIRECTIVE_EXT
19 #define OPENMP_DIRECTIVE_EXT(Name, Str)
22 # define OPENMP_CLAUSE(Name, Class)
24 #ifndef OPENMP_PARALLEL_CLAUSE
25 # define OPENMP_PARALLEL_CLAUSE(Name)
27 #ifndef OPENMP_SIMD_CLAUSE
28 # define OPENMP_SIMD_CLAUSE(Name)
30 #ifndef OPENMP_FOR_CLAUSE
31 # define OPENMP_FOR_CLAUSE(Name)
33 #ifndef OPENMP_FOR_SIMD_CLAUSE
34 # define OPENMP_FOR_SIMD_CLAUSE(Name)
36 #ifndef OPENMP_SECTIONS_CLAUSE
37 # define OPENMP_SECTIONS_CLAUSE(Name)
39 #ifndef OPENMP_SINGLE_CLAUSE
40 # define OPENMP_SINGLE_CLAUSE(Name)
42 #ifndef OPENMP_PARALLEL_FOR_CLAUSE
43 # define OPENMP_PARALLEL_FOR_CLAUSE(Name)
45 #ifndef OPENMP_PARALLEL_FOR_SIMD_CLAUSE
46 # define OPENMP_PARALLEL_FOR_SIMD_CLAUSE(Name)
48 #ifndef OPENMP_PARALLEL_SECTIONS_CLAUSE
49 # define OPENMP_PARALLEL_SECTIONS_CLAUSE(Name)
51 #ifndef OPENMP_TASK_CLAUSE
52 # define OPENMP_TASK_CLAUSE(Name)
54 #ifndef OPENMP_ATOMIC_CLAUSE
55 # define OPENMP_ATOMIC_CLAUSE(Name)
57 #ifndef OPENMP_TARGET_CLAUSE
58 # define OPENMP_TARGET_CLAUSE(Name)
60 #ifndef OPENMP_TEAMS_CLAUSE
61 # define OPENMP_TEAMS_CLAUSE(Name)
63 #ifndef OPENMP_DEFAULT_KIND
64 # define OPENMP_DEFAULT_KIND(Name)
66 #ifndef OPENMP_PROC_BIND_KIND
67 # define OPENMP_PROC_BIND_KIND(Name)
69 #ifndef OPENMP_SCHEDULE_KIND
70 #define OPENMP_SCHEDULE_KIND(Name)
72 #ifndef OPENMP_DEPEND_KIND
73 #define OPENMP_DEPEND_KIND(Name)
77 OPENMP_DIRECTIVE(threadprivate)
78 OPENMP_DIRECTIVE(parallel)
79 OPENMP_DIRECTIVE(task)
80 OPENMP_DIRECTIVE(simd)
82 OPENMP_DIRECTIVE(sections)
83 OPENMP_DIRECTIVE(section)
84 OPENMP_DIRECTIVE(single)
85 OPENMP_DIRECTIVE(master)
86 OPENMP_DIRECTIVE(critical)
87 OPENMP_DIRECTIVE(taskyield)
88 OPENMP_DIRECTIVE(barrier)
89 OPENMP_DIRECTIVE(taskwait)
90 OPENMP_DIRECTIVE(taskgroup)
91 OPENMP_DIRECTIVE(flush)
92 OPENMP_DIRECTIVE(ordered)
93 OPENMP_DIRECTIVE(atomic)
94 OPENMP_DIRECTIVE(target)
95 OPENMP_DIRECTIVE(teams)
96 OPENMP_DIRECTIVE(cancel)
97 OPENMP_DIRECTIVE_EXT(parallel_for, "parallel for")
98 OPENMP_DIRECTIVE_EXT(parallel_for_simd, "parallel for simd")
99 OPENMP_DIRECTIVE_EXT(parallel_sections, "parallel sections")
100 OPENMP_DIRECTIVE_EXT(for_simd, "for simd")
101 OPENMP_DIRECTIVE_EXT(cancellation_point, "cancellation point")
104 OPENMP_CLAUSE(if, OMPIfClause)
105 OPENMP_CLAUSE(final, OMPFinalClause)
106 OPENMP_CLAUSE(num_threads, OMPNumThreadsClause)
107 OPENMP_CLAUSE(safelen, OMPSafelenClause)
108 OPENMP_CLAUSE(collapse, OMPCollapseClause)
109 OPENMP_CLAUSE(default, OMPDefaultClause)
110 OPENMP_CLAUSE(private, OMPPrivateClause)
111 OPENMP_CLAUSE(firstprivate, OMPFirstprivateClause)
112 OPENMP_CLAUSE(lastprivate, OMPLastprivateClause)
113 OPENMP_CLAUSE(shared, OMPSharedClause)
114 OPENMP_CLAUSE(reduction, OMPReductionClause)
115 OPENMP_CLAUSE(linear, OMPLinearClause)
116 OPENMP_CLAUSE(aligned, OMPAlignedClause)
117 OPENMP_CLAUSE(copyin, OMPCopyinClause)
118 OPENMP_CLAUSE(copyprivate, OMPCopyprivateClause)
119 OPENMP_CLAUSE(proc_bind, OMPProcBindClause)
120 OPENMP_CLAUSE(schedule, OMPScheduleClause)
121 OPENMP_CLAUSE(ordered, OMPOrderedClause)
122 OPENMP_CLAUSE(nowait, OMPNowaitClause)
123 OPENMP_CLAUSE(untied, OMPUntiedClause)
124 OPENMP_CLAUSE(mergeable, OMPMergeableClause)
125 OPENMP_CLAUSE(flush, OMPFlushClause)
126 OPENMP_CLAUSE(read, OMPReadClause)
127 OPENMP_CLAUSE(write, OMPWriteClause)
128 OPENMP_CLAUSE(update, OMPUpdateClause)
129 OPENMP_CLAUSE(capture, OMPCaptureClause)
130 OPENMP_CLAUSE(seq_cst, OMPSeqCstClause)
131 OPENMP_CLAUSE(depend, OMPDependClause)
133 // Clauses allowed for OpenMP directive 'parallel'.
134 OPENMP_PARALLEL_CLAUSE(if)
135 OPENMP_PARALLEL_CLAUSE(num_threads)
136 OPENMP_PARALLEL_CLAUSE(default)
137 OPENMP_PARALLEL_CLAUSE(proc_bind)
138 OPENMP_PARALLEL_CLAUSE(private)
139 OPENMP_PARALLEL_CLAUSE(firstprivate)
140 OPENMP_PARALLEL_CLAUSE(shared)
141 OPENMP_PARALLEL_CLAUSE(reduction)
142 OPENMP_PARALLEL_CLAUSE(copyin)
144 // Clauses allowed for directive 'omp simd'.
145 OPENMP_SIMD_CLAUSE(private)
146 OPENMP_SIMD_CLAUSE(lastprivate)
147 OPENMP_SIMD_CLAUSE(linear)
148 OPENMP_SIMD_CLAUSE(aligned)
149 OPENMP_SIMD_CLAUSE(safelen)
150 OPENMP_SIMD_CLAUSE(collapse)
151 OPENMP_SIMD_CLAUSE(reduction)
153 // Clauses allowed for directive 'omp for'.
154 OPENMP_FOR_CLAUSE(private)
155 OPENMP_FOR_CLAUSE(lastprivate)
156 OPENMP_FOR_CLAUSE(firstprivate)
157 OPENMP_FOR_CLAUSE(reduction)
158 OPENMP_FOR_CLAUSE(collapse)
159 OPENMP_FOR_CLAUSE(schedule)
160 OPENMP_FOR_CLAUSE(ordered)
161 OPENMP_FOR_CLAUSE(nowait)
163 // Clauses allowed for directive 'omp for simd'.
164 OPENMP_FOR_SIMD_CLAUSE(private)
165 OPENMP_FOR_SIMD_CLAUSE(firstprivate)
166 OPENMP_FOR_SIMD_CLAUSE(lastprivate)
167 OPENMP_FOR_SIMD_CLAUSE(reduction)
168 OPENMP_FOR_SIMD_CLAUSE(schedule)
169 OPENMP_FOR_SIMD_CLAUSE(collapse)
170 OPENMP_FOR_SIMD_CLAUSE(nowait)
171 OPENMP_FOR_SIMD_CLAUSE(safelen)
172 OPENMP_FOR_SIMD_CLAUSE(linear)
173 OPENMP_FOR_SIMD_CLAUSE(aligned)
175 // Clauses allowed for OpenMP directive 'omp sections'.
176 OPENMP_SECTIONS_CLAUSE(private)
177 OPENMP_SECTIONS_CLAUSE(lastprivate)
178 OPENMP_SECTIONS_CLAUSE(firstprivate)
179 OPENMP_SECTIONS_CLAUSE(reduction)
180 OPENMP_SECTIONS_CLAUSE(nowait)
182 // Clauses allowed for directive 'omp single'.
183 OPENMP_SINGLE_CLAUSE(private)
184 OPENMP_SINGLE_CLAUSE(firstprivate)
185 OPENMP_SINGLE_CLAUSE(copyprivate)
186 OPENMP_SINGLE_CLAUSE(nowait)
188 // Static attributes for 'default' clause.
189 OPENMP_DEFAULT_KIND(none)
190 OPENMP_DEFAULT_KIND(shared)
192 // Static attributes for 'proc_bind' clause.
193 OPENMP_PROC_BIND_KIND(master)
194 OPENMP_PROC_BIND_KIND(close)
195 OPENMP_PROC_BIND_KIND(spread)
197 // Static attributes for 'schedule' clause.
198 OPENMP_SCHEDULE_KIND(static)
199 OPENMP_SCHEDULE_KIND(dynamic)
200 OPENMP_SCHEDULE_KIND(guided)
201 OPENMP_SCHEDULE_KIND(auto)
202 OPENMP_SCHEDULE_KIND(runtime)
204 // Static attributes for 'depend' clause.
205 OPENMP_DEPEND_KIND(in)
206 OPENMP_DEPEND_KIND(out)
207 OPENMP_DEPEND_KIND(inout)
209 // Clauses allowed for OpenMP directive 'parallel for'.
210 OPENMP_PARALLEL_FOR_CLAUSE(if)
211 OPENMP_PARALLEL_FOR_CLAUSE(num_threads)
212 OPENMP_PARALLEL_FOR_CLAUSE(default)
213 OPENMP_PARALLEL_FOR_CLAUSE(proc_bind)
214 OPENMP_PARALLEL_FOR_CLAUSE(private)
215 OPENMP_PARALLEL_FOR_CLAUSE(firstprivate)
216 OPENMP_PARALLEL_FOR_CLAUSE(shared)
217 OPENMP_PARALLEL_FOR_CLAUSE(reduction)
218 OPENMP_PARALLEL_FOR_CLAUSE(copyin)
219 OPENMP_PARALLEL_FOR_CLAUSE(lastprivate)
220 OPENMP_PARALLEL_FOR_CLAUSE(collapse)
221 OPENMP_PARALLEL_FOR_CLAUSE(schedule)
222 OPENMP_PARALLEL_FOR_CLAUSE(ordered)
224 // Clauses allowed for OpenMP directive 'parallel for simd'.
225 OPENMP_PARALLEL_FOR_SIMD_CLAUSE(if)
226 OPENMP_PARALLEL_FOR_SIMD_CLAUSE(num_threads)
227 OPENMP_PARALLEL_FOR_SIMD_CLAUSE(default)
228 OPENMP_PARALLEL_FOR_SIMD_CLAUSE(proc_bind)
229 OPENMP_PARALLEL_FOR_SIMD_CLAUSE(private)
230 OPENMP_PARALLEL_FOR_SIMD_CLAUSE(firstprivate)
231 OPENMP_PARALLEL_FOR_SIMD_CLAUSE(shared)
232 OPENMP_PARALLEL_FOR_SIMD_CLAUSE(reduction)
233 OPENMP_PARALLEL_FOR_SIMD_CLAUSE(copyin)
234 OPENMP_PARALLEL_FOR_SIMD_CLAUSE(lastprivate)
235 OPENMP_PARALLEL_FOR_SIMD_CLAUSE(collapse)
236 OPENMP_PARALLEL_FOR_SIMD_CLAUSE(schedule)
237 OPENMP_PARALLEL_FOR_SIMD_CLAUSE(safelen)
238 OPENMP_PARALLEL_FOR_SIMD_CLAUSE(linear)
239 OPENMP_PARALLEL_FOR_SIMD_CLAUSE(aligned)
241 // Clauses allowed for OpenMP directive 'parallel sections'.
242 OPENMP_PARALLEL_SECTIONS_CLAUSE(if)
243 OPENMP_PARALLEL_SECTIONS_CLAUSE(num_threads)
244 OPENMP_PARALLEL_SECTIONS_CLAUSE(default)
245 OPENMP_PARALLEL_SECTIONS_CLAUSE(proc_bind)
246 OPENMP_PARALLEL_SECTIONS_CLAUSE(private)
247 OPENMP_PARALLEL_SECTIONS_CLAUSE(firstprivate)
248 OPENMP_PARALLEL_SECTIONS_CLAUSE(shared)
249 OPENMP_PARALLEL_SECTIONS_CLAUSE(reduction)
250 OPENMP_PARALLEL_SECTIONS_CLAUSE(copyin)
251 OPENMP_PARALLEL_SECTIONS_CLAUSE(lastprivate)
253 // Clauses allowed for OpenMP directive 'task'.
254 OPENMP_TASK_CLAUSE(if)
255 OPENMP_TASK_CLAUSE(final)
256 OPENMP_TASK_CLAUSE(default)
257 OPENMP_TASK_CLAUSE(private)
258 OPENMP_TASK_CLAUSE(firstprivate)
259 OPENMP_TASK_CLAUSE(shared)
260 OPENMP_TASK_CLAUSE(untied)
261 OPENMP_TASK_CLAUSE(mergeable)
262 OPENMP_TASK_CLAUSE(depend)
264 // Clauses allowed for OpenMP directive 'atomic'.
265 OPENMP_ATOMIC_CLAUSE(read)
266 OPENMP_ATOMIC_CLAUSE(write)
267 OPENMP_ATOMIC_CLAUSE(update)
268 OPENMP_ATOMIC_CLAUSE(capture)
269 OPENMP_ATOMIC_CLAUSE(seq_cst)
271 // Clauses allowed for OpenMP directive 'target'.
272 // TODO More clauses for 'target' directive.
273 OPENMP_TARGET_CLAUSE(if)
275 // Clauses allowed for OpenMP directive 'teams'.
276 // TODO More clauses for 'teams' directive.
277 OPENMP_TEAMS_CLAUSE(default)
278 OPENMP_TEAMS_CLAUSE(private)
279 OPENMP_TEAMS_CLAUSE(firstprivate)
280 OPENMP_TEAMS_CLAUSE(shared)
281 OPENMP_TEAMS_CLAUSE(reduction)
283 #undef OPENMP_DEPEND_KIND
284 #undef OPENMP_SCHEDULE_KIND
285 #undef OPENMP_PROC_BIND_KIND
286 #undef OPENMP_DEFAULT_KIND
287 #undef OPENMP_DIRECTIVE
288 #undef OPENMP_DIRECTIVE_EXT
290 #undef OPENMP_SINGLE_CLAUSE
291 #undef OPENMP_SECTIONS_CLAUSE
292 #undef OPENMP_PARALLEL_CLAUSE
293 #undef OPENMP_PARALLEL_FOR_CLAUSE
294 #undef OPENMP_PARALLEL_FOR_SIMD_CLAUSE
295 #undef OPENMP_PARALLEL_SECTIONS_CLAUSE
296 #undef OPENMP_TASK_CLAUSE
297 #undef OPENMP_ATOMIC_CLAUSE
298 #undef OPENMP_TARGET_CLAUSE
299 #undef OPENMP_TEAMS_CLAUSE
300 #undef OPENMP_SIMD_CLAUSE
301 #undef OPENMP_FOR_CLAUSE
302 #undef OPENMP_FOR_SIMD_CLAUSE