From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 67486 invoked by alias); 9 Nov 2015 14:10:46 -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 67441 invoked by uid 89); 9 Nov 2015 14:10:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 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 (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 09 Nov 2015 14:10:41 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 976713DD42; Mon, 9 Nov 2015 14:10:39 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-116-34.ams2.redhat.com [10.36.116.34]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tA9EAbQ6032758 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 9 Nov 2015 09:10:39 -0500 Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id tA9EAamK025262; Mon, 9 Nov 2015 15:10:36 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id tA9EAY8h025261; Mon, 9 Nov 2015 15:10:34 +0100 Date: Mon, 09 Nov 2015 14:10:00 -0000 From: Jakub Jelinek To: Nathan Sidwell Cc: GCC Patches , Cesar Philippidis Subject: Re: OpenACC Firstprivate Message-ID: <20151109141034.GS5675@tucnak.redhat.com> Reply-To: Jakub Jelinek References: <563E01A4.20607@acm.org> <20151109134619.GQ5675@tucnak.redhat.com> <5640A6B3.3030409@acm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5640A6B3.3030409@acm.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes X-SW-Source: 2015-11/txt/msg00964.txt.bz2 On Mon, Nov 09, 2015 at 08:59:15AM -0500, Nathan Sidwell wrote: > >This I'm afraid performs often two copies rather than just one (one to copy > >the host value to the present_copyin mapped value, another one in the > >region), > > I don't think that can be avoided. The host doesn't have control over when > the CTAs (a gang) start -- they may even be serialized onto the same > physical HW. So each gang has to initialize its own instance. Or did you > mean something else? So, what is the scope of the private and firstprivate vars in OpenACC? In OpenMP if a variable is private or firstprivate on the target construct, unless further privatized in inner constructs it is really shared among all the threads in all the teams (ro one var per all CTAs/workers in PTX terms). Is that the case for OpenACC too, or are the vars e.g. private to each CTA already or to each thread in each CTA, something different? If they are shared by all CTAs, then you should hopefully be able to use the GOMP_MAP_FIRSTPRIVATE{,_INT}, if not, then I'd say you should at least use those to provide you the initializer data to initialize your private vars from as a cheaper alternative to mapping. Jakub