From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa2.mentor.iphmx.com (esa2.mentor.iphmx.com [68.232.141.98]) by sourceware.org (Postfix) with ESMTPS id 49EC43858D38 for ; Wed, 12 Oct 2022 17:25:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 49EC43858D38 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-IronPort-AV: E=Sophos;i="5.95,179,1661846400"; d="scan'208";a="84677754" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa2.mentor.iphmx.com with ESMTP; 12 Oct 2022 09:25:50 -0800 IronPort-SDR: xzOEvVScRqME7CWyDpK5M2mlOlss0YeKmVkGJEOxOsee+Soa9ePbtGrNrBU7Dwjt+pYWvuaeH6 4ax74v23D/F69neESAVVbeImmEflXRa1VLFO7qnGo1LAh7lbx3sGtt+XIal80J/9/KXmg4+dhk 6ncnvPxmyBQoVvDN/mLNZ5RmbxF3E4wWdWWy30ahaDuFw+0LjwuOTWpptBbn1CVOtrDaoyQWK7 BX9CsJZGJCKoA6LjWRhPar642tyaXPEF8AytaH92AaAKPd97Y4Vq+Y0Ng+wlgKkF/zQnjzv/xZ trM= Message-ID: <9db71683-f09f-64fd-2ee5-d54a7abcc7d6@codesourcery.com> Date: Wed, 12 Oct 2022 19:25:45 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.2 Subject: Re: [Patch] libgomp/gcn: Prepare for reverse-offload callback handling Content-Language: en-US To: Andrew Stubbs , gcc-patches CC: Jakub Jelinek References: <55dacdd3-4a82-8087-fdba-824d9910e186@codesourcery.com> <02ec5f29-953b-63dd-7d44-04f9af36a114@codesourcery.com> <1c5166f4-91d2-b320-7fd9-6831c7e26342@codesourcery.com> <3a0eb685-6bb7-ed30-4024-887452c015fd@codesourcery.com> From: Tobias Burnus In-Reply-To: <3a0eb685-6bb7-ed30-4024-887452c015fd@codesourcery.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: quoted-printable X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-11.mgc.mentorg.com (139.181.222.11) To svr-ies-mbx-12.mgc.mentorg.com (139.181.222.12) X-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_00,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,NICE_REPLY_A,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 12.10.22 19:09, Andrew Stubbs wrote: > On 12/10/2022 15:29, Tobias Burnus wrote: > > Right, sorry, the buffer is circular, but the counter is linear. It > simplified reservation that way, but it does mean that there's a limit > to the number of times the buffer can cycle before the counter > saturates. (You'd need to stream out gigabytes of data to hit the > limit though.) Or in other words, you can have 2^32 =3D 4,294,967,296 (write chunks + reverse offloads) per kernel launch. > ... >> PS: Currently, device stack variables are private and cannot be >> accessed from the host; this will change in a separate patch. [...] > So, the patch, as is, is known to be non-functional? How can you have > tested it? For the addrs_sizes_kind data to be accessible the > asm("s8") has to be wrong. I have tested the non-addrs_sizes_kind part only, which permits to run reverse-offload functions just fine, but only if they do not use firstprivate or map. =E2=80=94 And I actually also tested with the addrs_sizes_kind part but that unsurprisingly fails hard when trying to copy the stack data. > I think the patch looks good, in principle. The use of the existing > ring-buffer is the right way to do it, IMO. Can we get the manually > allocated stacks patch in first and then follow up with these patches > when they actually work? I stash this patch as: "OK =E2=80=93 but ams still want to have a glance on= ce __builtin_gcn_kernarg_ptr is in". I terms of having fewer *.diff files around, I of course would prefer to just change one line in a follow-up commit instead of keeping a full patch around, but holding off until __builtin_gcn_kernarg_ptr is ready + the default has changed to non-private stack variables is also fine. Tobias ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstra=C3=9Fe 201= , 80634 M=C3=BCnchen; Gesellschaft mit beschr=C3=A4nkter Haftung; Gesch=C3= =A4ftsf=C3=BChrer: Thomas Heurung, Frank Th=C3=BCrauf; Sitz der Gesellschaf= t: M=C3=BCnchen; Registergericht M=C3=BCnchen, HRB 106955