From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 120692 invoked by alias); 6 Dec 2018 17:57:39 -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 120677 invoked by uid 89); 6 Dec 2018 17:57:39 -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,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:2702 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 06 Dec 2018 17:57:37 +0000 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7A37AC0740E3; Thu, 6 Dec 2018 17:57:36 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-117-214.ams2.redhat.com [10.36.117.214]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1CC2E226E8; Thu, 6 Dec 2018 17:57:35 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id wB6HvXVC003236; Thu, 6 Dec 2018 18:57:33 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id wB6HvV6E003235; Thu, 6 Dec 2018 18:57:31 +0100 Date: Thu, 06 Dec 2018 17:57:00 -0000 From: Jakub Jelinek To: Thomas Schwinge Cc: gcc-patches@gcc.gnu.org, Martin Jambor , Alexander Monakov , Chung-Lin Tang Subject: Re: [RFC PATCH] Coalesce host to device transfers in libgomp Message-ID: <20181206175731.GU12380@tucnak> Reply-To: Jakub Jelinek References: <20171024095527.GJ14653@tucnak> <20171025113850.GR14653@tucnak> <87mupisi6b.fsf@euler.schwinge.homeip.net> <20181206171856.GS12380@tucnak> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) X-IsSubscribed: yes X-SW-Source: 2018-12/txt/msg00383.txt.bz2 On Thu, Dec 06, 2018 at 06:54:20PM +0100, Thomas Schwinge wrote: > 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 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)? > > > > 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 PTX > > 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. 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 coalesced. > > 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 > > 2018-12-06 Thomas Schwinge > Jakub Jelinek > > libgomp/ > * target.c (gomp_map_vars): Call "gomp_copy_host2dev" instead of > "devicep->host2dev_func". Ok for trunk, thanks. Perhaps no need for the "s in the ChangeLog. > --- > 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 = (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++; > } Jakub