OpenMP ARB releases OpenMP 5.1 with vital usability enhancements


13 Nov 2020 Austin - The OpenMP Architecture Review Board (ARB) has released Version 5.1 of the OpenMP API. With this release of the standard, OpenMP strengthens its handling of accelerator devices, allows improved optimization and supports the latest versions of C, C++ and Fortran.

"OpenMP 5.1 represents the culmination of the past two years of work within the OpenMP Language Committee", stated Bronis R. de Supinski, the LC Chair. “While the primary focus has been enhancements, clarifications and corrections to the 5.0 specification, we have added several useful new features, such as support for interoperability with lower level APIs like CUDA and HIP."

Version 5.1 of the OpenMP specification was jointly developed by the OpenMP ARB, a group of major computer hardware and software vendors, as well as users throughout the OpenMP community. The updated specification includes the following key additions:

1. Improvements in accelerator device interactions:

  • The interop construct, which enables interoperability with non-OpenMP device execution contexts, provides support for interactions with native device interfaces (e.g., for CUDA streams, HIP or OpenCL);
  • Function pointers can now be mapped to a device or accelerator; and
  • Device-specific environment variables have been added.

2. Providing more information to the compiler to allow improved optimization:

  • The assume directive gives the implementation additional information about the way a programme uses OpenMP, which allows additional optimizations to be safely applied by compilers, or safe OpenMP subsets to be implemented; and
  • Loop transformation directives have been introduced, starting with the tile directive, which can improve data locality, and the unroll directive, which fully or partially unrolls a loop.

3. Filtering of execution by thread

  • The masked directive can restrict execution of a code region to a subset of the threads.

4. Allowing the user to generate compile-time errors and warnings:

  • A new error directive has been added.

5. Improvements in modern C++ usage of OpenMP:

  • Instead of the traditional pragma form, C++ attribute syntax can be used to specify OpenMP directives, which simplifies their integration with templates; and
  • Full support for C11, C18, C++11, C++14, C++17 and C++20: Programmes written in these languages can now be parallelized with OpenMP.

6. Improvements in the support for Fortran:

  • Fortran 2008 is now fully supported and initial support for Fortran 2018 has been added.

7. Easier declaration of environment-specific functions:

  • Multiple functions can now be included in a single declare variant construct, and code can be more closely tailored to a specific environment.

Major vendors and open source compilers have implemented parts of the OpenMP 5 specification in their products. LLVM, GCC, AMD, Intel, HPE, NVIDIA, Mentor Graphics to name just a few. In addition, debugging and performance tools are being extended with OpenMP 5 features. More details on compilers and tools can be found on the OpenMP website.

You can follow the latest OpenMP developments and news by subscribing to the OpenMP newsletter.
Source: OpenMP