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 B64A9385840C for ; Mon, 24 Oct 2022 19:46:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B64A9385840C 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,210,1661846400"; d="scan'208";a="85439876" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa2.mentor.iphmx.com with ESMTP; 24 Oct 2022 11:46:29 -0800 IronPort-SDR: 5xQyLxTZENlSloDc3wDeBfdYR9lg4xmTsgMnrCL8SfZt876e0l9GayEO4/aTtRB8VLEMz8H58W CVgQE0vVqqhje3UiRNphhbuFJ8mb7tW5MALTkUGgnBCUNIdYNVMA9ZVItUXyRQR70Q44p6oCfr yTIjuuI80DiML2EcLFXnVPi5ce3h8n612rywG+D4Gc/8wnuiv6Gx/1HOBuwdawmPWSw3oMmU2H E1AZGzIXvZWIBld8tSRa6xa4n/ug/PQXhmHwpeGwQ9fg43GNqt5G7XsJDWMA0TEBnVJQVshGN1 L98= Message-ID: <3e0d4458-de8d-bb62-3532-eeadcdfaa957@codesourcery.com> Date: Mon, 24 Oct 2022 21:46:22 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.3 Subject: Re: [Patch][v5] libgomp/nvptx: Prepare for reverse-offload callback handling Content-Language: en-US To: Thomas Schwinge , Jakub Jelinek CC: Alexander Monakov , References: <3f0fc49f-b07f-bee2-51a8-a5d03f1c33ed@codesourcery.com> <30e3ed49-0d14-8015-57ef-3d70b1dea69a@codesourcery.com> <3ebce406-46e4-8f98-8c53-83b61423644e@codesourcery.com> <798d7ee1-2ffa-a591-38cb-a9ad421265d0@codesourcery.com> <832946f-bb12-23d7-7d64-47b85c95125@ispras.ru> <1e56b27f-3c74-8bc2-028b-9091fa1ae7b1@codesourcery.com> <87r0yxoxdh.fsf@euler.schwinge.homeip.net> <87o7u1ox4n.fsf@euler.schwinge.homeip.net> From: Tobias Burnus In-Reply-To: <87o7u1ox4n.fsf@euler.schwinge.homeip.net> 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-10.mgc.mentorg.com (139.181.222.10) To svr-ies-mbx-12.mgc.mentorg.com (139.181.222.12) X-Spam-Status: No, score=-5.4 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=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi Tobias! On 24.10.22 21:11, Thomas Schwinge wrote: > On 2022-10-24T21:05:46+0200, I wrote: >> On 2022-10-24T16:07:25+0200, Jakub Jelinek via Gcc-patches wrote: >>> On Wed, Oct 12, 2022 at 10:55:26AM +0200, Tobias Burnus wrote: >>>> libgomp/nvptx: Prepare for reverse-offload callback handling > Well. > + struct rev_offload *rev_data; > ... but as far as I can tell, this is never initialized in > 'nvptx_open_device', which does 'ptx_dev =3D GOMP_PLUGIN_malloc ([...]);'= . > Would the following be the correct fix (currently testing)? > > --- libgomp/plugin/plugin-nvptx.c > +++ libgomp/plugin/plugin-nvptx.c > @@ -546,6 +546,8 @@ nvptx_open_device (int n) > ptx_dev->omp_stacks.size =3D 0; > pthread_mutex_init (&ptx_dev->omp_stacks.lock, NULL); > > + ptx_dev->rev_data =3D NULL; > + > return ptx_dev; > } LGTM and I think it is obvious =E2=80=93 albeit I am not sure why it did no= t fail when testing it here. Thanks, 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