From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 64212 invoked by alias); 13 Dec 2018 10:19:40 -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 62385 invoked by uid 89); 13 Dec 2018 10:19:40 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=1.8 required=5.0 tests=BAYES_50,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS autolearn=no version=3.3.2 spammy=chunglin, chung-lin, ChungLin, Chung-Lin 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, 13 Dec 2018 10:19:36 +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 841DB30001DF; Thu, 13 Dec 2018 10:19:35 +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 1CD0260A9C; Thu, 13 Dec 2018 10:19:34 +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 wBDAJVmA016581; Thu, 13 Dec 2018 11:19:32 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id wBDAJTEw016580; Thu, 13 Dec 2018 11:19:29 +0100 Date: Thu, 13 Dec 2018 10:19:00 -0000 From: Jakub Jelinek To: cltang@codesourcery.com Cc: Thomas Schwinge , gcc-patches@gcc.gnu.org Subject: Re: [PATCH 4/6, OpenACC, libgomp] Async re-work, libgomp/target.c changes (revised, v2) Message-ID: <20181213101929.GT12380@tucnak> Reply-To: Jakub Jelinek References: <20181206174346.GT12380@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/msg00910.txt.bz2 On Tue, Dec 11, 2018 at 09:47:10PM +0800, Chung-Lin Tang wrote: > I have revised the patch to make both gomp_[un]map_vars and gomp_[un]map_vars_async > point to gomp_[un]map_vars_internal, which is static always_inline. This should > alleviate that part of the concerns. > @@ -263,8 +279,9 @@ gomp_to_device_kind_p (int kind) > } > } > > -static void > +attribute_hidden void > gomp_copy_host2dev (struct gomp_device_descr *devicep, > + struct goacc_asyncqueue *aq, > void *d, const void *h, size_t sz, > struct gomp_coalesce_buf *cbuf) Have you tried sticking the struct goacc_asyncqueue * into struct gomp_coalesce_buf? If that doesn't work for some reason (please explain why), then I'd prefer that argument to come last, not second, various targets have small limits on how many arguments they can pass in registers. > @@ -293,14 +310,23 @@ gomp_copy_host2dev (struct gomp_device_descr *devi > } > } > } > - gomp_device_copy (devicep, devicep->host2dev_func, "dev", d, "host", h, sz); > + if (aq) Can you please use __builtin_expect (aq != NULL, 0) here? Because ptr != NULL test is by default predicted more likely than ptr == NULL and the gomp_device_copy call is in there for both all OpenMP and for OpenACC except for async, so more likely. > + goacc_device_copy_async (devicep, devicep->openacc.async.host2dev_func, > + "dev", d, "host", h, sz, aq); > + else > + gomp_device_copy (devicep, devicep->host2dev_func, "dev", d, "host", h, sz); > } > > -static void > +attribute_hidden void > gomp_copy_dev2host (struct gomp_device_descr *devicep, > + struct goacc_asyncqueue *aq, > void *h, const void *d, size_t sz) > { > - gomp_device_copy (devicep, devicep->dev2host_func, "host", h, "dev", d, sz); > + if (aq) Likewise. Jakub