OpenACC (The GNU Fortran Compiler) (original) (raw)


5.1.19 OpenACC

OpenACC is an application programming interface (API) that supports offloading of code to accelerator devices. It consists of a set of compiler directives, library routines, and environment variables that influence run-time behavior.

GNU Fortran strives to be compatible with theOpenACC Application Programming Interface v2.6.

To enable the processing of the OpenACC directive !$acc in free-form source code; the c$acc, *$acc and !$accdirectives in fixed form; the !$ conditional compilation sentinels in free form; and the c$, *$ and !$sentinels in fixed form, gfortran needs to be invoked with the -fopenacc option. This option also arranges for automatic linking of the OpenACC runtime library. See GNU Offloading and Multi Processing Runtime Library.

The OpenACC Fortran runtime library routines are provided both in a form of a Fortran 90 module named openacc and in a form of a Fortran include file named openacc_lib.h.

See OpenMP and OpenACC Options in Using the GNU Compiler Collection (GCC), for additional options useful with-fopenacc.