用戶:Bangrsun/沙盒
當前版本 | 2.5(October 2015) |
---|---|
程式語言 | C, C++, and Fortran |
作業系統 | Cross-platform |
平台 | Cross-platform |
類型 | (應用編程接口)API |
網站 | www |
OpenACC (開源加速器( Open Accelerators)的簡稱) 是一個由克雷公司,CAPS公司,英偉達公司和PGI公司共同開發的並行計算編程標準。設計這個標準的初衷是為了簡化異構計算(CPU/GPU)系統的並行編程。[1]
正如在OpenMP中那樣,程式設計師可以通過在C、C++和Fortran 原始碼中添加註釋以指明哪些代碼段需要使用編譯指令或其他函數加速。[2] 與OpenMP 4.0或其更新的版本類似,OpenACC的代碼既可以在CPU上啟動,也可以在GPU上啟動。
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.[3][4] 由於它們的努力產生了一些技術報告[5] for comment and discussion timed to include the annual Supercomputing Conference (November 2012, Salt Lake City) and to address non-Nvidia accelerator support with input from hardware vendors who participate in OpenMP.[6]
At ISC』12 OpenACC was demonstrated to work on Nvidia, AMD and Intel accelerators, without performance data.[7]
In November 12, 2012, at the SC12 conference, a draft of the OpenACC version 2.0 specification was presented.[8] New suggested capabilities include new controls over data movement (such as better handling of unstructured data 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.[9]
Version 2.5 of the specification was released in October 2015.[10]
編譯器支持
支持OpenACC的商業化編譯器有PGI(自12.6版本之後)和Cray(只支持克雷機)。[7][11]
OpenUH[12]是一個由休斯敦大學的HPCTools組開發的基於Open64開源OpenACC編譯器,它支持C語言和FORTRAN語言。
OpenARC[13]是橡樹嶺國家實驗室開發的開源C編譯器,它完全支持OpenACC 1.0 規範。accULL是由拉拉古納大學開發的實驗性的開源編譯器[14],(只支持C語言)。[15]
GCC會在不久的將來支持OpenACC[16]2013年9月,三星公司宣稱要實現面向GPU的編譯器。 this translated OpenACC 1.1-annotated code to OpenCL.[14] The announcement of a "real" implementation followed two months later, this time from NVIDIA and based on OpenACC 2.0.[17] 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.[18][19] Experimental support for OpenACC/PTX did end up in GCC as of version 5.1.[20][21]
使用
In a way similar to OpenMP 3.x on homogeneous system or the earlier OpenHMPP, the primary mode of programming in OpenACC is directives.[22] The specifications also include a runtime library defining several support functions. To exploit them, user should include "openacc.h" in C or "openacc_lib.h" in Fortran;[23] and then call acc_init() function.
指令集
OpenACC defines an extensive list of pragmas (directives),[2] 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[24][25]
#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
運行時API
There are some runtime API 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).
另請參閱
參考
- ^ Nvidia, Cray, PGI, and CAPS launch ‘OpenACC’ programming standard for parallel computing. The Inquirer. 4 November 2011.
- ^ 2.0 2.1 OpenACC standard version 2.0 (PDF). OpenACC.org. [14 January 2014].
- ^ How does the OpenACC API relate to the OpenMP API?. OpenACC.org. [14 January 2014].
- ^ How did the OpenACC specifications originate?. OpenACC.org. [14 January 2014].
- ^ The OpenMP Consortium Releases First Technical Report. OpenMP.org. 5 November 2012 [14 January 2014].
- ^ OpenMP at SC12. OpenMP.org. 29 August 2012 [14 January 2014].
- ^ 7.0 7.1 OpenACC Group Reports Expanding Support for Accelerator Programming Standard. HPCwire. 20 June 2012 [14 January 2014].
- ^ OpenACC Version 2.0 Posted for Comment. OpenACC.org. 12 November 2012 [14 January 2014].
- ^ OpenACC 2.0 Spec | www.openacc.org. www.openacc.org. [2016-03-23].
- ^ OpenACC Standards Group Announces Release of the 2.5 Specification; Member Vendors Add Support for ARM & x86 as Parallel Devices | www.openacc.org. www.openacc.org. [2016-03-22].
- ^ OpenACC Standard to Help Developers to Take Advantage of GPU Compute Accelerators. Xbit laboratories. 16 November 2011 [14 January 2014].
- ^ OpenUH Compiler. [4 March 2014].
- ^ OpenARC Compiler. [4 November 2014].
- ^ 14.0 14.1 Larabel, Michael. GCC Support Published For OpenACC On The GPU. Phoronix. 30 September 2013.
- ^ accULL The OpenACC research implementation. [14 January 2014].
- ^ Larabel, Michael. OpenACC Still Not Loved By Open Compilers. Phoronix. 4 December 2012.
- ^ Larabel, Michael. OpenACC 2.0 With GPU Support Coming To GCC. Phoronix. 14 November 2013.
- ^ Larabel, Michael. NVIDIA, Mentor Graphics May Harm GCC. Phoronix. 15 November 2013.
- ^ Larabel, Michael. In-Fighting Continues Over OpenACC In GCC. Phoronix. 21 November 2013.
- ^ https://gcc.gnu.org/wiki/OpenACC
- ^ Schwinge, Thomas. Merge current set of OpenACC changes from gomp-4_0-branch. gcc (郵件列表). gcc.gnu.org. 15 January 2015 [15 January 2015].
- ^ Easy GPU Parallelism with OpenACC. Dr.Dobb's. 11 June 2012 [14 January 2014].
- ^ OpenACC API QuickReference Card, version 1.0 (PDF). NVidia. November 2011 [14 January 2014].
- ^ OpenACC Kernels and Parallel Constructs. PGI insider. August 2012 [14 January 2014].
- ^ OpenACC parallel section VS kernels. CAPS entreprise Knowledge Base. 3 January 2013 [14 January 2014].
外部連結
[[Category:应用程序接口]] [[Category:C语言家族]] [[Category:Fortran]] [[Category:并行计算]] [[Category:标准]]