From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 52877 invoked by alias); 21 Oct 2015 14:59:37 -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 52867 invoked by uid 89); 21 Oct 2015 14:59:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 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; Wed, 21 Oct 2015 14:59:31 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id D7FBB9134B; Wed, 21 Oct 2015 14:59:29 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-116-53.ams2.redhat.com [10.36.116.53]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t9LExRFH009472 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 21 Oct 2015 10:59:29 -0400 Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id t9LExQN1011397; Wed, 21 Oct 2015 16:59:26 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id t9LExOm3011396; Wed, 21 Oct 2015 16:59:24 +0200 Date: Wed, 21 Oct 2015 15:02:00 -0000 From: Jakub Jelinek To: Alexander Monakov Cc: gcc-patches@gcc.gnu.org, Dmitry Melnik Subject: Re: [gomp4 10/14] libgomp: arrange a team of pre-started threads via gomp_nvptx_main Message-ID: <20151021145924.GW478@tucnak.redhat.com> Reply-To: Jakub Jelinek References: <1445366076-16082-1-git-send-email-amonakov@ispras.ru> <1445366076-16082-11-git-send-email-amonakov@ispras.ru> <20151021094314.GQ478@tucnak.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes X-SW-Source: 2015-10/txt/msg02090.txt.bz2 On Wed, Oct 21, 2015 at 05:40:24PM +0300, Alexander Monakov wrote: > On Wed, 21 Oct 2015, Jakub Jelinek wrote: > > > -#if defined HAVE_TLS || defined USE_EMUTLS > > > +#if defined __nvptx__ > > > +extern struct gomp_thread *nvptx_thrs; > > > > What kind of address space is this variable? It should be > > a per-CTA var, so that different teams have different, and > > simultaneous target regions have different too. > > As written it's in global accelerator memory. Indeed it's broken with > simultaneous target regions, and to unbreak that I'd like to place it in > shared memory (but that would require expanding address-space support > a bit more, exposing shared-memory space to C source code). Or declare the pointer in inline asm and read from it in inline asm (and ditto for initialization)? Perhaps at least short term. > > I'm surprised that for team.c you chose to adjust the shared source, > > rather than copy and remove all the cruft you don't need/want. > > > > That includes the LIBGOMP_USE_PTHREADS guarded parts, all the thread binding > > stuff etc. I'd like to see at least for comparison how much actually > > remained in there. > > Diffstat for the copy/remove patch is 66+/474-, almost all of removed 470 > lines are in gomp_team_start, which counts only ~150 lines after removals. I think I prefer config/nvptx/team.c including the toplevel team.c, where you ifdef out all of gomp_thread_start and gomp_team_start in there, and define it yourself in config/nvptx/team.c. After removing non-PTX related stuff, gomp_thread_start is like 65 lines including comments/blank lines, and gomp_team_start is 85 lines. Note I've also removed the nested parallelism handling from there, you can't support that without dynamic parallelism. And you'll surely want to tweak it even more. Jakub