From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 68711 invoked by alias); 9 Dec 2018 12:53:33 -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 66415 invoked by uid 89); 9 Dec 2018 12:52:56 -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,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=rework, Hx-spam-relays-external:sk:relay1., HX-HELO:sk:relay1., re-work 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; Sun, 09 Dec 2018 12:52:53 +0000 Received: from svr-orw-mbx-05.mgc.mentorg.com ([147.34.90.205]) by relay1.mentorg.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-SHA384:256) id 1gVyZg-0001fA-CT from Thomas_Schwinge@mentor.com ; Sun, 09 Dec 2018 04:52:44 -0800 Received: from SVR-ORW-MBX-09.mgc.mentorg.com (147.34.90.209) by SVR-ORW-MBX-05.mgc.mentorg.com (147.34.90.205) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Sun, 9 Dec 2018 04:52:42 -0800 Received: from tftp-cs (147.34.91.1) by SVR-ORW-MBX-09.mgc.mentorg.com (147.34.90.209) with Microsoft SMTP Server id 15.0.1320.4 via Frontend Transport; Sun, 9 Dec 2018 04:52:41 -0800 Received: by tftp-cs (Postfix, from userid 49978) id 625BFC24AB; Sun, 9 Dec 2018 04:52:41 -0800 (PST) From: Thomas Schwinge To: Jakub Jelinek , CC: Martin Jambor , Alexander Monakov , Chung-Lin Tang Subject: Re: [RFC PATCH] Coalesce host to device transfers in libgomp In-Reply-To: <20181206175731.GU12380@tucnak> References: <20171024095527.GJ14653@tucnak> <20171025113850.GR14653@tucnak> <87mupisi6b.fsf@euler.schwinge.homeip.net> <20181206171856.GS12380@tucnak> <20181206175731.GU12380@tucnak> User-Agent: Notmuch/0.9-125-g4686d11 (http://notmuchmail.org) Emacs/25.2.2 (x86_64-pc-linux-gnu) Date: Sun, 09 Dec 2018 12:53:00 -0000 Message-ID: <87k1kisvzg.fsf@euler.schwinge.homeip.net> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SW-Source: 2018-12/txt/msg00534.txt.bz2 Hi! On Thu, 6 Dec 2018 18:57:31 +0100, Jakub Jelinek wrote: > On Thu, Dec 06, 2018 at 06:54:20PM +0100, Thomas Schwinge wrote: > > On Thu, 6 Dec 2018 18:18:56 +0100, Jakub Jelinek wro= te: > > > On Thu, Dec 06, 2018 at 06:01:48PM +0100, Thomas Schwinge wrote: > > > > While reviewing Chung-Lin's > > > > "[PATCH = 4/6, > > > > OpenACC, libgomp] Async re-work, libgomp/target.c changes", I notic= ed the > > > > following unrelated hunk. Is that intentional or just an oversight= that > > > > it hasn't been included in your "gomp_coalesce_buf" changes (quoted= below > > > > for reference)? > > >=20 > > > I believe it is intentional, the coalescing code coalesces only stuff > > > allocated by the current gomp_map_vars call, for the link_key case we= know > > > that is not the case, it is a copy to a file scope data variable in t= he PTX > > > code. > >=20 > > Hmm, I thought this would just copy an address (as opposed to data) from > > the host to the device, so that would be fine for coalescing. But I'm > > not familiar with that code, so it's certainly possible that I'm not > > understanding this correctly. >=20 > The actual data transfer can be coalesced, just the address is copied into > the offloaded file scope var and so that exact transfer can't be coalesce= d. Ah, I see, thanks! > > > Perhaps we could do the change but pass NULL instead > > > of cbufp as the last argument? Committed to trunk in r266919: commit 9d5a0b9dbb3aa4493f6e20b711607a25783bcec3 Author: tschwinge Date: Sun Dec 9 12:47:23 2018 +0000 Coalesce host to device transfers in libgomp: not for link pointer =20=20=20=20 libgomp/ * target.c (gomp_map_vars): Call gomp_copy_host2dev instead of devicep->host2dev_func. =20=20=20=20 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@266919 138bc75d-0d04-04= 10-961f-82ee72b054a4 --- libgomp/ChangeLog | 6 ++++++ libgomp/target.c | 7 ++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git libgomp/ChangeLog libgomp/ChangeLog index 7ce0cdb42e14..99417ef62cf0 100644 --- libgomp/ChangeLog +++ libgomp/ChangeLog @@ -1,3 +1,9 @@ +2018-12-09 Thomas Schwinge + Jakub Jelinek + + * target.c (gomp_map_vars): Call gomp_copy_host2dev instead of + devicep->host2dev_func. + 2018-12-08 Jakub Jelinek =20 PR libgomp/87995 diff --git libgomp/target.c libgomp/target.c index 8ebc2a370a16..a62ae2c3e4b3 100644 --- libgomp/target.c +++ libgomp/target.c @@ -957,9 +957,10 @@ gomp_map_vars (struct gomp_device_descr *devicep, size= _t mapnum, /* Set link pointer on target to the device address of the mapped object. */ void *tgt_addr =3D (void *) (tgt->tgt_start + k->tgt_offset); - devicep->host2dev_func (devicep->target_id, - (void *) n->tgt_offset, - &tgt_addr, sizeof (void *)); + /* We intentionally do not use coalescing here, as it's not + data allocated by the current call to this function. */ + gomp_copy_host2dev (devicep, (void *) n->tgt_offset, + &tgt_addr, sizeof (void *), NULL); } array++; } Gr=C3=BC=C3=9Fe Thomas