Updated Support for OpenMP* 4.0 features added in Composer XE 2013 SP1

Published:10/31/2013   Last Updated:10/31/2013

[Updated based on the version of update 2 of 2013 SP1]

   Composer XE 2013 SP1 adds partial support for OpenMP* 4.0 features. The features supported as defined in the OpenMP* 4.0 specifications available from http://openmp.org are:

    1.New directives to enable vectorization and offloading of execution to attached devices (i.e., coprocessors or accelerators) for C++ and Fortran

Syntax : –[no-]openmp-offload and –[no-]openmp-simd :

Description : These two options allow you to enable/disable the TARGET and SIMD features of OpenMP* 4.0 independently of support of the rest of OpenMP* (enabled with –openmp). When –openmp is specified, -openmp-offload and –openmp-simd are set as well, allowing the use of these features.

    2.TARGET Constructs enable creation of a data environment for attached devices, movement of data between host and devices, and execution of constructs on devices

Syntax : #pragma omp target [clause[, clause, ...]]

Description : The pragma creates a device data environment and then executes the computation in the structured block on the device, using the device data environment. The encountering task waits for the computation to complete on the device before it proceeds. When an if(scalar-expression) evaluates to false, the structured block is executed on the host.

Examples : The following example demonstrates how to use this pragma to create a device data environment and then execute the structured block on the device
#pragma omp target map(double dist, double x1, double y1, double x2, double y2)
  dist = sqrt((x2 – x1)**2  + (y2 – y1)**2 );

    3.SIMD Constructs enable loops and functions to be executed concurrently by a thread team using SIMD vector instructions

Syntax : #pragma omp simd [clause[, clause ...]]

Description : The simd construct enables the execution of multiple iterations of the associated loops concurrently by means of SIMD instructions. The integer used in the collapse clause indicates how many loops are associated with the simd construct. If the nocollapse clause is present, then only the immediately following loop is associated. No intervening code or OpenMP constructs may appear between the for-loops.

Examples : The following example demonstrates how to use this directive to create two loops with SIMD instructions:
.#pragma omp simd collapse(2)
for(i=0; i<N; i++) { a[i] = b[i] * c[i]; }
for(i=0; i<N; i++) { d[i] = e[i] * f[i]; }

    4.Other Updated Support for Upcoming OpenMP* features added in Composer XE 2013 SP1 :

--- TEAMS pragmas, directives and clauses
---  DISTRIBUTE pragmas, directive and clauses
---  SIMD pragmas, directives, and clauses
---  TARGET pragmas, directives and clauses for attached coprocessors (or devices)
---  #pragma omp taskgroup construct

---  Atomic clause seq_cst
---  Six new forms of atomic capture and update:
          o Atomic swap: {v = x; x = expr;}
          o Atomic update: x = expr binop x;
          o Atomic capture 1: v = x = x binop expr;
          o Atomic capture 2: v =x = expr binop x;
          o Atomic capture 3: {x = expr binop x; v = x;}
          o Atomic capture 4: {v = x; x = expr binop x;}
---  proc_bind(<type>) clause where <type> is “spread”, “close”, or “master”
---  OMP_PLACES environment variable
---  OMP_PROC_BIND environment variable
---  omp_get_proc_bind() API

For more information, see http://intel.ly/W7CHjb.

Product and Performance Information


Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.