OpenMP API V4.5 support
IBM® XL C/C++ for Linux, V13.1.6 partially supports the OpenMP Application Program Interface Version 4.5 specification. The XL C/C++ implementation is based on IBM's interpretation of the OpenMP Application Program Interface 4.5.
The new OpenMP Application Program Interface Version 4.5 support
falls into the following categories:
New directives
In addition to the existing OpenMP directives, IBM XL C/C++ for Linux, V13.1.6 adds support for the following directives and their clauses.- omp simd
- The omp simd directive is applied to a loop to indicate that multiple iterations of the loop can be executed concurrently by using SIMD instructions.
- omp for simd
- The omp for simd directive distributes the iterations of one or more associated loops across the threads that already exist in the team and indicates that the iterations executed by each thread can be executed concurrently using SIMD instructions.
- omp distribute simd
- The omp distribute simd directive distributes loop iterations to each master thread and then executes each set of distributed iterations concurrently by using SIMD instructions.
- omp distribute parallel for simd
- The omp distribute parallel for simd directive distributes loop iterations to each master thread, further redistributes those iterations among the threads of each team, and then applies SIMD vectorization to each iteration.
The following combined
constructs are
also supported.
- omp parallel for simd
- omp target simd
- omp target parallel for simd
- omp target teams distribute simd
- omp target teams distribute parallel for simd
- omp teams distribute simd
- omp teams distribute parallel for simd
Expanded functionality for existing directives
The following directives have been updated with functionality for additional clauses in IBM XL C/C++ for Linux, V13.1.6.- omp ordered
- The depend clause is now supported on the omp ordered directive. You can use the omp ordered depend(source) or omp ordered depend(sink : vec) to specify the order in which threads in a team execute ordered regions.
- omp target
- The depend, is_device_ptr, and nowait clauses
are now supported on the omp target directive.
- omp target depend(dependence-type:list) establishes scheduling dependences between the target task and sibling tasks that share list items.
- omp target is_device_ptr(list) indicates that the data variables in list are device pointers that exist within the device data environment.
- omp target nowait eliminates the implicit barrier so the parent task can make progress even if the target task is not yet completed.
- The reduction clause
is supported by the combined constructs that consist of omp
target,
such as omp target parallel for or omp target teams distribute parallel for.
- reduction(reduction-identifier:list) specifies that for each data variable in list, a private copy is created and initialized based on the reduction-identifier. At the end of the region, the original data variable is updated with the values of the private copies using a combiner based on the reduction-identifier.
- omp target data
- The use_device_ptr clause is now supported on the omp target data directive. You can use omp target data use_device_ptr(list) to update the pointer variables in list with the address of their corresponding variables in the target device data environment.
- omp target enter data
- The depend and nowait clauses are
now supported on the omp target enter
data directive.
- omp target enter data depend(dependence-type:list) establishes scheduling dependences between the target task and sibling tasks that share list items.
- omp target enter data nowait enables the target enter data construct to perform asynchronously with respect to the encountering thread.
- omp target exit data
- The depend and nowait clauses are
now supported on the omp target exit
data directive.
- omp target exit data depend(dependence-type:list) establishes scheduling dependences between the target task and sibling tasks that share list items.
- omp target exit data nowait enables the target exit data construct to perform asynchronously with respect to the encountering thread.
- omp target update
- The depend and nowait clauses are
now supported on the omp target update directive.
- omp target update depend(dependence-type:list) establishes scheduling dependences between the target task and sibling tasks that share list items.
- omp target update nowait enables the target update construct to execute asynchronously with respect to the encountering thread.
- omp task
- The depend clause is now supported on the omp task directive. You can use the omp task depend(dependence-type:list) to establish scheduling dependences between sibling tasks that share list items.
Updated clauses
- ordered_clause
- The n parameter allows you to specify the number of the loops that are associated with the loop construct. ordered_clause is supported on the omp for and omp for simd directives.
Enhanced built-in functions
- omp_target_alloc
- The device address returned by omp_target_alloc can be used in a is_device_ptr clause on the omp target directive.