From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 115010 invoked by alias); 6 Dec 2018 17:54:32 -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 114997 invoked by uid 89); 6 Dec 2018 17:54:32 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: =?ISO-8859-1?Q?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=gr, gr=c3=bc=c3, coalesce, H*Ad:D*cz?= 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; Thu, 06 Dec 2018 17:54:30 +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 1gUxr1-0003nr-NF from Thomas_Schwinge@mentor.com ; Thu, 06 Dec 2018 09:54:27 -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; Thu, 6 Dec 2018 17:54:24 +0000 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: <20181206171856.GS12380@tucnak> References: <20171024095527.GJ14653@tucnak> <20171025113850.GR14653@tucnak> <87mupisi6b.fsf@euler.schwinge.homeip.net> <20181206171856.GS12380@tucnak> User-Agent: Notmuch/0.9-101-g81dad07 (http://notmuchmail.org) Emacs/25.2.2 (x86_64-pc-linux-gnu) Date: Thu, 06 Dec 2018 17: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/msg00382.txt.bz2 Hi Jakub! On Thu, 6 Dec 2018 18:18:56 +0100, Jakub Jelinek wrote: > 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 noticed t= he > > following unrelated hunk. Is that intentional or just an oversight that > > it hasn't been included in your "gomp_coalesce_buf" changes (quoted bel= ow > > 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 the P= TX > code. 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. > Perhaps we could do the change but pass NULL instead > of cbufp as the last argument? Like this? commit 241027a03b70c788ef94ccf258b799332fb1b20e Author: Thomas Schwinge Date: Thu Dec 6 18:53:16 2018 +0100 Coalesce host to device transfers in libgomp: not for link pointer =20=20=20=20 2018-12-06 Thomas Schwinge Jakub Jelinek =20=20=20=20 libgomp/ * target.c (gomp_map_vars): Call "gomp_copy_host2dev" instead of "devicep->host2dev_func". --- libgomp/target.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git libgomp/target.c libgomp/target.c index 8ebc2a370a16..60f4c96f3908 100644 --- libgomp/target.c +++ libgomp/target.c @@ -957,9 +957,11 @@ 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