From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21704 invoked by alias); 14 Dec 2018 14:54:07 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 21690 invoked by uid 89); 14 Dec 2018 14:54:06 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=3606, 360,6 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 14 Dec 2018 14:54:05 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=svr-ies-mbx-01.mgc.mentorg.com) by relay1.mentorg.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-SHA384:256) id 1gXoqp-0004uL-I9 from Thomas_Schwinge@mentor.com for gcc-patches@gcc.gnu.org; Fri, 14 Dec 2018 06:54:03 -0800 Received: from hertz.schwinge.homeip.net (137.202.0.90) by svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Fri, 14 Dec 2018 14:53:59 +0000 From: Thomas Schwinge To: Chung-Lin Tang CC: Subject: Re: [PATCH 2/6, OpenACC, libgomp] Async re-work, oacc-* parts In-Reply-To: <12319572-dd02-c946-f2b9-9d047be9c707@mentor.com> References: <12319572-dd02-c946-f2b9-9d047be9c707@mentor.com> User-Agent: Notmuch/0.9-101-g81dad07 (http://notmuchmail.org) Emacs/25.2.2 (x86_64-pc-linux-gnu) Date: Fri, 14 Dec 2018 14:54:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SW-Source: 2018-12/txt/msg01067.txt.bz2 Hi Chung-Lin! On Tue, 25 Sep 2018 21:10:47 +0800, Chung-Lin Tang wrote: > --- a/libgomp/oacc-parallel.c > +++ b/libgomp/oacc-parallel.c > @@ -377,8 +360,6 @@ GOACC_enter_exit_data (int device, size_t mapnum, > finalize =3D true; > } >=20=20 > - acc_dev->openacc.async_set_async_func (async); > - > /* Determine if this is an "acc enter data". */ > for (i =3D 0; i < mapnum; ++i) > { > @@ -450,7 +431,7 @@ GOACC_enter_exit_data (int device, size_t mapnum, > else > { > gomp_acc_insert_pointer (pointer, &hostaddrs[i], > - &sizes[i], &kinds[i]); > + &sizes[i], &kinds[i], async); > /* Increment 'i' by two because OpenACC requires fortran > arrays to be contiguous, so each PSET is associated with > one of MAP_FORCE_ALLOC/MAP_FORCE_PRESET/MAP_FORCE_TO, and > @@ -475,17 +456,17 @@ GOACC_enter_exit_data (int device, size_t mapnum, > if (acc_is_present (hostaddrs[i], sizes[i])) > { > if (finalize) > - acc_delete_finalize (hostaddrs[i], sizes[i]); > + acc_delete_finalize_async (hostaddrs[i], sizes[i], async); > else > - acc_delete (hostaddrs[i], sizes[i]); > + acc_delete_async (hostaddrs[i], sizes[i], async); > } > break; > case GOMP_MAP_FROM: > case GOMP_MAP_FORCE_FROM: > if (finalize) > - acc_copyout_finalize (hostaddrs[i], sizes[i]); > + acc_copyout_finalize_async (hostaddrs[i], sizes[i], async); > else > - acc_copyout (hostaddrs[i], sizes[i]); > + acc_copyout_async (hostaddrs[i], sizes[i], async); > break; > default: > gomp_fatal (">>>> GOACC_enter_exit_data UNHANDLED kind 0x%.2x", > @@ -503,8 +484,6 @@ GOACC_enter_exit_data (int device, size_t mapnum, > i +=3D pointer - 1; > } > } > - > - acc_dev->openacc.async_set_async_func (acc_async_sync); > } Additionally the following, or why not? Please comment on the one TODO which before your async re-work also was -- incorrectly? -- run asynchronously? commit 34c9ce65ad1f9865d0716d18c364d8c6928e694c Author: Thomas Schwinge Date: Fri Dec 14 14:34:17 2018 +0100 into async re-work: more async function usage --- libgomp/oacc-parallel.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git libgomp/oacc-parallel.c libgomp/oacc-parallel.c index 5a441c9efe38..91875c57fc97 100644 --- libgomp/oacc-parallel.c +++ libgomp/oacc-parallel.c @@ -413,11 +413,11 @@ GOACC_enter_exit_data (int device, size_t mapnum, { case GOMP_MAP_ALLOC: case GOMP_MAP_FORCE_ALLOC: - acc_create (hostaddrs[i], sizes[i]); + acc_create_async (hostaddrs[i], sizes[i], async); break; case GOMP_MAP_TO: case GOMP_MAP_FORCE_TO: - acc_copyin (hostaddrs[i], sizes[i]); + acc_copyin_async (hostaddrs[i], sizes[i], async); break; default: gomp_fatal (">>>> GOACC_enter_exit_data UNHANDLED kind 0x%.2x", @@ -563,6 +563,8 @@ GOACC_update (int device, size_t mapnum, the value of the allocated device memory in the previous pointer. */ *(uintptr_t *) hostaddrs[i] =3D (uintptr_t)dptr; + /* This is intentionally no calling acc_update_device_async, + because TODO. */ acc_update_device (hostaddrs[i], sizeof (uintptr_t)); =20 /* Restore the host pointer. */ Gr=C3=BC=C3=9Fe Thomas