From 0c5178ff5207bf1ede83070629c7d76fbbdf1afb Mon Sep 17 00:00:00 2001 From: tschwinge Date: Wed, 5 Nov 2014 16:12:51 +0000 Subject: [PATCH] OpenACC documentation updates. gcc/ * invoke.texi: Update for OpenACC. * sourcebuild.texi: Likewise. gcc/fortran/ * gfortran.texi: Update for OpenACC. * intrinsic.texi: Likewise. * invoke.texi: Likewise. libgomp/ * libgomp.texi: Update for OpenACC. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gomp-4_0-branch@217142 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog.gomp | 3 +++ gcc/doc/invoke.texi | 4 ++-- gcc/doc/sourcebuild.texi | 2 +- gcc/fortran/ChangeLog.gomp | 6 ++++++ gcc/fortran/gfortran.texi | 38 ++++++++++++++++++++++++++++++++++---- gcc/fortran/intrinsic.texi | 31 ++++++++++++++++++++++++++++++- gcc/fortran/invoke.texi | 7 ++++++- libgomp/ChangeLog.gomp | 2 ++ libgomp/libgomp.texi | 10 ++++++---- 9 files changed, 90 insertions(+), 13 deletions(-) diff --git a/gcc/ChangeLog.gomp b/gcc/ChangeLog.gomp index 5b2bade7fea..fc624c80ad3 100644 --- a/gcc/ChangeLog.gomp +++ b/gcc/ChangeLog.gomp @@ -1,5 +1,8 @@ 2014-11-05 Thomas Schwinge + * invoke.texi: Update for OpenACC. + * sourcebuild.texi: Likewise. + * tree.def (OACC_WAIT): Remove. Update all users. * omp-builtins.def (BUILT_IN_OMP_SET_NUM_THREADS): Remove. diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 4cd4f4aff1d..0fe875b1adc 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -1872,8 +1872,8 @@ freestanding and hosted environments. @item -fopenacc @opindex fopenacc @cindex OpenACC accelerator programming -Enable handling of OpenACC directives @code{#pragma acc} in C. -When @option{-fopenacc} is specified, the +Enable handling of OpenACC directives @code{#pragma acc} in C/C++ and +@code{!$acc} in Fortran. When @option{-fopenacc} is specified, the compiler generates accelerated code according to the OpenACC Application Programming Interface v2.0 @w{@uref{http://www.openacc.org/}}. This option implies @option{-pthread}, and thus is only supported on targets that diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi index 5d1625dade6..d27fac04b4d 100644 --- a/gcc/doc/sourcebuild.texi +++ b/gcc/doc/sourcebuild.texi @@ -89,7 +89,7 @@ The Go runtime library. The bulk of this library is mirrored from the @uref{http://code.google.com/@/p/@/go/, master Go repository}. @item libgomp -The GNU OpenMP runtime library. +The GNU OpenACC and OpenMP runtime library. @item libiberty The @code{libiberty} library, used for portability and for some diff --git a/gcc/fortran/ChangeLog.gomp b/gcc/fortran/ChangeLog.gomp index 5f2e9ba8410..98e3971b13f 100644 --- a/gcc/fortran/ChangeLog.gomp +++ b/gcc/fortran/ChangeLog.gomp @@ -1,3 +1,9 @@ +2014-11-05 Thomas Schwinge + + * gfortran.texi: Update for OpenACC. + * intrinsic.texi: Likewise. + * invoke.texi: Likewise. + 2014-11-04 Cesar Philippidis * gfortran.h (ST_OACC_ROUTINE): New statement enum. diff --git a/gcc/fortran/gfortran.texi b/gcc/fortran/gfortran.texi index 41d6559fab0..c3e75183a31 100644 --- a/gcc/fortran/gfortran.texi +++ b/gcc/fortran/gfortran.texi @@ -474,7 +474,8 @@ The GNU Fortran compiler is able to compile nearly all standard-compliant Fortran 95, Fortran 90, and Fortran 77 programs, including a number of standard and non-standard extensions, and can be used on real-world programs. In particular, the supported extensions -include OpenMP, Cray-style pointers, and several Fortran 2003 and Fortran +include OpenACC, OpenMP, Cray-style pointers, and several Fortran 2003 +and Fortran 2008 features, including TR 15581. However, it is still under development and has a few remaining rough edges. @@ -531,7 +532,8 @@ The current status of the support is can be found in the @ref{Fortran 2003 status}, @ref{Fortran 2008 status} and @ref{TS 29113 status} sections of the documentation. -Additionally, the GNU Fortran compilers supports the OpenMP specification +Additionally, the GNU Fortran compilers supports the OpenACC specification +(version 2.0, @url{http://www.openacc.org/}), and OpenMP specification (version 4.0, @url{http://openmp.org/@/wp/@/openmp-specifications/}). @node Varying Length Character Strings @@ -963,7 +965,8 @@ module. @cindex statement, @code{ISO_FORTRAN_ENV} @code{USE} statement with @code{INTRINSIC} and @code{NON_INTRINSIC} attribute; supported intrinsic modules: @code{ISO_FORTRAN_ENV}, -@code{ISO_C_BINDING}, @code{OMP_LIB} and @code{OMP_LIB_KINDS}. +@code{ISO_C_BINDING}, @code{OMP_LIB} and @code{OMP_LIB_KINDS}, +and @code{OPENACC}. @item Renaming of operators in the @code{USE} statement. @@ -1358,6 +1361,7 @@ without warning. * Hollerith constants support:: * Cray pointers:: * CONVERT specifier:: +* OpenACC:: * OpenMP:: * Argument list functions:: @end menu @@ -1873,6 +1877,32 @@ carries a significant speed overhead. If speed in this area matters to you, it is best if you use this only for data that needs to be portable. +@node OpenACC +@subsection OpenACC +@cindex 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 to the +@uref{http://www.openacc.org/, OpenACC Application Programming +Interface v2.0}. + +To enable the processing of the OpenACC directive @code{!$acc} in +free-form source code; the @code{c$acc}, @code{*$acc} and @code{!$acc} +directives in fixed form; the @code{!$} conditional compilation +sentinels in free form; and the @code{c$}, @code{*$} and @code{!$} +sentinels in fixed form, @command{gfortran} needs to be invoked with +the @option{-fopenacc}. This also arranges for automatic linking of +the GNU OpenACC runtime library @ref{Top,,libgomp,libgomp,GNU OpenACC +and OpenMP runtime library}. + +The OpenACC Fortran runtime library routines are provided both in a +form of a Fortran 90 module named @code{openacc} and in a form of a +Fortran @code{include} file named @file{openacc_lib.h}. + @node OpenMP @subsection OpenMP @cindex OpenMP @@ -1894,7 +1924,7 @@ directives in fixed form; the @code{!$} conditional compilation sentinels in free form; and the @code{c$}, @code{*$} and @code{!$} sentinels in fixed form, @command{gfortran} needs to be invoked with the @option{-fopenmp}. This also arranges for automatic linking of the -GNU OpenMP runtime library @ref{Top,,libgomp,libgomp,GNU OpenMP +GNU OpenMP runtime library @ref{Top,,libgomp,libgomp,GNU OpenACC and OpenMP runtime library}. The OpenMP Fortran runtime library routines are provided both in a diff --git a/gcc/fortran/intrinsic.texi b/gcc/fortran/intrinsic.texi index 90c9a3aaf46..fdaf0446928 100644 --- a/gcc/fortran/intrinsic.texi +++ b/gcc/fortran/intrinsic.texi @@ -13773,6 +13773,7 @@ Fortran 95 elemental function: @ref{IEOR} * ISO_FORTRAN_ENV:: * ISO_C_BINDING:: * IEEE modules:: +* OpenACC Module OPENACC:: * OpenMP Modules OMP_LIB and OMP_LIB_KINDS:: @end menu @@ -14018,6 +14019,33 @@ with the following options: @code{-fno-unsafe-math-optimizations -frounding-math -fsignaling-nans}. + +@node OpenACC Module OPENACC +@section OpenACC Module @code{OPENACC} +@table @asis +@item @emph{Standard}: +OpenACC Application Programming Interface v2.0 +@end table + + +The OpenACC Fortran runtime library routines are provided both in a +form of a Fortran 90 module, named @code{OPENACC}, and in form of a +Fortran @code{include} file named @file{openacc_lib.h}. The +procedures provided by @code{OPENACC} can be found in the +@ref{Top,,Introduction,libgomp,GNU OpenACC and OpenMP runtime library} +manual, the named constants defined in the modules are listed below. + +For details refer to the actual +@uref{http://www.openacc.org/, +OpenACC Application Programming Interface v2.0}. + +@code{OPENACC} provides the scalar default-integer +named constant @code{openacc_version} with a value of the form +@var{yyyymm}, where @code{yyyy} is the year and @var{mm} the month +of the OpenACC version; for OpenACC v2.0 the value is @code{201306}. + + + @node OpenMP Modules OMP_LIB and OMP_LIB_KINDS @section OpenMP Modules @code{OMP_LIB} and @code{OMP_LIB_KINDS} @table @asis @@ -14030,7 +14058,8 @@ The OpenMP Fortran runtime library routines are provided both in a form of two Fortran 90 modules, named @code{OMP_LIB} and @code{OMP_LIB_KINDS}, and in a form of a Fortran @code{include} file named @file{omp_lib.h}. The procedures provided by @code{OMP_LIB} can be found -in the @ref{Top,,Introduction,libgomp,GNU OpenMP runtime library} manual, +in the @ref{Top,,Introduction,libgomp,GNU OpenACC and OpenMP runtime +library} manual, the named constants defined in the modules are listed below. diff --git a/gcc/fortran/invoke.texi b/gcc/fortran/invoke.texi index 67d9d57d41e..2a1d1ad9923 100644 --- a/gcc/fortran/invoke.texi +++ b/gcc/fortran/invoke.texi @@ -305,7 +305,12 @@ functionality. @item -fopenacc @opindex @code{fopenacc} @cindex OpenACC -Enable the OpenACC extensions. +Enable the OpenACC extensions. This includes OpenACC @code{!$acc} +directives in free form and @code{c$acc}, @code{*$acc} and +@code{!$acc} directives in fixed form, @code{!$} conditional +compilation sentinels in free form and @code{c$}, @code{*$} and +@code{!$} sentinels in fixed form, and when linking arranges for the +OpenACC runtime library to be linked in. @item -fopenmp @opindex @code{fopenmp} diff --git a/libgomp/ChangeLog.gomp b/libgomp/ChangeLog.gomp index d65ce71a6fd..d4cde2f8b4e 100644 --- a/libgomp/ChangeLog.gomp +++ b/libgomp/ChangeLog.gomp @@ -1,5 +1,7 @@ 2014-11-05 Thomas Schwinge + * libgomp.texi: Update for OpenACC. + * target.h (struct ACC_dispatch_t): Remove avail_func. Update all users. * oacc-host.c (openacc_avail): Likewise. diff --git a/libgomp/libgomp.texi b/libgomp/libgomp.texi index 66c678f1e63..26c65a62ba7 100644 --- a/libgomp/libgomp.texi +++ b/libgomp/libgomp.texi @@ -122,9 +122,13 @@ for multi-platform shared-memory parallel programming in C/C++ and Fortran. @chapter Enabling OpenACC To activate the OpenACC extensions for C/C++ and Fortran, the compile-time -flag @command{-fopenacc} must be specified. This enables OpenACC, and +flag @command{-fopenacc} must be specified. This enables the OpenACC directive +@code{#pragma acc} in C/C++ and @code{!$accp} directives in free form, +@code{c$acc}, @code{*$acc} and @code{!$acc} directives in fixed form, +@code{!$} conditional compilation sentinels in free form and @code{c$}, +@code{*$} and @code{!$} sentinels in fixed form, for Fortran. The flag also arranges for automatic linking of the OpenACC runtime library -(@ref{Runtime Library Routines}). +(@ref{OpenACC Runtime Library Routines}). A complete description of all OpenACC directives accepted may be found in the @uref{http://www.openacc.org/, OpenMP Application Programming @@ -171,11 +175,9 @@ acceleration device. * acc_is_present:: * acc_memcpy_to_device:: * acc_memcpy_from_device:: -@end menu API routines for target platforms. -@menu * acc_get_current_cuda_device:: * acc_get_current_cuda_context:: * acc_get_cuda_stream:: -- 2.11.4.GIT