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_TEAMS_CLAUSE 61# define OPENMP_TEAMS_CLAUSE(Name) 62#endif 63#ifndef OPENMP_DEFAULT_KIND 64# define OPENMP_DEFAULT_KIND(Name) 65#endif 66#ifndef OPENMP_PROC_BIND_KIND 67# define OPENMP_PROC_BIND_KIND(Name) 68#endif 69#ifndef OPENMP_SCHEDULE_KIND 70#define OPENMP_SCHEDULE_KIND(Name) 71#endif 72 73// OpenMP directives. 74OPENMP_DIRECTIVE(threadprivate) 75OPENMP_DIRECTIVE(parallel) 76OPENMP_DIRECTIVE(task) 77OPENMP_DIRECTIVE(simd) 78OPENMP_DIRECTIVE(for) 79OPENMP_DIRECTIVE(sections) 80OPENMP_DIRECTIVE(section) 81OPENMP_DIRECTIVE(single) 82OPENMP_DIRECTIVE(master) 83OPENMP_DIRECTIVE(critical) 84OPENMP_DIRECTIVE(taskyield) 85OPENMP_DIRECTIVE(barrier) 86OPENMP_DIRECTIVE(taskwait) 87OPENMP_DIRECTIVE(flush) 88OPENMP_DIRECTIVE(ordered) 89OPENMP_DIRECTIVE(atomic) 90OPENMP_DIRECTIVE(target) 91OPENMP_DIRECTIVE(teams) 92OPENMP_DIRECTIVE_EXT(parallel_for, "parallel for") 93OPENMP_DIRECTIVE_EXT(parallel_for_simd, "parallel for simd") 94OPENMP_DIRECTIVE_EXT(parallel_sections, "parallel sections") 95OPENMP_DIRECTIVE_EXT(for_simd, "for simd") 96 97// OpenMP clauses. 98OPENMP_CLAUSE(if, OMPIfClause) 99OPENMP_CLAUSE(final, OMPFinalClause) 100OPENMP_CLAUSE(num_threads, OMPNumThreadsClause) 101OPENMP_CLAUSE(safelen, OMPSafelenClause) 102OPENMP_CLAUSE(collapse, OMPCollapseClause) 103OPENMP_CLAUSE(default, OMPDefaultClause) 104OPENMP_CLAUSE(private, OMPPrivateClause) 105OPENMP_CLAUSE(firstprivate, OMPFirstprivateClause) 106OPENMP_CLAUSE(lastprivate, OMPLastprivateClause) 107OPENMP_CLAUSE(shared, OMPSharedClause) 108OPENMP_CLAUSE(reduction, OMPReductionClause) 109OPENMP_CLAUSE(linear, OMPLinearClause) 110OPENMP_CLAUSE(aligned, OMPAlignedClause) 111OPENMP_CLAUSE(copyin, OMPCopyinClause) 112OPENMP_CLAUSE(copyprivate, OMPCopyprivateClause) 113OPENMP_CLAUSE(proc_bind, OMPProcBindClause) 114OPENMP_CLAUSE(schedule, OMPScheduleClause) 115OPENMP_CLAUSE(ordered, OMPOrderedClause) 116OPENMP_CLAUSE(nowait, OMPNowaitClause) 117OPENMP_CLAUSE(untied, OMPUntiedClause) 118OPENMP_CLAUSE(mergeable, OMPMergeableClause) 119OPENMP_CLAUSE(flush, OMPFlushClause) 120OPENMP_CLAUSE(read, OMPReadClause) 121OPENMP_CLAUSE(write, OMPWriteClause) 122OPENMP_CLAUSE(update, OMPUpdateClause) 123OPENMP_CLAUSE(capture, OMPCaptureClause) 124OPENMP_CLAUSE(seq_cst, OMPSeqCstClause) 125 126// Clauses allowed for OpenMP directive 'parallel'. 127OPENMP_PARALLEL_CLAUSE(if) 128OPENMP_PARALLEL_CLAUSE(num_threads) 129OPENMP_PARALLEL_CLAUSE(default) 130OPENMP_PARALLEL_CLAUSE(proc_bind) 131OPENMP_PARALLEL_CLAUSE(private) 132OPENMP_PARALLEL_CLAUSE(firstprivate) 133OPENMP_PARALLEL_CLAUSE(shared) 134OPENMP_PARALLEL_CLAUSE(reduction) 135OPENMP_PARALLEL_CLAUSE(copyin) 136 137// Clauses allowed for directive 'omp simd'. 138OPENMP_SIMD_CLAUSE(private) 139OPENMP_SIMD_CLAUSE(lastprivate) 140OPENMP_SIMD_CLAUSE(linear) 141OPENMP_SIMD_CLAUSE(aligned) 142OPENMP_SIMD_CLAUSE(safelen) 143OPENMP_SIMD_CLAUSE(collapse) 144OPENMP_SIMD_CLAUSE(reduction) 145 146// Clauses allowed for directive 'omp for'. 147OPENMP_FOR_CLAUSE(private) 148OPENMP_FOR_CLAUSE(lastprivate) 149OPENMP_FOR_CLAUSE(firstprivate) 150OPENMP_FOR_CLAUSE(reduction) 151OPENMP_FOR_CLAUSE(collapse) 152OPENMP_FOR_CLAUSE(schedule) 153OPENMP_FOR_CLAUSE(ordered) 154OPENMP_FOR_CLAUSE(nowait) 155 156// Clauses allowed for directive 'omp for simd'. 157OPENMP_FOR_SIMD_CLAUSE(private) 158OPENMP_FOR_SIMD_CLAUSE(firstprivate) 159OPENMP_FOR_SIMD_CLAUSE(lastprivate) 160OPENMP_FOR_SIMD_CLAUSE(reduction) 161OPENMP_FOR_SIMD_CLAUSE(schedule) 162OPENMP_FOR_SIMD_CLAUSE(collapse) 163OPENMP_FOR_SIMD_CLAUSE(nowait) 164OPENMP_FOR_SIMD_CLAUSE(safelen) 165OPENMP_FOR_SIMD_CLAUSE(linear) 166OPENMP_FOR_SIMD_CLAUSE(aligned) 167 168// Clauses allowed for OpenMP directive 'omp sections'. 169OPENMP_SECTIONS_CLAUSE(private) 170OPENMP_SECTIONS_CLAUSE(lastprivate) 171OPENMP_SECTIONS_CLAUSE(firstprivate) 172OPENMP_SECTIONS_CLAUSE(reduction) 173OPENMP_SECTIONS_CLAUSE(nowait) 174 175// Clauses allowed for directive 'omp single'. 176OPENMP_SINGLE_CLAUSE(private) 177OPENMP_SINGLE_CLAUSE(firstprivate) 178OPENMP_SINGLE_CLAUSE(copyprivate) 179OPENMP_SINGLE_CLAUSE(nowait) 180 181// Static attributes for 'default' clause. 182OPENMP_DEFAULT_KIND(none) 183OPENMP_DEFAULT_KIND(shared) 184 185// Static attributes for 'proc_bind' clause. 186OPENMP_PROC_BIND_KIND(master) 187OPENMP_PROC_BIND_KIND(close) 188OPENMP_PROC_BIND_KIND(spread) 189 190// Static attributes for 'schedule' clause. 191OPENMP_SCHEDULE_KIND(static) 192OPENMP_SCHEDULE_KIND(dynamic) 193OPENMP_SCHEDULE_KIND(guided) 194OPENMP_SCHEDULE_KIND(auto) 195OPENMP_SCHEDULE_KIND(runtime) 196 197// Clauses allowed for OpenMP directive 'parallel for'. 198OPENMP_PARALLEL_FOR_CLAUSE(if) 199OPENMP_PARALLEL_FOR_CLAUSE(num_threads) 200OPENMP_PARALLEL_FOR_CLAUSE(default) 201OPENMP_PARALLEL_FOR_CLAUSE(proc_bind) 202OPENMP_PARALLEL_FOR_CLAUSE(private) 203OPENMP_PARALLEL_FOR_CLAUSE(firstprivate) 204OPENMP_PARALLEL_FOR_CLAUSE(shared) 205OPENMP_PARALLEL_FOR_CLAUSE(reduction) 206OPENMP_PARALLEL_FOR_CLAUSE(copyin) 207OPENMP_PARALLEL_FOR_CLAUSE(lastprivate) 208OPENMP_PARALLEL_FOR_CLAUSE(collapse) 209OPENMP_PARALLEL_FOR_CLAUSE(schedule) 210OPENMP_PARALLEL_FOR_CLAUSE(ordered) 211 212// Clauses allowed for OpenMP directive 'parallel for simd'. 213OPENMP_PARALLEL_FOR_SIMD_CLAUSE(if) 214OPENMP_PARALLEL_FOR_SIMD_CLAUSE(num_threads) 215OPENMP_PARALLEL_FOR_SIMD_CLAUSE(default) 216OPENMP_PARALLEL_FOR_SIMD_CLAUSE(proc_bind) 217OPENMP_PARALLEL_FOR_SIMD_CLAUSE(private) 218OPENMP_PARALLEL_FOR_SIMD_CLAUSE(firstprivate) 219OPENMP_PARALLEL_FOR_SIMD_CLAUSE(shared) 220OPENMP_PARALLEL_FOR_SIMD_CLAUSE(reduction) 221OPENMP_PARALLEL_FOR_SIMD_CLAUSE(copyin) 222OPENMP_PARALLEL_FOR_SIMD_CLAUSE(lastprivate) 223OPENMP_PARALLEL_FOR_SIMD_CLAUSE(collapse) 224OPENMP_PARALLEL_FOR_SIMD_CLAUSE(schedule) 225OPENMP_PARALLEL_FOR_SIMD_CLAUSE(safelen) 226OPENMP_PARALLEL_FOR_SIMD_CLAUSE(linear) 227OPENMP_PARALLEL_FOR_SIMD_CLAUSE(aligned) 228 229// Clauses allowed for OpenMP directive 'parallel sections'. 230OPENMP_PARALLEL_SECTIONS_CLAUSE(if) 231OPENMP_PARALLEL_SECTIONS_CLAUSE(num_threads) 232OPENMP_PARALLEL_SECTIONS_CLAUSE(default) 233OPENMP_PARALLEL_SECTIONS_CLAUSE(proc_bind) 234OPENMP_PARALLEL_SECTIONS_CLAUSE(private) 235OPENMP_PARALLEL_SECTIONS_CLAUSE(firstprivate) 236OPENMP_PARALLEL_SECTIONS_CLAUSE(shared) 237OPENMP_PARALLEL_SECTIONS_CLAUSE(reduction) 238OPENMP_PARALLEL_SECTIONS_CLAUSE(copyin) 239OPENMP_PARALLEL_SECTIONS_CLAUSE(lastprivate) 240 241// Clauses allowed for OpenMP directive 'task'. 242OPENMP_TASK_CLAUSE(if) 243OPENMP_TASK_CLAUSE(final) 244OPENMP_TASK_CLAUSE(default) 245OPENMP_TASK_CLAUSE(private) 246OPENMP_TASK_CLAUSE(firstprivate) 247OPENMP_TASK_CLAUSE(shared) 248OPENMP_TASK_CLAUSE(untied) 249OPENMP_TASK_CLAUSE(mergeable) 250 251// Clauses allowed for OpenMP directive 'atomic'. 252OPENMP_ATOMIC_CLAUSE(read) 253OPENMP_ATOMIC_CLAUSE(write) 254OPENMP_ATOMIC_CLAUSE(update) 255OPENMP_ATOMIC_CLAUSE(capture) 256OPENMP_ATOMIC_CLAUSE(seq_cst) 257 258// Clauses allowed for OpenMP directive 'target'. 259// TODO More clauses for 'target' directive. 260OPENMP_TARGET_CLAUSE(if) 261 262// Clauses allowed for OpenMP directive 'teams'. 263// TODO More clauses for 'teams' directive. 264OPENMP_TEAMS_CLAUSE(default) 265OPENMP_TEAMS_CLAUSE(private) 266OPENMP_TEAMS_CLAUSE(firstprivate) 267OPENMP_TEAMS_CLAUSE(shared) 268OPENMP_TEAMS_CLAUSE(reduction) 269 270#undef OPENMP_SCHEDULE_KIND 271#undef OPENMP_PROC_BIND_KIND 272#undef OPENMP_DEFAULT_KIND 273#undef OPENMP_DIRECTIVE 274#undef OPENMP_DIRECTIVE_EXT 275#undef OPENMP_CLAUSE 276#undef OPENMP_SINGLE_CLAUSE 277#undef OPENMP_SECTIONS_CLAUSE 278#undef OPENMP_PARALLEL_CLAUSE 279#undef OPENMP_PARALLEL_FOR_CLAUSE 280#undef OPENMP_PARALLEL_FOR_SIMD_CLAUSE 281#undef OPENMP_PARALLEL_SECTIONS_CLAUSE 282#undef OPENMP_TASK_CLAUSE 283#undef OPENMP_ATOMIC_CLAUSE 284#undef OPENMP_TARGET_CLAUSE 285#undef OPENMP_TEAMS_CLAUSE 286#undef OPENMP_SIMD_CLAUSE 287#undef OPENMP_FOR_CLAUSE 288#undef OPENMP_FOR_SIMD_CLAUSE 289 290