From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 102778 invoked by alias); 22 Oct 2015 18:19:19 -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 102764 invoked by uid 89); 22 Oct 2015 18:19:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 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; Thu, 22 Oct 2015 18:19:17 +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 23BD960; Thu, 22 Oct 2015 18:19:16 +0000 (UTC) Received: from localhost.localdomain (vpn1-6-179.ams2.redhat.com [10.36.6.179]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t9MIJEUq021849; Thu, 22 Oct 2015 14:19:14 -0400 Subject: Re: [gomp4 00/14] NVPTX: further porting To: Alexander Monakov References: <1445366076-16082-1-git-send-email-amonakov@ispras.ru> <562779F9.9070800@redhat.com> <20151022095442.GN478@tucnak.redhat.com> <56291A01.7090007@redhat.com> Cc: Jakub Jelinek , gcc-patches@gcc.gnu.org, Dmitry Melnik From: Bernd Schmidt Message-ID: <562928A2.6060209@redhat.com> Date: Thu, 22 Oct 2015 18:27:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-10/txt/msg02325.txt.bz2 On 10/22/2015 08:08 PM, Alexander Monakov wrote: > On Thu, 22 Oct 2015, Bernd Schmidt wrote: > >> I'm not really familiar with OpenMP and what it allows, so take all my >> comments with a grain of salt. >> >> On 10/22/2015 06:41 PM, Alexander Monakov wrote: >>> The second approach is to run all threads in the warp all the time, making >>> sure they execute the same code with the same data, and thus build up the >>> same >>> local state. >> >> But is that equivalent? If each thread takes the address of a variable on its >> own stack, that's not the same as taking an address once and broadcasting it. > > Taking the address yields the same pointer in all threads in PTX. Even if it > didn't, broadcasting the pointer is pointless, as stacks are thread-private. It doesn't yield a pointer pointing to the same location in memory, which is the point. If you then have code operating on the location being pointed to, behaviour would be different than what you'd expect if you were on the host and broadcasted the pointer. The problem is that you may get a user programs which have this behaviour, and which may not be supportable. I think that is what Jakub was trying to say (correct me if I'm wrong). Bernd