From patchwork Mon May 16 10:28:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tobias Burnus X-Patchwork-Id: 54029 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 94FF73857830 for ; Mon, 16 May 2022 10:29:11 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa1.mentor.iphmx.com (esa1.mentor.iphmx.com [68.232.129.153]) by sourceware.org (Postfix) with ESMTPS id 8DCF5385736B for ; Mon, 16 May 2022 10:28:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8DCF5385736B 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.91,229,1647331200"; d="diff'?scan'208";a="78575621" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa1.mentor.iphmx.com with ESMTP; 16 May 2022 02:28:51 -0800 IronPort-SDR: uPLnZczwGK3tEMMdRJVs2cehV0Q7+FzNxccUVLrYZuKr7rjvbU6/omUW7P7R4Ap8Ir4a7vhew4 q7gJkpU6mf3rQzXGu2H2RPNYVNLHrBrweOq1e/D+TXAY5Ok6yLh9eJ9PxTjCQH7hK+9PHzWaaX UtA+M25tlNtbhvTyql5ROGZqLEmGbewKpGXKDU0UKXbicG1O3tpnGPWHMgINju5R/5p9cj9lIq pqQIoKzkY5gjTW4rNleMw09vYnYX+3BQvaLPwyeHnx5c1pDWqsdATvM5VUiyv2Ia9A9mmceLob LRc= Message-ID: <9b95320b-bd67-7528-e62d-7144f68aec2a@codesourcery.com> Date: Mon, 16 May 2022 12:28:45 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Content-Language: en-US To: gcc-patches , Jakub Jelinek , Andrew Stubbs From: Tobias Burnus Subject: [Patch] gcn/t-omp-device: Add 'amdgcn' as 'arch' [PR105602] 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=-11.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" While 'vendor' and 'kind' is well defined, 'arch' and 'isa' isn't. When looking at an 'metadirective' testcase (which oddly uses 'arch(amd)'), I noticed that LLVM uses 'arch(amdgcn)' while we use 'gcn', cf. e.g. 'clang/lib/Headers/openmp_wrappers/math.h'. (Side note: we use the target triplet amdgcn-amdhsa and LLVM uses amdgcn-amd-amdhsa.) Given the target triplet, the LLVM choice seems to make more sense; 'gcn' only shows up as directory name (under gcc/config + libgomp/). Thus, I think we have two options: * Either also change to (only) 'amdgcn' - given that the supported arch() values are neither documented not yet widely used. * Or add 'amdgcn' alongside 'gcn' - which is what the attached patch does. Which option do you prefer? Other thoughts? Tobias PS: I think during the GCC 13 development, we should start adding more offload-target documentation, including documenting the used/permitted vendor/arch/isa context selectors. ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955 gcn/t-omp-device: Add 'amdgcn' as 'arch' [PR105602] Improve cross-compiler handling. gcc/ChangeLog: PR target/105602 * config/gcn/t-omp-device (arch): Add 'amdgcn' besides existing 'gcn'. diff --git a/gcc/config/gcn/t-omp-device b/gcc/config/gcn/t-omp-device index cd56e2f8a68..e1d9e0d2a1e 100644 --- a/gcc/config/gcn/t-omp-device +++ b/gcc/config/gcn/t-omp-device @@ -1,4 +1,4 @@ omp-device-properties-gcn: $(srcdir)/config/gcn/gcn.cc echo kind: gpu > $@ - echo arch: gcn >> $@ + echo arch: amdgcn gcn >> $@ echo isa: fiji gfx900 gfx906 gfx908 >> $@