Quantcast
Channel: Intel® C++ Compiler
Viewing all articles
Browse latest Browse all 1616

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

$
0
0

    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]; }

   

    See http://openmp.org and the OpenMP API Specification Version 4.0 RC2 for our current implementation of the supported features.
Changes to features since the OpenMP 4.0 RC2 spec are not yet supported.For more information, see http://software.intel.com/en-us/articles/openmp-40-features-in-intel-c-composer-xe-2013.

  • Desarrolladores
  • Estudiantes
  • Apple Mac OS X*
  • Linux*
  • Microsoft Windows* (XP, Vista, 7)
  • Microsoft Windows* 8
  • C/C++
  • Fortran
  • Intel® C++ Compiler
  • Intel® C++ Studio XE
  • Dirección URL
  • Ejemplo de código
  • Temas de compilador

  • Viewing all articles
    Browse latest Browse all 1616

    Trending Articles



    <script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>