OpenACC 2
   HOME

TheInfoList



OR:

OpenACC (for ''open accelerators'') is a programming standard for
parallel computing Parallel computing is a type of computing, computation in which many calculations or Process (computing), processes are carried out simultaneously. Large problems can often be divided into smaller ones, which can then be solved at the same time. ...
developed by
Cray Cray Inc., a subsidiary of Hewlett Packard Enterprise, is an American supercomputer manufacturer headquartered in Seattle, Washington. It also manufactures systems for data storage and analytics. Several Cray supercomputer systems are listed ...
, CAPS,
Nvidia Nvidia Corporation ( ) is an American multinational corporation and technology company headquartered in Santa Clara, California, and incorporated in Delaware. Founded in 1993 by Jensen Huang (president and CEO), Chris Malachowsky, and Curti ...
and PGI. The standard is designed to simplify parallel programming of
heterogeneous Homogeneity and heterogeneity are concepts relating to the uniformity of a substance, process or image. A homogeneous feature is uniform in composition or character (i.e., color, shape, size, weight, height, distribution, texture, language, i ...
CPU A central processing unit (CPU), also called a central processor, main processor, or just processor, is the primary processor in a given computer. Its electronic circuitry executes instructions of a computer program, such as arithmetic, log ...
/
GPU A graphics processing unit (GPU) is a specialized electronic circuit designed for digital image processing and to accelerate computer graphics, being present either as a discrete video card or embedded on motherboards, mobile phones, personal ...
systems. As in
OpenMP OpenMP is an application programming interface (API) that supports multi-platform shared-memory multiprocessing programming in C, C++, and Fortran, on many platforms, instruction-set architectures and operating systems, including Solaris, ...
, the programmer can annotate C,
C++ C++ (, pronounced "C plus plus" and sometimes abbreviated as CPP or CXX) is a high-level, general-purpose programming language created by Danish computer scientist Bjarne Stroustrup. First released in 1985 as an extension of the C programmin ...
and Fortran
source code In computing, source code, or simply code or source, is a plain text computer program written in a programming language. A programmer writes the human readable source code to control the behavior of a computer. Since a computer, at base, only ...
to identify the areas that should be accelerated using
compiler directives In computer programming, a directive or pragma (from "pragmatic") is a language construct that specifies how a compiler (or other Translator (computing), translator) should process its input. Depending on the programming language, directives may o ...
and additional functions. Like OpenMP 4.0 and newer, OpenACC can target both the
CPU A central processing unit (CPU), also called a central processor, main processor, or just processor, is the primary processor in a given computer. Its electronic circuitry executes instructions of a computer program, such as arithmetic, log ...
and
GPU A graphics processing unit (GPU) is a specialized electronic circuit designed for digital image processing and to accelerate computer graphics, being present either as a discrete video card or embedded on motherboards, mobile phones, personal ...
architectures and launch computational code on them. OpenACC members have worked as members of the OpenMP standard group to merge into OpenMP specification to create a common specification which extends OpenMP to support accelerators in a future release of OpenMP. These efforts resulted in a technical report for comment and discussion timed to include the annual
Supercomputing Conference SC (formerly Supercomputing), the International Conference for High Performance Computing, Networking, Storage and Analysis, is the annual conference established in 1988 by the Association for Computing Machinery and the IEEE Computer Society. I ...
(November 2012,
Salt Lake City Salt Lake City, often shortened to Salt Lake or SLC, is the capital and most populous city of the U.S. state of Utah. It is the county seat of Salt Lake County, the most populous county in the state. The city is the core of the Salt Lake Ci ...
) and to address non-Nvidia accelerator support with input from hardware vendors who participate in OpenMP. At ISC’12 OpenACC was demonstrated to work on
Nvidia Nvidia Corporation ( ) is an American multinational corporation and technology company headquartered in Santa Clara, California, and incorporated in Delaware. Founded in 1993 by Jensen Huang (president and CEO), Chris Malachowsky, and Curti ...
,
AMD Advanced Micro Devices, Inc. (AMD) is an American multinational corporation and technology company headquartered in Santa Clara, California and maintains significant operations in Austin, Texas. AMD is a hardware and fabless company that de ...
and
Intel Intel Corporation is an American multinational corporation and technology company headquartered in Santa Clara, California, and Delaware General Corporation Law, incorporated in Delaware. Intel designs, manufactures, and sells computer compo ...
accelerators, without performance data. On November 12, 2012, at the SC12 conference, a draft of the OpenACC version 2.0 specification was presented. New suggested capabilities include new controls over data movement (such as better handling of
unstructured data Unstructured data (or unstructured information) is information that either does not have a pre-defined data model or is not organized in a pre-defined manner. Unstructured information is typically plain text, text-heavy, but may contain data such ...
and improvements in support for non-contiguous memory), and support for explicit function calls and separate compilation (allowing the creation and reuse of libraries of accelerated code). OpenACC 2.0 was officially released in June 2013. Version 2.5 of the specification was released in October 2015, while version 2.6 was released in November 2017. Subsequently, version 2.7 was released in November 2018. The latest version is version 3.3, which was released in November 2022.


Compiler support

Support of OpenACC is available in commercial compilers from PGI (from version 12.6), and (for Cray hardware only) Cray. OpenUH is an
Open64 Open64 is a free, open-source, optimizing compiler for the Itanium and x86-64 microprocessor architectures. It derives from the SGI compilers for the MIPS R10000 processor, called ''MIPSPro''. It was initially released in 2000 as GNU GPL softwa ...
based open source OpenACC compiler supporting C and FORTRAN, developed by HPCTools group from
University of Houston The University of Houston (; ) is a Public university, public research university in Houston, Texas, United States. It was established in 1927 as Houston Junior College, a coeducational institution and one of multiple junior colleges formed in ...
. OpenARC is an open source C compiler developed at
Oak Ridge National Laboratory Oak Ridge National Laboratory (ORNL) is a federally funded research and development centers, federally funded research and development center in Oak Ridge, Tennessee, United States. Founded in 1943, the laboratory is sponsored by the United Sta ...
to support all features in the OpenACC 1.0 specification. An experimental open source compiler, accULL, is developed by the
University of La Laguna The University of La Laguna (ULL; Spanish: ''Universidad de La Laguna'') is a public research university situated in San Cristóbal de La Laguna, on the island of Tenerife, Spain. It is the oldest university in the Canary Islands. The univers ...
(
C language C (''pronounced'' '' – like the letter c'') is a general-purpose programming language. It was created in the 1970s by Dennis Ritchie and remains very widely used and influential. By design, C's features cleanly reflect the capabilities o ...
only). Omni Compiler is an open source compiler developed at HPCS Laboratory. of
University of Tsukuba is a List of national universities in Japan, national research university located in Tsukuba, Ibaraki Prefecture, Ibaraki, Japan. The university has 28 college clusters and schools with around 16,500 students (as of 2014). The main Tsukuba ca ...
and Programming Environment Research Team of
RIKEN is a national scientific research institute in Japan. Founded in 1917, it now has about 3,000 scientists on seven campuses across Japan, including the main site at Wakō, Saitama, Wakō, Saitama Prefecture, on the outskirts of Tokyo. Riken is a ...
Center for Computational Science, Japan, supported OpenACC, and combining XcalableMP and OpenACC. IPMACC is an open source C compiler developed by
University of Victoria The University of Victoria (UVic) is a public research university located in the municipalities of Oak Bay, British Columbia, Oak Bay and Saanich, British Columbia, Canada. Established in 1903 as Victoria College, British Columbia, Victoria Col ...
that translates OpenACC to CUDA, OpenCL, and ISPC. Currently, only following directives are supported: ''data'', ''kernels'', ''loop'', and ''cache''. GCC support for OpenACC was slow in coming. A GPU-targeting implementation from Samsung was announced in September 2013; this translated OpenACC 1.1-annotated code to
OpenCL OpenCL (Open Computing Language) is a software framework, framework for writing programs that execute across heterogeneous computing, heterogeneous platforms consisting of central processing units (CPUs), graphics processing units (GPUs), di ...
. The announcement of a "real" implementation followed two months later, this time from NVIDIA and based on OpenACC 2.0. This sparked some controversy, as the implementation would only target NVIDIA's own PTX assembly language, for which no open source assembler or runtime was available. Experimental support for OpenACC/PTX did end up in GCC as of version 5.1. GCC6 and GCC7 release series include a much improved implementation of the OpenACC 2.0a specification. GCC 9.1 offers nearly complete OpenACC 2.5 support.


Usage

In a way similar to
OpenMP OpenMP is an application programming interface (API) that supports multi-platform shared-memory multiprocessing programming in C, C++, and Fortran, on many platforms, instruction-set architectures and operating systems, including Solaris, ...
3.x on homogeneous system or the earlier
OpenHMPP OpenHMPP (HMPP for Hybrid Multicore Parallel Programming) - programming standard for heterogeneous computing. Based on a set of compiler directives, standard is a programming model designed to handle hardware accelerators without the complexity a ...
, the primary mode of programming in OpenACC is directives. The specifications also include a
runtime library A runtime library is a library that provides access to the runtime environment that is available to a computer program tailored to the host platform. A runtime environment implements the execution model as required for a development environme ...
defining several support functions. To exploit them, user should include "openacc.h" in C or "openacc_lib.h" in Fortran; and then call ''acc_init()'' function.


Directives

OpenACC defines an extensive list of pragmas (directives), for example: #pragma acc parallel #pragma acc kernels Both are used to define parallel computation kernels to be executed on the accelerator, using distinct semantics #pragma acc data Is the main directive to define and copy data to and from the accelerator. #pragma acc loop Is used to define the type of parallelism in a parallel or kernels region. #pragma acc cache #pragma acc update #pragma acc declare #pragma acc wait


Runtime API

There are some runtime
API An application programming interface (API) is a connection between computers or between computer programs. It is a type of software interface, offering a service to other pieces of software. A document or standard that describes how to build ...
functions defined too: acc_get_num_devices(), acc_set_device_type(), acc_get_device_type(), acc_set_device_num(), acc_get_device_num(), acc_async_test(), acc_async_test_all(), acc_async_wait(), acc_async_wait_all(), acc_init(), acc_shutdown(), acc_on_device(), acc_malloc(), acc_free(). OpenACC generally takes care of work organisation for the target device however this can be overridden through the use of gangs and workers. A gang consists of workers and operates over a number of processing elements (as with a workgroup in OpenCL).


See also

*
C++ AMP C, or c, is the third letter of the Latin alphabet, used in the modern English alphabet, the alphabets of other western European languages and others worldwide. Its name in English is ''cee'' (pronounced ), plural ''cees''. History "C ...
*
OpenCL OpenCL (Open Computing Language) is a software framework, framework for writing programs that execute across heterogeneous computing, heterogeneous platforms consisting of central processing units (CPUs), graphics processing units (GPUs), di ...
*
OpenHMPP OpenHMPP (HMPP for Hybrid Multicore Parallel Programming) - programming standard for heterogeneous computing. Based on a set of compiler directives, standard is a programming model designed to handle hardware accelerators without the complexity a ...
*
OpenMP OpenMP is an application programming interface (API) that supports multi-platform shared-memory multiprocessing programming in C, C++, and Fortran, on many platforms, instruction-set architectures and operating systems, including Solaris, ...
* *


References


External links


Homepage , OpenACC
* Usage example from Nvidia
part 1part 2

OpenACC-standard.org: ''OpenACC Programming and Best Practices Guide'' (June, 2015)

Nvidia: ''PGI Compilers & Tools OpenACC Getting Started Guide''(2018).

Stéphane Ethier: ''Introduction to GPU programming with OpenACC'', Research Computing Bootcamp (November 1st, 2019)

OpenACC-standard.org: ''OpenACC A Complete Guide'' (May, 2021)

Olga Abramkina, Rémy Dubois, Thibaut Véry: ''OpenACC for GPU: an introduction'' (Jun,02, 2023)
{{Parallel Computing Application programming interfaces C programming language family Fortran Parallel computing Standards