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 to the OpenACC Application Programming Interface v2.0.
To enable the processing of the OpenACC directive
free-form source code; the
directives in fixed form; the
!$ conditional compilation
sentinels in free form; and the
sentinels in fixed form,
gfortran needs to be invoked with
the -fopenacc. This also arranges for automatic linking of
the GNU Offloading and Multi Processing Runtime Library
libgomp in GNU Offloading and Multi Processing Runtime
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
include file named openacc_lib.h.
Note that this is an experimental feature, incomplete, and subject to change in future versions of GCC. See https://gcc.gnu.org/wiki/OpenACC for more information.