Intel® C++ Compiler 16.0 User and Reference Guide

OpenMP* Pragmas Summary

This is a summary of the OpenMP* pragmas and clauses supported in the Intel® C++ Compiler. For detailed information about the OpenMP*API, see the OpenMP Application Program Interface Versions 4.0 and 4.5 specifications, which are available from the OpenMP* web site.

PARALLEL Pragma

Use this pragma to form a team of threads and execute those threads in parallel.

Pragma

Description

omp parallel

Specifies that a structured block should be run in parallel by a team of threads.

TASKING Pragma

Use this pragma for deferring execution.

Pragma

Description

omp task

Specifies the beginning of a code block whose execution may be deferred.

WORKSHARING Pragmas

Use these pragmas to share work among a team of threads.

Pragma

Description

omp for

Specifies a parallel loop. Each iteration of the loop is executed by one of the threads in the team.

omp sections

Defines a region of structured blocks that will be distributed among the threads in a team.

omp single

Specifies a structured block that will be executed only once by a single thread in the team.

SYNCHRONIZATION Pragmas

Use these pragmas to synchronize between threads.

Pragma

Description

omp atomic

Specifies a computation that must be executed atomically.

omp barrier

Specifies a point in the code where each thread must wait until all threads in the team arrive.

omp critical

Specifies a code block that is restricted to access by only one thread at a time.

omp flush

Identifies a point at which the view of the memory by the thread becomes consistent with the memory.

omp master

Specifies the beginning of a code block that must be executed only once by the master thread of the team.

omp ordered

Specifies the beginning of a code block that must be executed only once by the master thread of the team.

omp taskgroup

Causes the program to wait until the completion of all enclosed and descendant tasks.

omp taskwait

Specifies a wait on the completion of child tasks generated since the beginning of the current task.

omp taskyield

Specifies that the current task can be suspended at this point, in favor of execution of a different task.

Data Environment Pragma

Use this pragma to give threads global private data.

Pragma

Description

omp threadprivate

Specifies a list of globally-visible variables that will be allocated private to each thread.

Coprocessor Control Pragmas

Use these pragmas to control execution on one or more coprocessors.

Pragma

Description

omp declare target

Specifies functions and variables that are created or mapped to a device. This pragma only applies to Intel® Many Integrated Core Architecture (Intel® MIC Architecture) and Intel® Graphics Technology.

omp distribute

Specifies that the iterations of one of more loops should be shared among the master threads of all thread teams in a league.

omp target

Creates a device data environment and then executes the construct on that device. This pragma only applies to Intel® MIC Architecture and Intel® Graphics Technology.

omp target data

Creates a device data environment by making a mapping of variables from the host to the target device. This pragma only applies to Intel® MIC Architecture.

omp target update

Makes the items listed in the device data environment consistent between the device and host, in accordance with the motion clauses on the pragma. This pragma only applies to Intel® MIC Architecture.

omp teams

Creates a league of thread teams to execute the structured block in the master thread of each team.

Vectorization Pragmas

Use these pragmas to control execution on vector hardware.

Pragma

Description

omp simd

Transforms the loop into a loop that will be executed concurrently using Single Instruction Multiple Data (SIMD) instructions.

omp declare simd

Creates a version of a function that can process multiple arguments using Single Instruction Multiple Data (SIMD) instructions from a single invocation from a SIMD loop.

Cancellation Constructs

Pragma

Description

omp cancel

Requests cancellation of the innermost enclosing region of the type specified, and causes the encountering task to proceed to the end of the cancelled construct.

omp cancellation point

Defines a point at which implicit or explicit tasks check to see if cancellation has been requested for the innermost enclosing region of the type specified. This construct does not implement a synchronization between threads or tasks.

User-Defined Reduction Pragma

Use this pragma to define reduction identifiers that can be used as reduction operators in a reduction clause.

Pragma

Description

omp declare reduction

Declares User-Defined Reduction (UDR) functions (reduction identifiers) that can be used as reduction operators in a reduction clause.

Combined Pragmas

Use these pragmas as shortcuts for multiple pragmas in sequence.

Pragma

Description

omp distribute parallel for

Specifies a loop that can be executed in parallel by multiple threads that are members of multiple teams.

omp distribute parallel for simd

Specifies a loop that will be executed in parallel by multiple threads that are members of multiple teams. It will be executed concurrently using SIMD instructions.

omp distribute simd

Specifies a loop that will be distributed across the master threads of the teams region. It will be executed concurrently using SIMD instructions.

omp for simd

Specifies the beginning of a loop that can be executed concurrently using Single Instruction Multiple Data (SIMD) instructions. Each iteration of the loop is executed by one of the threads in the team.

omp parallel for

Specifies a parallel construct containing one or more associated loops.

omp parallel for simd

Specifies a parallel region that contains a loop to execute with Single Instruction Multiple Data (SIMD) instructions.

omp parallel sections

Specifies a parallel construct that contains a single sections construct.

omp target teams

Creates a device data environment and executes the construct on the same device. It also creates a league of thread teams with the master thread in each team execution the structured block.This pragma only applies to Intel® MIC Architecture.

omp target teams distribute

Creates a device data environment and then executes the construct on that device. It also specifies that loop iterations will be shared among the master threads of all thread teams in a league created by a teams construct. This pragma only applies to Intel® MIC Architecture.

omp target teams distribute parallel for

Creates a device data environment and then executes the construct on that device. It also specifies a loop that can be executed in parallel by multiple threads that are members of multiple teams created by a teams construct. This pragma only applies to Intel® MIC Architecture.

omp target teams distribute parallel for simd

Creates a device data environment and then executes the construct on that device. It also specifies a loop that can be executed in parallel by multiple threads that are members of multiple teams created by a teams construct. The loop will be distributed across the teams, which will be executed concurrently using SIMD instructions. This pragma only applies to Intel® MIC Architecture.

omp target teams distribute simd

Creates a device data environment and then executes the construct on that device. It also specifies that loop iterations will be shared among the master threads of all thread teams in a league created by a teams construct. It will be executed concurrently using SIMD instructions. This pragma only applies to Intel® MIC Architecture.

omp teams distribute

Creates a league of thread teams to execute the structured block in the master thread of each team. It also specifies that loop iterations will be shared among the master threads of all thread teams in a league created by a teams construct.

omp teams distribute parallel for

Creates a league of thread teams to execute a structured block in the master thread of each team. It also specifies a loop that can be executed in parallel by multiple threads that are members of multiple teams.

omp teams distribute parallel for simd

Creates a league of thread teams to execute a structured block in the master thread of each team. It also specifies a loop that can be executed in parallel by multiple threads that are members of multiple teams. The loop will be distributed across the master threads of the teams region, which will be executed concurrently using SIMD instructions.

omp teams distribute simd

Creates a league of thread teams to execute the structured block in the master thread of each team. It also specifies a loop that will be distributed across the master threads of the teams.