Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

OpenMP 6.0 Directive–Clause Components

This reference summarises how the ROUP parser tokenises OpenMP 6.0 clause keywords. Rather than attempting to restate the entire specification, the information below mirrors the parser’s ClauseRule data so you can quickly see which textual forms are accepted. Combined constructs (for example parallel for or target teams distribute parallel for simd) are already part of the directive keyword registry listed in the directive catalogue.

Note: The OpenMP specification defines which directives may use a given clause and any semantic restrictions. ROUP currently enforces keyword syntax and delegates the normative rules to higher layers. Consult the OpenMP 6.0 specification for the full directive–clause compatibility matrix.

Clause syntax summary

ClauseParser ruleAccepted forms
absentParenthesizedabsent(...)
acq_relBare#pragma omp parallel acq_rel
acquireBare#pragma omp parallel acquire
adjust_argsParenthesizedadjust_args(...)
affinityParenthesizedaffinity(...)
alignParenthesizedalign(...)
alignedParenthesizedaligned(...)
allocateParenthesizedallocate(...)
allocatorParenthesizedallocator(...)
append_argsParenthesizedappend_args(...)
applyParenthesizedapply(...)
atParenthesizedat(...)
atomic_default_mem_orderParenthesizedatomic_default_mem_order(...)
bindParenthesizedbind(...)
captureFlexiblecapture or capture(...)
collapseParenthesizedcollapse(...)
collectorParenthesizedcollector(...)
combinerParenthesizedcombiner(...)
compareFlexiblecompare or compare(...)
containsParenthesizedcontains(...)
copyinParenthesizedcopyin(...)
copyprivateParenthesizedcopyprivate(...)
countsParenthesizedcounts(...)
defaultParenthesizeddefault(...)
defaultmapParenthesizeddefaultmap(...)
dependParenthesizeddepend(...)
destroyFlexibledestroy or destroy(...)
detachParenthesizeddetach(...)
deviceParenthesizeddevice(...)
device_residentParenthesizeddevice_resident(...)
device_safesyncFlexibledevice_safesync or device_safesync(...)
device_typeParenthesizeddevice_type(...)
dist_scheduleParenthesizeddist_schedule(...)
doacrossParenthesizeddoacross(...)
dynamic_allocatorsBare#pragma omp parallel dynamic_allocators
enterParenthesizedenter(...)
exclusiveBare#pragma omp parallel exclusive
failFlexiblefail or fail(...)
filterParenthesizedfilter(...)
finalParenthesizedfinal(...)
firstprivateParenthesizedfirstprivate(...)
fromParenthesizedfrom(...)
fullFlexiblefull or full(...)
grainsizeParenthesizedgrainsize(...)
graph_idParenthesizedgraph_id(...)
graph_resetParenthesizedgraph_reset(...)
has_device_addrParenthesizedhas_device_addr(...)
hintParenthesizedhint(...)
holdsParenthesizedholds(...)
ifParenthesizedif(...)
in_reductionParenthesizedin_reduction(...)
inbranchBare#pragma omp parallel inbranch
inclusiveBare#pragma omp parallel inclusive
indirectFlexibleindirect or indirect(...)
inductionParenthesizedinduction(...)
inductorParenthesizedinductor(...)
initParenthesizedinit(...)
init_completeFlexibleinit_complete or init_complete(...)
initializerParenthesizedinitializer(...)
interopParenthesizedinterop(...)
is_device_ptrParenthesizedis_device_ptr(...)
labelParenthesizedlabel(...)
lastprivateParenthesizedlastprivate(...)
linearParenthesizedlinear(...)
linkParenthesizedlink(...)
localParenthesizedlocal(...)
looprangeParenthesizedlooprange(...)
mapParenthesizedmap(...)
matchParenthesizedmatch(...)
memscopeParenthesizedmemscope(...)
mergeableBare#pragma omp parallel mergeable
messageParenthesizedmessage(...)
no_openmpFlexibleno_openmp or no_openmp(...)
no_openmp_constructsFlexibleno_openmp_constructs or no_openmp_constructs(...)
no_openmp_routinesFlexibleno_openmp_routines or no_openmp_routines(...)
no_parallelismFlexibleno_parallelism or no_parallelism(...)
nocontextParenthesizednocontext(...)
nogroupBare#pragma omp parallel nogroup
nontemporalParenthesizednontemporal(...)
notinbranchBare#pragma omp parallel notinbranch
novariantsFlexiblenovariants or novariants(...)
nowaitBare#pragma omp parallel nowait
num_tasksParenthesizednum_tasks(...)
num_teamsParenthesizednum_teams(...)
num_threadsParenthesizednum_threads(...)
orderParenthesizedorder(...)
orderedFlexibleordered or ordered(...)
otherwiseParenthesizedotherwise(...)
partialFlexiblepartial or partial(...)
permutationParenthesizedpermutation(...)
priorityParenthesizedpriority(...)
privateParenthesizedprivate(...)
proc_bindParenthesizedproc_bind(...)
publicFlexiblepublic or public(...)
readFlexibleread or read(...)
reductionParenthesizedreduction(...)
relaxedBare#pragma omp parallel relaxed
releaseBare#pragma omp parallel release
replayableFlexiblereplayable or replayable(...)
reproducibleBare#pragma omp parallel reproducible
reverseFlexiblereverse or reverse(...)
reverse_offloadBare#pragma omp parallel reverse_offload
safelenParenthesizedsafelen(...)
safesyncBare#pragma omp parallel safesync
scheduleParenthesizedschedule(...)
self_mapsBare#pragma omp parallel self_maps
seq_cstBare#pragma omp parallel seq_cst
severityParenthesizedseverity(...)
sharedParenthesizedshared(...)
simdBare#pragma omp parallel simd
simdlenParenthesizedsimdlen(...)
sizesParenthesizedsizes(...)
task_reductionParenthesizedtask_reduction(...)
thread_limitParenthesizedthread_limit(...)
threadsBare#pragma omp parallel threads
threadsetParenthesizedthreadset(...)
tileParenthesizedtile(...)
toParenthesizedto(...)
transparentFlexibletransparent or transparent(...)
unified_addressFlexibleunified_address or unified_address(...)
unified_shared_memoryFlexibleunified_shared_memory or unified_shared_memory(...)
uniformParenthesizeduniform(...)
unrollFlexibleunroll or unroll(...)
untiedBare#pragma omp parallel untied
updateFlexibleupdate or update(...)
useParenthesizeduse(...)
use_device_addrParenthesizeduse_device_addr(...)
use_device_ptrParenthesizeduse_device_ptr(...)
uses_allocatorsParenthesizeduses_allocators(...)
weakFlexibleweak or weak(...)
whenParenthesizedwhen(...)
writeFlexiblewrite or write(...)

Updating this index

The table can be regenerated with the following helper if new clauses are added or the parser changes a clause rule:

python - <<'PY'
import pathlib, re
text = pathlib.Path('src/parser/openmp.rs').read_text()
block = re.search(r"openmp_clauses!\s*{(.*?)}\s*\n\nmacro_rules!", text, re.S).group(1)
clauses = []
for entry in block.split('},'):
    name_match = re.search(r'name: "([^"]+)"', entry)
    rule_match = re.search(r'rule: ClauseRule::([A-Za-z_]+)', entry)
    if name_match and rule_match:
        clauses.append((name_match.group(1), rule_match.group(1)))
for name, rule in sorted(clauses):
    if rule == 'Bare':
        forms = f"`#pragma omp parallel {name}`"
    elif rule == 'Parenthesized':
        forms = f"`{name}(...)`"
    else:
        forms = f"`{name}` or `{name}(...)`"
    print(f"| `{name}` | {rule} | {forms} |")
PY

Copy the generated rows into the table above to keep this document aligned with OpenMpClause::ALL.