From patchwork Fri Jan 10 16:34:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tobias Burnus X-Patchwork-Id: 1221304 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-517156-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha1 header.s=default header.b=hwahGoJU; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47vT9H6hJhz9sR4 for ; Sat, 11 Jan 2020 03:34:58 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:from:to:references:message-id:date:mime-version :in-reply-to:content-type; q=dns; s=default; b=K2psRyS2/dWuUlIcj o4dyWe7zDDO/ZMbiQrk14LQeaSV13VAbSE1i/e6ak9hSF9a5HGKJ4aczFK0ChPGo /M6R5HDS50kWwYsZnIcuhk8RF1yGd10VPno2d9+ilOEXvvaSnKfl6vkElhTGFkn8 XjkEMmEuX/NCkmyZfBNZpXxRkE= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:from:to:references:message-id:date:mime-version :in-reply-to:content-type; s=default; bh=JgdCeZacaa25r2kOBUb/ZWy QihQ=; b=hwahGoJUbIbwg3KBcFvnUw6wfjodCZzKSn+F2G/ehHGWKK7CCpMcBLO UGc9yxcqzz0MOF6jOtHmMNWivNgl+gvQCJM27QUCp27PA+tMUTybWzBsErM4ZURS LWX7zO95r9VG62lwoaDddV/3wNB4rbd7UV44Knqo5Vejgq4JART8= Received: (qmail 55256 invoked by alias); 10 Jan 2020 16:34:48 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 55248 invoked by uid 89); 10 Jan 2020 16:34:47 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-16.8 required=5.0 tests=AWL, BAYES_00, GARBLED_SUBJECT, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT autolearn=ham version=3.3.1 spammy=cpp_define, varying, 2666, 8, @option X-HELO: esa2.mentor.iphmx.com Received: from esa2.mentor.iphmx.com (HELO esa2.mentor.iphmx.com) (68.232.141.98) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 10 Jan 2020 16:34:42 +0000 IronPort-SDR: wLxCK+ZiBWPfRJLdhU5e56wRjAnwzgnrCtDD6KGGydDaWuhMo+6Yg9fkGWYFTU38oO7oleS8ky plrUn+Db1lmqxi/D9Zp8EA8RbRbBVphSrtqxsPezHIMWsh2BvIDkqvSEeOeG1i6vvQHAnoYFiU S/iwf5ArV5kcuTxMRmI5vUJsB890C7mU5cDliawe7VJ46jmkTMFxhs+FAaDRndPIAqXiqeQV/z 9TuYsIlwxKKyJcN5v7ImjDXXnN/sF5S/6YHeqoUab7s1g8Rx/oNZhfXXRF7GZ3dhQB23BZZA/X joI= Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa2.mentor.iphmx.com with ESMTP; 10 Jan 2020 08:34:40 -0800 IronPort-SDR: jfVeYcRbBofyws8W7mlNjaS0u8tAiuDZHCeqWfMBx9PfWaMtQ+lqVshn7HNCFYeAKZKg6w+M0Q SM0agRd5stoyYaTbxpGgFEmXp2ZxDA1g4iHWuOoX7JKmoiHQ3jo4eCF357U4LSJdNEISP3cky6 hLYS9djVn+G0QaQSXBPC28nyylL5zZRkaODsWfUU2X1io/aF4CxaXk8Ff8PJhgD/GnjtHyl1Vg U4j+IWnQl3Pj/Mz54AUWWmflIYSndtVk5vwIIeTcgZwZqSqLbls6jq1Fey3FPHFFC37UL/h+3s CDY= Subject: =?utf-8?q?=5BOpenACC=5D_bump_version_for_2=2E6_plus_libgomp=2Ete?= =?utf-8?q?xi_update_=E2=80=94_document_acc=5Fattach/acc=5Fdetach?= =?utf-8?b?LCBhY2NfKl9hc3luYywgYWNjXypfZmluYWxpemUoX2FzeW5jKSBmdW5j?= =?utf-8?q?tions?= From: Tobias Burnus To: gcc-patches , Thomas Schwinge References: <42417855-137b-a872-64f2-77fe81bc7d3f@codesourcery.com> Message-ID: <7e36f18f-acc9-b04d-e4ea-8c758b9c3fe9@codesourcery.com> Date: Fri, 10 Jan 2020 17:34:28 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 MIME-Version: 1.0 In-Reply-To: <42417855-137b-a872-64f2-77fe81bc7d3f@codesourcery.com> X-IsSubscribed: yes I believe except for bugs and known omissions (e.g. PR93225+93226), the GCC 10 trunk implementation is complete – and the version number can be bumped from 2.0 (alias 201306) to OpenACC 2.6 (alias 201711). That's what this patch does (i.e. applying the previously mentioned OG9 patch). It also includes the previous patch, i.e. the addition of the missing acc_*_async and acc_*_finalize prototypes. Additionally, I added the missing documentation for acc_attach/acc_detach. — And I did not include the following wording, which the OG9 patch added: "This list has not yet been updated for the OpenACC specification in version 2.6." OK for the trunk? Tobias PS: Build succeeded but regtesting is still ongoing. On 1/8/20 5:07 PM, Tobias Burnus wrote: > When looking at libgomp.texi the other day, I saw that the acc_*_async > variants and the acc_*_finalize functions of OpenACC 2.5 were not > documented. > > Hence, this patch adds them. Those are part of OpenACC 2.5, hence, I > updated the @ref (but referenced to OpenACC 2.6 instead). > > Possible variants: > (a) update all acc_* calls to OpenACC 2.6 @refs > (b) defer updating the @ref until the OpenACC version is bumped from > 2.0 (alias 201306) to OpenACC 2.6 (alias 201711). [Cf. OG9 branch's > 7a22697197b85931d9fda66e8b0f75171ea13b43] > (c) Independent of the @ref: write the variable-type declarations for > Fortran en bloc after all the "subroutine" as they are the same – > especially useful for acc_copyout* which has 8 variants. That's how > OpenACC 2.7's spec does it. > > Regarding (c): If one goes for that change, does one keep the > "INTERFACE" string in the table for each "subroutine" line? And what > do to about the variable-declaration lines? Adding a single > "ARGUMENTS" before the first of those (i.e. in the "a" line)? > > Comments, suggestions, approval? > > Tobias > 2020-01-10 Julian Brown Tobias Burnus gcc/c-family/ * c-cppbuiltin.c (c_cpp_builtins): Update _OPENACC define to 201711. gcc/doc/ * invoke.texi: Update mention of OpenACC version to 2.6. gcc/fortran/ * cpp.c (cpp_define_builtins): Update _OPENACC define to 201711. * gfortran.texi: Update mentions of OpenACC version to 2.6. * intrinsic.texi: Likewise. gcc/testsuite/ * c-c++-common/cpp/openacc-define-3.c: Update expected value for _OPENACC define. * gfortran.dg/openacc-define-3.f90: Likewise. libgomp/ * libgomp.texi (OpenACC Runtime Library Routines): Document *_async and *_finalize variants; document acc_attach and acc_detach; update references from OpenACC 2.0 to 2.6. * openacc.f90 (openacc_version): Update to 201711. * openacc_lib.h (openacc_version): Update to 201711. * testsuite/libgomp.oacc-fortran/openacc_version-1.f: Update expected openacc_version to 201711. * testsuite/libgomp.oacc-fortran/openacc_version-2.f90: Likewise. gcc/c-family/c-cppbuiltin.c | 2 +- gcc/doc/invoke.texi | 2 +- gcc/fortran/cpp.c | 2 +- gcc/fortran/gfortran.texi | 8 +- gcc/fortran/intrinsic.texi | 6 +- gcc/testsuite/c-c++-common/cpp/openacc-define-3.c | 2 +- gcc/testsuite/gfortran.dg/openacc-define-3.f90 | 2 +- libgomp/libgomp.texi | 257 +++++++++++++++------ libgomp/openacc.f90 | 2 +- libgomp/openacc_lib.h | 2 +- .../libgomp.oacc-fortran/openacc_version-1.f | 2 +- .../libgomp.oacc-fortran/openacc_version-2.f90 | 2 +- 12 files changed, 206 insertions(+), 83 deletions(-) diff --git a/gcc/c-family/c-cppbuiltin.c b/gcc/c-family/c-cppbuiltin.c index cb869415167..e3fd9f9b52a 100644 --- a/gcc/c-family/c-cppbuiltin.c +++ b/gcc/c-family/c-cppbuiltin.c @@ -1439,7 +1439,7 @@ c_cpp_builtins (cpp_reader *pfile) cpp_define (pfile, "__SSP__=1"); if (flag_openacc) - cpp_define (pfile, "_OPENACC=201306"); + cpp_define (pfile, "_OPENACC=201711"); if (flag_openmp) cpp_define (pfile, "_OPENMP=201511"); diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 53df4b1fdf9..70abcbabec7 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -2188,7 +2188,7 @@ freestanding and hosted environments. 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{https://www.openacc.org}}. This option +Programming Interface v2.6 @w{@uref{https://www.openacc.org}}. This option implies @option{-pthread}, and thus is only supported on targets that have support for @option{-pthread}. diff --git a/gcc/fortran/cpp.c b/gcc/fortran/cpp.c index 8ab46986ae9..dcde5576cd5 100644 --- a/gcc/fortran/cpp.c +++ b/gcc/fortran/cpp.c @@ -166,7 +166,7 @@ cpp_define_builtins (cpp_reader *pfile) cpp_define (pfile, "_LANGUAGE_FORTRAN=1"); if (flag_openacc) - cpp_define (pfile, "_OPENACC=201306"); + cpp_define (pfile, "_OPENACC=201711"); if (flag_openmp) cpp_define (pfile, "_OPENMP=201511"); diff --git a/gcc/fortran/gfortran.texi b/gcc/fortran/gfortran.texi index 4cf8b3a5c24..2ef9c22da66 100644 --- a/gcc/fortran/gfortran.texi +++ b/gcc/fortran/gfortran.texi @@ -546,10 +546,8 @@ status} and @ref{Fortran 2018 status} sections of the documentation. Additionally, the GNU Fortran compilers supports the OpenMP specification (version 4.0 and most of the features of the 4.5 version, @url{http://openmp.org/@/wp/@/openmp-specifications/}). -There also is initial support for the OpenACC specification (targeting -version 2.0, @uref{http://www.openacc.org/}). -Note that this is an experimental feature, incomplete, and subject to -change in future versions of GCC. See +There also is support for the OpenACC specification (targeting +version 2.6, @uref{http://www.openacc.org/}). See @uref{https://gcc.gnu.org/wiki/OpenACC} for more information. @node Varying Length Character Strings @@ -2242,7 +2240,7 @@ influence run-time behavior. GNU Fortran strives to be compatible to the @uref{http://www.openacc.org/, OpenACC Application Programming -Interface v2.0}. +Interface v2.6}. To enable the processing of the OpenACC directive @code{!$acc} in free-form source code; the @code{c$acc}, @code{*$acc} and @code{!$acc} diff --git a/gcc/fortran/intrinsic.texi b/gcc/fortran/intrinsic.texi index 823cb9cef30..4d6b866bafc 100644 --- a/gcc/fortran/intrinsic.texi +++ b/gcc/fortran/intrinsic.texi @@ -15350,7 +15350,7 @@ kind @code{omp_proc_bind_kind}: @section OpenACC Module @code{OPENACC} @table @asis @item @emph{Standard}: -OpenACC Application Programming Interface v2.0 +OpenACC Application Programming Interface v2.6 @end table @@ -15364,9 +15364,9 @@ are listed below. For details refer to the actual @uref{http://www.openacc.org/, -OpenACC Application Programming Interface v2.0}. +OpenACC Application Programming Interface v2.6}. @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}. +of the OpenACC version; for OpenACC v2.6 the value is @code{201711}. diff --git a/gcc/testsuite/c-c++-common/cpp/openacc-define-3.c b/gcc/testsuite/c-c++-common/cpp/openacc-define-3.c index ccedcd90782..f2122f57dd9 100644 --- a/gcc/testsuite/c-c++-common/cpp/openacc-define-3.c +++ b/gcc/testsuite/c-c++-common/cpp/openacc-define-3.c @@ -6,6 +6,6 @@ # error _OPENACC not defined #endif -#if _OPENACC != 201306 +#if _OPENACC != 201711 # error _OPENACC defined to wrong value #endif diff --git a/gcc/testsuite/gfortran.dg/openacc-define-3.f90 b/gcc/testsuite/gfortran.dg/openacc-define-3.f90 index b6c296e6b98..dcc52b6b4cb 100644 --- a/gcc/testsuite/gfortran.dg/openacc-define-3.f90 +++ b/gcc/testsuite/gfortran.dg/openacc-define-3.f90 @@ -6,6 +6,6 @@ # error _OPENACC not defined #endif -#if _OPENACC != 201306 +#if _OPENACC != 201711 # error _OPENACC defined to wrong value #endif diff --git a/libgomp/libgomp.texi b/libgomp/libgomp.texi index f082a4a401b..e0c7e01ba41 100644 --- a/libgomp/libgomp.texi +++ b/libgomp/libgomp.texi @@ -1820,7 +1820,7 @@ arranges for automatic linking of the OpenACC runtime library A complete description of all OpenACC directives accepted may be found in the @uref{https://www.openacc.org, OpenACC} Application Programming -Interface manual, version 2.0. +Interface manual, version 2.6. Note that this is an experimental feature and subject to change in future versions of GCC. See @@ -1836,7 +1836,7 @@ change in future versions of GCC. See @chapter OpenACC Runtime Library Routines The runtime routines described here are defined by section 3 of the OpenACC -specifications in version 2.0. +specifications in version 2.6. They have C linkage, and do not throw exceptions. Generally, they are available only for the host, with the exception of @code{acc_on_device}, which is available for both the host and the @@ -1892,6 +1892,8 @@ acceleration device. present on device. * acc_memcpy_to_device:: Copy host memory to device memory. * acc_memcpy_from_device:: Copy device memory to host memory. +* acc_attach:: Let device pointer point to device-pointer target. +* acc_detach:: Let device pointer point to host-pointer target. API routines for target platforms. @@ -1929,7 +1931,7 @@ for the device type specified in @var{devicetype}. @end multitable @item @emph{Reference}: -@uref{https://www.openacc.org, OpenACC specification v2.0}, section +@uref{https://www.openacc.org, OpenACC specification v2.6}, section 3.2.1. @end table @@ -1954,7 +1956,7 @@ in @var{devicetype}, to use when executing a parallel or kernels region. @end multitable @item @emph{Reference}: -@uref{https://www.openacc.org, OpenACC specification v2.0}, section +@uref{https://www.openacc.org, OpenACC specification v2.6}, section 3.2.2. @end table @@ -1979,7 +1981,7 @@ parallel or kernels region. @end multitable @item @emph{Reference}: -@uref{https://www.openacc.org, OpenACC specification v2.0}, section +@uref{https://www.openacc.org, OpenACC specification v2.6}, section 3.2.3. @end table @@ -2006,7 +2008,7 @@ type @var{devicetype}. @end multitable @item @emph{Reference}: -@uref{https://www.openacc.org, OpenACC specification v2.0}, section +@uref{https://www.openacc.org, OpenACC specification v2.6}, section 3.2.4. @end table @@ -2033,7 +2035,7 @@ region. @end multitable @item @emph{Reference}: -@uref{https://www.openacc.org, OpenACC specification v2.0}, section +@uref{https://www.openacc.org, OpenACC specification v2.6}, section 3.2.5. @end table @@ -2100,8 +2102,8 @@ a zero and Fortran returns a @code{false}. @end multitable @item @emph{Reference}: -@uref{https://www.openacc.org, OpenACC specification v2.0}, section -3.2.6. +@uref{https://www.openacc.org, OpenACC specification v2.6}, section +3.2.9. @end table @@ -2128,8 +2130,8 @@ Fortran returns a @code{false}. @end multitable @item @emph{Reference}: -@uref{https://www.openacc.org, OpenACC specification v2.0}, section -3.2.7. +@uref{https://www.openacc.org, OpenACC specification v2.6}, section +3.2.10. @end table @@ -2156,8 +2158,8 @@ specified in @var{arg}. @end multitable @item @emph{Reference}: -@uref{https://www.openacc.org, OpenACC specification v2.0}, section -3.2.8. +@uref{https://www.openacc.org, OpenACC specification v2.6}, section +3.2.11. @end table @@ -2181,8 +2183,8 @@ This function waits for the completion of all asynchronous operations. @end multitable @item @emph{Reference}: -@uref{https://www.openacc.org, OpenACC specification v2.0}, section -3.2.10. +@uref{https://www.openacc.org, OpenACC specification v2.6}, section +3.2.13. @end table @@ -2207,8 +2209,8 @@ any queue. @end multitable @item @emph{Reference}: -@uref{https://www.openacc.org, OpenACC specification v2.0}, section -3.2.11. +@uref{https://www.openacc.org, OpenACC specification v2.6}, section +3.2.14. @end table @@ -2232,8 +2234,8 @@ asynchronous operations enqueued on queue @var{arg}. @end multitable @item @emph{Reference}: -@uref{https://www.openacc.org, OpenACC specification v2.0}, section -3.2.9. +@uref{https://www.openacc.org, OpenACC specification v2.6}, section +3.2.12. @end table @@ -2257,8 +2259,8 @@ This function initializes the runtime for the device type specified in @end multitable @item @emph{Reference}: -@uref{https://www.openacc.org, OpenACC specification v2.0}, section -3.2.12. +@uref{https://www.openacc.org, OpenACC specification v2.6}, section +3.2.7. @end table @@ -2282,8 +2284,8 @@ This function shuts down the runtime for the device type specified in @end multitable @item @emph{Reference}: -@uref{https://www.openacc.org, OpenACC specification v2.0}, section -3.2.13. +@uref{https://www.openacc.org, OpenACC specification v2.6}, section +3.2.8. @end table @@ -2313,8 +2315,8 @@ return @code{false}. @item @emph{Reference}: -@uref{https://www.openacc.org, OpenACC specification v2.0}, section -3.2.14. +@uref{https://www.openacc.org, OpenACC specification v2.6}, section +3.2.17. @end table @@ -2332,8 +2334,8 @@ the device address of the allocated memory. @end multitable @item @emph{Reference}: -@uref{https://www.openacc.org, OpenACC specification v2.0}, section -3.2.15. +@uref{https://www.openacc.org, OpenACC specification v2.6}, section +3.2.18. @end table @@ -2350,8 +2352,8 @@ Free previously allocated device memory at the device address @code{a}. @end multitable @item @emph{Reference}: -@uref{https://www.openacc.org, OpenACC specification v2.0}, section -3.2.16. +@uref{https://www.openacc.org, OpenACC specification v2.6}, section +3.2.19. @end table @@ -2371,6 +2373,7 @@ variable or array element and @var{len} specifies the length in bytes. @item @emph{C/C++}: @multitable @columnfractions .20 .80 @item @emph{Prototype}: @tab @code{void *acc_copyin(h_void *a, size_t len);} +@item @emph{Prototype}: @tab @code{void *acc_copyin_async(h_void *a, size_t len, int async);} @end multitable @item @emph{Fortran}: @@ -2380,11 +2383,18 @@ variable or array element and @var{len} specifies the length in bytes. @item @emph{Interface}: @tab @code{subroutine acc_copyin(a, len)} @item @tab @code{type, dimension(:[,:]...) :: a} @item @tab @code{integer len} +@item @emph{Interface}: @tab @code{subroutine acc_copyin_async(a, async)} +@item @tab @code{type, dimension(:[,:]...) :: a} +@item @tab @code{integer(acc_handle_kind) :: async} +@item @emph{Interface}: @tab @code{subroutine acc_copyin_async(a, len, async)} +@item @tab @code{type, dimension(:[,:]...) :: a} +@item @tab @code{integer len} +@item @tab @code{integer(acc_handle_kind) :: async} @end multitable @item @emph{Reference}: -@uref{https://www.openacc.org, OpenACC specification v2.0}, section -3.2.17. +@uref{https://www.openacc.org, OpenACC specification v2.6}, section +3.2.20. @end table @@ -2402,6 +2412,9 @@ In Fortran, two (2) forms are supported. In the first form, @var{a} specifies a contiguous array section. The second form @var{a} specifies a variable or array element and @var{len} specifies the length in bytes. +Note that @code{acc_present_or_copyin} and @code{acc_pcopyin} exist for +backward compatibility with OpenACC 2.0; use @ref{acc_copyin} instead. + @item @emph{C/C++}: @multitable @columnfractions .20 .80 @item @emph{Prototype}: @tab @code{void *acc_present_or_copyin(h_void *a, size_t len);} @@ -2423,8 +2436,8 @@ array element and @var{len} specifies the length in bytes. @end multitable @item @emph{Reference}: -@uref{https://www.openacc.org, OpenACC specification v2.0}, section -3.2.18. +@uref{https://www.openacc.org, OpenACC specification v2.6}, section +3.2.20. @end table @@ -2444,6 +2457,7 @@ array element and @var{len} specifies the length in bytes. @item @emph{C/C++}: @multitable @columnfractions .20 .80 @item @emph{Prototype}: @tab @code{void *acc_create(h_void *a, size_t len);} +@item @emph{Prototype}: @tab @code{void *acc_create_async(h_void *a, size_t len, int async);} @end multitable @item @emph{Fortran}: @@ -2453,11 +2467,18 @@ array element and @var{len} specifies the length in bytes. @item @emph{Interface}: @tab @code{subroutine acc_create(a, len)} @item @tab @code{type, dimension(:[,:]...) :: a} @item @tab @code{integer len} +@item @emph{Interface}: @tab @code{subroutine acc_create_async(a, async)} +@item @tab @code{type, dimension(:[,:]...) :: a} +@item @tab @code{integer(acc_handle_kind) :: async} +@item @emph{Interface}: @tab @code{subroutine acc_create_async(a, len, async)} +@item @tab @code{type, dimension(:[,:]...) :: a} +@item @tab @code{integer len} +@item @tab @code{integer(acc_handle_kind) :: async} @end multitable @item @emph{Reference}: -@uref{https://www.openacc.org, OpenACC specification v2.0}, section -3.2.19. +@uref{https://www.openacc.org, OpenACC specification v2.6}, section +3.2.21. @end table @@ -2475,6 +2496,8 @@ In Fortran, two (2) forms are supported. In the first form, @var{a} specifies a contiguous array section. The second form @var{a} specifies a variable or array element and @var{len} specifies the length in bytes. +Note that @code{acc_present_or_create} and @code{acc_pcreate} exist for +backward compatibility with OpenACC 2.0; use @ref{acc_create} instead. @item @emph{C/C++}: @multitable @columnfractions .20 .80 @@ -2497,8 +2520,8 @@ array element and @var{len} specifies the length in bytes. @end multitable @item @emph{Reference}: -@uref{https://www.openacc.org, OpenACC specification v2.0}, section -3.2.20. +@uref{https://www.openacc.org, OpenACC specification v2.6}, section +3.2.21. @end table @@ -2517,6 +2540,9 @@ array element and @var{len} specifies the length in bytes. @item @emph{C/C++}: @multitable @columnfractions .20 .80 @item @emph{Prototype}: @tab @code{acc_copyout(h_void *a, size_t len);} +@item @emph{Prototype}: @tab @code{acc_copyout_async(h_void *a, size_t len, int async);} +@item @emph{Prototype}: @tab @code{acc_copyout_finalize(h_void *a, size_t len);} +@item @emph{Prototype}: @tab @code{acc_copyout_finalize_async(h_void *a, size_t len, int async);} @end multitable @item @emph{Fortran}: @@ -2526,11 +2552,30 @@ array element and @var{len} specifies the length in bytes. @item @emph{Interface}: @tab @code{subroutine acc_copyout(a, len)} @item @tab @code{type, dimension(:[,:]...) :: a} @item @tab @code{integer len} +@item @emph{Interface}: @tab @code{subroutine acc_copyout_async(a, async)} +@item @tab @code{type, dimension(:[,:]...) :: a} +@item @tab @code{integer(acc_handle_kind) :: async} +@item @emph{Interface}: @tab @code{subroutine acc_copyout_async(a, len, async)} +@item @tab @code{type, dimension(:[,:]...) :: a} +@item @tab @code{integer len} +@item @tab @code{integer(acc_handle_kind) :: async} +@item @emph{Interface}: @tab @code{subroutine acc_copyout_finalize(a)} +@item @tab @code{type, dimension(:[,:]...) :: a} +@item @emph{Interface}: @tab @code{subroutine acc_copyout_finalize(a, len)} +@item @tab @code{type, dimension(:[,:]...) :: a} +@item @tab @code{integer len} +@item @emph{Interface}: @tab @code{subroutine acc_copyout_finalize_async(a, async)} +@item @tab @code{type, dimension(:[,:]...) :: a} +@item @tab @code{integer(acc_handle_kind) :: async} +@item @emph{Interface}: @tab @code{subroutine acc_copyout_finalize_async(a, len, async)} +@item @tab @code{type, dimension(:[,:]...) :: a} +@item @tab @code{integer len} +@item @tab @code{integer(acc_handle_kind) :: async} @end multitable @item @emph{Reference}: -@uref{https://www.openacc.org, OpenACC specification v2.0}, section -3.2.21. +@uref{https://www.openacc.org, OpenACC specification v2.6}, section +3.2.22. @end table @@ -2549,6 +2594,9 @@ array element and @var{len} specifies the length in bytes. @item @emph{C/C++}: @multitable @columnfractions .20 .80 @item @emph{Prototype}: @tab @code{acc_delete(h_void *a, size_t len);} +@item @emph{Prototype}: @tab @code{acc_delete_async(h_void *a, size_t len, int async);} +@item @emph{Prototype}: @tab @code{acc_delete_finalize(h_void *a, size_t len);} +@item @emph{Prototype}: @tab @code{acc_delete_finalize_async(h_void *a, size_t len, int async);} @end multitable @item @emph{Fortran}: @@ -2558,11 +2606,30 @@ array element and @var{len} specifies the length in bytes. @item @emph{Interface}: @tab @code{subroutine acc_delete(a, len)} @item @tab @code{type, dimension(:[,:]...) :: a} @item @tab @code{integer len} +@item @emph{Interface}: @tab @code{subroutine acc_delete_async(a, async)} +@item @tab @code{type, dimension(:[,:]...) :: a} +@item @tab @code{integer(acc_handle_kind) :: async} +@item @emph{Interface}: @tab @code{subroutine acc_delete_async(a, len, async)} +@item @tab @code{type, dimension(:[,:]...) :: a} +@item @tab @code{integer len} +@item @tab @code{integer(acc_handle_kind) :: async} +@item @emph{Interface}: @tab @code{subroutine acc_delete_finalize(a)} +@item @tab @code{type, dimension(:[,:]...) :: a} +@item @emph{Interface}: @tab @code{subroutine acc_delete_finalize(a, len)} +@item @tab @code{type, dimension(:[,:]...) :: a} +@item @tab @code{integer len} +@item @emph{Interface}: @tab @code{subroutine acc_delete_async_finalize(a, async)} +@item @tab @code{type, dimension(:[,:]...) :: a} +@item @tab @code{integer(acc_handle_kind) :: async} +@item @emph{Interface}: @tab @code{subroutine acc_delete_async_finalize(a, len, async)} +@item @tab @code{type, dimension(:[,:]...) :: a} +@item @tab @code{integer len} +@item @tab @code{integer(acc_handle_kind) :: async} @end multitable @item @emph{Reference}: -@uref{https://www.openacc.org, OpenACC specification v2.0}, section -3.2.22. +@uref{https://www.openacc.org, OpenACC specification v2.6}, section +3.2.23. @end table @@ -2582,6 +2649,7 @@ array element and @var{len} specifies the length in bytes. @item @emph{C/C++}: @multitable @columnfractions .20 .80 @item @emph{Prototype}: @tab @code{acc_update_device(h_void *a, size_t len);} +@item @emph{Prototype}: @tab @code{acc_update_device(h_void *a, size_t len, async);} @end multitable @item @emph{Fortran}: @@ -2591,11 +2659,18 @@ array element and @var{len} specifies the length in bytes. @item @emph{Interface}: @tab @code{subroutine acc_update_device(a, len)} @item @tab @code{type, dimension(:[,:]...) :: a} @item @tab @code{integer len} +@item @emph{Interface}: @tab @code{subroutine acc_update_device_async(a, async)} +@item @tab @code{type, dimension(:[,:]...) :: a} +@item @tab @code{integer(acc_handle_kind) :: async} +@item @emph{Interface}: @tab @code{subroutine acc_update_device_async(a, len, async)} +@item @tab @code{type, dimension(:[,:]...) :: a} +@item @tab @code{integer len} +@item @tab @code{integer(acc_handle_kind) :: async} @end multitable @item @emph{Reference}: -@uref{https://www.openacc.org, OpenACC specification v2.0}, section -3.2.23. +@uref{https://www.openacc.org, OpenACC specification v2.6}, section +3.2.24. @end table @@ -2615,6 +2690,7 @@ array element and @var{len} specifies the length in bytes. @item @emph{C/C++}: @multitable @columnfractions .20 .80 @item @emph{Prototype}: @tab @code{acc_update_self(h_void *a, size_t len);} +@item @emph{Prototype}: @tab @code{acc_update_self_async(h_void *a, size_t len, int async);} @end multitable @item @emph{Fortran}: @@ -2624,11 +2700,18 @@ array element and @var{len} specifies the length in bytes. @item @emph{Interface}: @tab @code{subroutine acc_update_self(a, len)} @item @tab @code{type, dimension(:[,:]...) :: a} @item @tab @code{integer len} +@item @emph{Interface}: @tab @code{subroutine acc_update_self_async(a, async)} +@item @tab @code{type, dimension(:[,:]...) :: a} +@item @tab @code{integer(acc_handle_kind) :: async} +@item @emph{Interface}: @tab @code{subroutine acc_update_self_async(a, len, async)} +@item @tab @code{type, dimension(:[,:]...) :: a} +@item @tab @code{integer len} +@item @tab @code{integer(acc_handle_kind) :: async} @end multitable @item @emph{Reference}: -@uref{https://www.openacc.org, OpenACC specification v2.0}, section -3.2.24. +@uref{https://www.openacc.org, OpenACC specification v2.6}, section +3.2.25. @end table @@ -2647,8 +2730,8 @@ specified with the host address @var{h} and a length of @var{len}. @end multitable @item @emph{Reference}: -@uref{https://www.openacc.org, OpenACC specification v2.0}, section -3.2.25. +@uref{https://www.openacc.org, OpenACC specification v2.6}, section +3.2.26. @end table @@ -2666,8 +2749,8 @@ specified by @var{h}. @end multitable @item @emph{Reference}: -@uref{https://www.openacc.org, OpenACC specification v2.0}, section -3.2.26. +@uref{https://www.openacc.org, OpenACC specification v2.6}, section +3.2.27. @end table @@ -2685,8 +2768,8 @@ host address specified by @var{h}. @end multitable @item @emph{Reference}: -@uref{https://www.openacc.org, OpenACC specification v2.0}, section -3.2.27. +@uref{https://www.openacc.org, OpenACC specification v2.6}, section +3.2.28. @end table @@ -2704,8 +2787,8 @@ device address specified by @var{d}. @end multitable @item @emph{Reference}: -@uref{https://www.openacc.org, OpenACC specification v2.0}, section -3.2.28. +@uref{https://www.openacc.org, OpenACC specification v2.6}, section +3.2.29. @end table @@ -2743,8 +2826,8 @@ a @code{false} is return to indicate the mapped memory is not present. @end multitable @item @emph{Reference}: -@uref{https://www.openacc.org, OpenACC specification v2.0}, section -3.2.29. +@uref{https://www.openacc.org, OpenACC specification v2.6}, section +3.2.30. @end table @@ -2763,8 +2846,8 @@ device memory specified by the device address @var{dest} for a length of @end multitable @item @emph{Reference}: -@uref{https://www.openacc.org, OpenACC specification v2.0}, section -3.2.30. +@uref{https://www.openacc.org, OpenACC specification v2.6}, section +3.2.31. @end table @@ -2783,8 +2866,50 @@ device memory specified by the device address @var{dest} for a length of @end multitable @item @emph{Reference}: -@uref{https://www.openacc.org, OpenACC specification v2.0}, section -3.2.31. +@uref{https://www.openacc.org, OpenACC specification v2.6}, section +3.2.32. +@end table + + + +@node acc_attach +@section @code{acc_attach} -- Let device pointer point to device-pointer target. +@table @asis +@item @emph{Description} +This function updates a pointer on the device from pointing to a host-pointer +address to pointing to the corresponding device data. + +@item @emph{C/C++}: +@multitable @columnfractions .20 .80 +@item @emph{Prototype}: @tab @code{acc_attach(h_void **ptr);} +@item @emph{Prototype}: @tab @code{acc_attach_async(h_void **ptr, int async);} +@end multitable + +@item @emph{Reference}: +@uref{https://www.openacc.org, OpenACC specification v2.6}, section +3.2.34. +@end table + + + +@node acc_detach +@section @code{acc_detach} -- Let device pointer point to host-pointer target. +@table @asis +@item @emph{Description} +This function updates a pointer on the device from pointing to a device-pointer +address to pointing to the corresponding host data. + +@item @emph{C/C++}: +@multitable @columnfractions .20 .80 +@item @emph{Prototype}: @tab @code{acc_detach(h_void **ptr);} +@item @emph{Prototype}: @tab @code{acc_detach_async(h_void **ptr, int async);} +@item @emph{Prototype}: @tab @code{acc_detach_finalize(h_void **ptr);} +@item @emph{Prototype}: @tab @code{acc_detach_finalize_async(h_void **ptr, int async);} +@end multitable + +@item @emph{Reference}: +@uref{https://www.openacc.org, OpenACC specification v2.6}, section +3.2.35. @end table @@ -2802,7 +2927,7 @@ as used by the CUDA Runtime or Driver API's. @end multitable @item @emph{Reference}: -@uref{https://www.openacc.org, OpenACC specification v2.0}, section +@uref{https://www.openacc.org, OpenACC specification v2.6}, section A.2.1.1. @end table @@ -2821,7 +2946,7 @@ as used by the CUDA Runtime or Driver API's. @end multitable @item @emph{Reference}: -@uref{https://www.openacc.org, OpenACC specification v2.0}, section +@uref{https://www.openacc.org, OpenACC specification v2.6}, section A.2.1.2. @end table @@ -2840,7 +2965,7 @@ This handle is the same as used by the CUDA Runtime or Driver API's. @end multitable @item @emph{Reference}: -@uref{https://www.openacc.org, OpenACC specification v2.0}, section +@uref{https://www.openacc.org, OpenACC specification v2.6}, section A.2.1.3. @end table @@ -2864,7 +2989,7 @@ The return value is not specified. @end multitable @item @emph{Reference}: -@uref{https://www.openacc.org, OpenACC specification v2.0}, section +@uref{https://www.openacc.org, OpenACC specification v2.6}, section A.2.1.4. @end table @@ -2980,7 +3105,7 @@ The variable @env{GCC_ACC_NOTIFY} is used for diagnostic purposes. @section @code{ACC_DEVICE_TYPE} @table @asis @item @emph{Reference}: -@uref{https://www.openacc.org, OpenACC specification v2.0}, section +@uref{https://www.openacc.org, OpenACC specification v2.6}, section 4.1. @end table @@ -2990,7 +3115,7 @@ The variable @env{GCC_ACC_NOTIFY} is used for diagnostic purposes. @section @code{ACC_DEVICE_NUM} @table @asis @item @emph{Reference}: -@uref{https://www.openacc.org, OpenACC specification v2.0}, section +@uref{https://www.openacc.org, OpenACC specification v2.6}, section 4.2. @end table @@ -3220,7 +3345,7 @@ is called prior to a call to an OpenACC function, then you must call @code{acc_set_device_num()}@footnote{More complete information about @env{ACC_DEVICE_TYPE} and @env{ACC_DEVICE_NUM} can be found in sections 4.1 and 4.2 of the @uref{https://www.openacc.org, OpenACC} -Application Programming Interface”, Version 2.0.} +Application Programming Interface”, Version 2.6.} diff --git a/libgomp/openacc.f90 b/libgomp/openacc.f90 index a3083168a3a..a1c24c90cf3 100644 --- a/libgomp/openacc.f90 +++ b/libgomp/openacc.f90 @@ -792,7 +792,7 @@ module openacc public :: acc_delete_async, acc_update_device_async, acc_update_self_async public :: acc_copyout_finalize, acc_delete_finalize - integer, parameter :: openacc_version = 201306 + integer, parameter :: openacc_version = 201711 interface acc_get_num_devices procedure :: acc_get_num_devices_h diff --git a/libgomp/openacc_lib.h b/libgomp/openacc_lib.h index b327ba76403..5c02df6f841 100644 --- a/libgomp/openacc_lib.h +++ b/libgomp/openacc_lib.h @@ -52,7 +52,7 @@ integer (acc_handle_kind), parameter :: acc_async_noval = -1 integer (acc_handle_kind), parameter :: acc_async_sync = -2 - integer, parameter :: openacc_version = 201306 + integer, parameter :: openacc_version = 201711 interface acc_get_num_devices function acc_get_num_devices_h (d) diff --git a/libgomp/testsuite/libgomp.oacc-fortran/openacc_version-1.f b/libgomp/testsuite/libgomp.oacc-fortran/openacc_version-1.f index 537212eb655..36e9844bb15 100644 --- a/libgomp/testsuite/libgomp.oacc-fortran/openacc_version-1.f +++ b/libgomp/testsuite/libgomp.oacc-fortran/openacc_version-1.f @@ -4,6 +4,6 @@ implicit none include "openacc_lib.h" - if (openacc_version .ne. 201306) STOP 1 + if (openacc_version .ne. 201711) STOP 1 end program main diff --git a/libgomp/testsuite/libgomp.oacc-fortran/openacc_version-2.f90 b/libgomp/testsuite/libgomp.oacc-fortran/openacc_version-2.f90 index 54f301be79b..e815bc1b827 100644 --- a/libgomp/testsuite/libgomp.oacc-fortran/openacc_version-2.f90 +++ b/libgomp/testsuite/libgomp.oacc-fortran/openacc_version-2.f90 @@ -4,6 +4,6 @@ program main use openacc implicit none - if (openacc_version .ne. 201306) STOP 1 + if (openacc_version .ne. 201711) STOP 1 end program main