跳转到内容

用户:Bangrsun/沙盒

维基百科,自由的百科全书
OpenACC
当前版本2.5(October 2015)
编程语言C, C++, and Fortran
操作系统Cross-platform
平台Cross-platform
类型(应用编程接口)API
网站www.openacc.org

OpenACC (开源加速器( Open Accelerators)的简称) 是一个由克雷公司,CAPS公司,英伟达公司和PGI公司共同开发的并行计算编程标准。设计这个标准的初衷是为了简化异构计算CPU/GPU)系统的并行编程。[1]

正如在OpenMP中那样,程序员可以通过在CC++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).

另请参阅

[编辑]

参考

[编辑]
  1. ^ Nvidia, Cray, PGI, and CAPS launch ‘OpenACC’ programming standard for parallel computing. The Inquirer. 4 November 2011. 
  2. ^ 2.0 2.1 OpenACC standard version 2.0 (PDF). OpenACC.org. [14 January 2014]. 
  3. ^ How does the OpenACC API relate to the OpenMP API?. OpenACC.org. [14 January 2014]. 
  4. ^ How did the OpenACC specifications originate?. OpenACC.org. [14 January 2014]. 
  5. ^ The OpenMP Consortium Releases First Technical Report. OpenMP.org. 5 November 2012 [14 January 2014]. 
  6. ^ OpenMP at SC12. OpenMP.org. 29 August 2012 [14 January 2014]. 
  7. ^ 7.0 7.1 OpenACC Group Reports Expanding Support for Accelerator Programming Standard. HPCwire. 20 June 2012 [14 January 2014]. 
  8. ^ OpenACC Version 2.0 Posted for Comment. OpenACC.org. 12 November 2012 [14 January 2014]. 
  9. ^ OpenACC 2.0 Spec | www.openacc.org. www.openacc.org. [2016-03-23]. 
  10. ^ 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]. 
  11. ^ OpenACC Standard to Help Developers to Take Advantage of GPU Compute Accelerators. Xbit laboratories. 16 November 2011 [14 January 2014]. 
  12. ^ OpenUH Compiler. [4 March 2014]. 
  13. ^ OpenARC Compiler. [4 November 2014]. 
  14. ^ 14.0 14.1 Larabel, Michael. GCC Support Published For OpenACC On The GPU. Phoronix. 30 September 2013. 
  15. ^ accULL The OpenACC research implementation. [14 January 2014]. 
  16. ^ Larabel, Michael. OpenACC Still Not Loved By Open Compilers. Phoronix. 4 December 2012. 
  17. ^ Larabel, Michael. OpenACC 2.0 With GPU Support Coming To GCC. Phoronix. 14 November 2013. 
  18. ^ Larabel, Michael. NVIDIA, Mentor Graphics May Harm GCC. Phoronix. 15 November 2013. 
  19. ^ Larabel, Michael. In-Fighting Continues Over OpenACC In GCC. Phoronix. 21 November 2013. 
  20. ^ https://gcc.gnu.org/wiki/OpenACC
  21. ^ Schwinge, Thomas. Merge current set of OpenACC changes from gomp-4_0-branch. gcc (邮件列表). gcc.gnu.org. 15 January 2015 [15 January 2015]. 
  22. ^ Easy GPU Parallelism with OpenACC. Dr.Dobb's. 11 June 2012 [14 January 2014]. 
  23. ^ OpenACC API QuickReference Card, version 1.0 (PDF). NVidia. November 2011 [14 January 2014]. 
  24. ^ OpenACC Kernels and Parallel Constructs. PGI insider. August 2012 [14 January 2014]. 
  25. ^ OpenACC parallel section VS kernels. CAPS entreprise Knowledge Base. 3 January 2013 [14 January 2014]. 

外部链接

[编辑]

[[Category:应用程序接口]] [[Category:C语言家族]] [[Category:Fortran]] [[Category:并行计算]] [[Category:标准]]