From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa3.mentor.iphmx.com (esa3.mentor.iphmx.com [68.232.137.180]) by sourceware.org (Postfix) with ESMTPS id ACF1F3858C50 for ; Tue, 27 Sep 2022 13:15:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org ACF1F3858C50 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.93,349,1654588800"; d="scan'208,217";a="83574390" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa3.mentor.iphmx.com with ESMTP; 27 Sep 2022 05:15:35 -0800 IronPort-SDR: Q5eNqSfSNj1omcmnHOMQBL2G/v2IbqX+icoxQX+9MwTyqysqxtWNhXB5Y6FxJNwc8l0T+JTElN tDlSQtwuu1eCQMNS3qqNAXx7exbrJxF+oml7yeu4/IOekIrnBb7TnO4jgNgpgfDF1wx5RHJcOj 7ImV5O9Eu5k6nc/JDT0YIWhxW9L8DT6q3OoHIrFXBreEXT/LhNLadDYbkiK+fe4c8u/+ZfHxae KOWObXuMDYfQSCCyXq7wbI88ntkOla/f77z0sxeSfIJDhcTCyXf0K/bRquFXJtQjGCVB7mF5zt 47A= Content-Type: multipart/alternative; boundary="------------b5YQ68wSmjiw0dU0mGLuO5rF" Message-ID: Date: Tue, 27 Sep 2022 15:15:27 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.0 Content-Language: en-US To: gcc-patches , Andrew Stubbs CC: Jakub Jelinek From: Tobias Burnus Subject: [Patch] libgomp/gcn: Prepare for reverse-offload callback handling X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-12.mgc.mentorg.com (139.181.222.12) 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,HTML_MESSAGE,KAM_DMARC_STATUS,KAM_SHORT,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: --------------b5YQ68wSmjiw0dU0mGLuO5rF Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: quoted-printable This patch adds support to handle reverse offload to libgomp's plugin-gcn.c= and to AMD GCN's libgomp target.c. In theory, that's all whats needed for GCN =E2=80=93 in practice there a kn= own issue with private stack variables which has to be addressed independently. Once this = and the target.c generic code is committed, omp requires reverse-offload support can be claimed for the device (=E2=86=92 GOMP_OFFLOAD_get_num_devic= es). Note: Contrary to nvptx, the code to handle reverse offload is already enab= led if there is 'omp requires reverse_offload' (+ target functions) in the code; for nvptx, an actual reverse-offload-target region has to exist in the code. This probably does not matter that much in practice. The '#if 1' code block inside plugin-gcn.c has to be replaced by the target.c/libgomp-plugins.h/libgomp.h/libgomp.map patch that is part of the patch: https://gcc.gnu.org/pipermail/gcc-patches/2022-September/6023= 21.html "[Patch] libgomp/nvptx: Prepare for reverse-offload callback handling" Andrew did suggest a while back to piggyback on the console_output handling, avoiding another atomic access. - If this is still wanted, I like to have s= ome guidance regarding how to actually implement it. Comments, suggestions? If not, OK for mainline?* Tobias *Without the '#if 1' code and once the non-nvptx bits of the other patch have been approved and committed. ----------------- 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 --------------b5YQ68wSmjiw0dU0mGLuO5rF--