From patchwork Wed Oct 4 11:08:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tobias Burnus X-Patchwork-Id: 148227 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp49245vqb; Wed, 4 Oct 2023 04:08:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IErohaaKhjAao/3DxSnt9nG2g3C5vBRuoHMYLsDvf6Q8SiGmLvZzjrPhlh1UsntV2WrFaNk X-Received: by 2002:a17:906:5dce:b0:9ad:c89b:482d with SMTP id p14-20020a1709065dce00b009adc89b482dmr1292114ejv.33.1696417734667; Wed, 04 Oct 2023 04:08:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696417734; cv=none; d=google.com; s=arc-20160816; b=M0bntfMT1b6eAUCT5lxph7AjGV1DnhsM9+H3CCPSpQlDqYeH/5LBZmlxqKF/GP8SkH zt8+eSb2XxpO0emgtRzVtHOBA6mD7SVoWgAbCuwh23Q/JgFk1QTdxIwawvXj/yIFuhNd Hlh53ARNcaIm/8aAdib0g92YUiuLD8ffTnuvyzfNNvGPg4mPWnQQSie0bEZu5SaUkR2F JL9rtm1Ns66IfVlwxy7lGAZj3km0K3NwoXoBjqhcztr8Cf+fdc0GzdJMID5veVgYXPGR EBLIolou7LAOYyrCcrKEmtUSxS4pwVSW6Ykdrhsze7skUOnrVxR7WP05B9djl8YYe6Dq KN/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:to:subject:from :content-language:user-agent:mime-version:date:message-id :ironport-sdr:dmarc-filter:delivered-to; bh=ioLK3fM9e5WIyWRAyf/jrpOLgNo7pvnEd1KfTJsUOQ8=; fh=CT9ANdoiYgjVt7HQGxGdzRB+HPa196wDRuos5o/1sIg=; b=vDEWl70qyIJTbOSYU4IMEdj6m8O2CkARrUYng4ejy36XU/6UZexUQZqhPLIW0amto0 VLjcKpceLkNIPG/PlQ37jov7QPpMVaZ9mB1MM7GI9Ab+eCk57/9YG291RRbArz5/gLlf MbuEre3ZZudLJsL8rhVpOd9nxVPspuNBgz3A3TN6XQNme83OgUybed/LH16wOfDP+/rD VR528y6tLSoiuTXKbsJCRHt5sWcCZ9pjPOmDlrPF7y6OJ82Sz3oknP74fXpuBSTqRn1n mecJXg6+r+zVx02PY2F2D2yDoMSKgDqSvHcHwzDSUM6se3jCbYkcXvzeqQkvRZg68Gn+ Jw1Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id ot29-20020a170906ccdd00b009a0955a7acesi1555745ejb.278.2023.10.04.04.08.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 04:08:54 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9F10F385696A for ; Wed, 4 Oct 2023 11:08:46 +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 50E083858CDB for ; Wed, 4 Oct 2023 11:08:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 50E083858CDB 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-CSE-ConnectionGUID: S8RFb68iTsa4b6H6fgDnpQ== X-CSE-MsgGUID: GW7X8iSbQqyBlUiNOZFdEQ== X-IronPort-AV: E=Sophos;i="6.03,200,1694764800"; d="diff'?scan'208";a="20934754" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa1.mentor.iphmx.com with ESMTP; 04 Oct 2023 03:08:20 -0800 IronPort-SDR: w0sAUX2Tn8JvbRQee3eTZsIIIGo/glh+ZdhJcjgFXf2Q7/jxS1nMWuKjAdMWQ0RV5CoLO9LM4P J6yucNNEcUyaEJajQBQv1dOUk3yYAp8z3rKH+KccfdbvytWoHI3mm0C81z4CKDWrO/w8HwD8k7 9+aBWX6w4lnA46r8P7X7080J1M2E0zEr5vKyEp0VuwC1YX08HZJS2I9WK/B2s8q8nkgYGbhS6j /y3gzthWuzn9futRtnWDcuKSwU7rEcmzLKzFx4WHFMiqW86XK+iaUKxHs43yJn0Xvx5j76N75b BbE= Message-ID: <1d94d208-6e24-4ab7-a204-a6a152abd496@codesourcery.com> Date: Wed, 4 Oct 2023 13:08:15 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US From: Tobias Burnus Subject: [Patch] libgomp.texi: Clarify that no other OpenMP context selectors are implemented To: gcc-patches , Jakub Jelinek 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=-11.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, KAM_SHORT, 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 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778822922345404804 X-GMAIL-MSGID: 1778822922345404804 I got confused myself when reading https://gcc.gnu.org/onlinedocs/libgomp/OpenMP-Context-Selectors.html Especially with regards to other platforms like PowerPC. It turned out that the list is complete, kind of. For 'arch' and 'isa' those are the only ones - if we want to have more, it has to be implemented (→ cf. PR105640). For 'kind': The host compiler always matches 'kind=host'; this also applies to AMD GCN and Nvidia PTX - when compiled as stand-alone compiler. Those two also match 'kind=gpu' (both as stand-alone compiler(*) and for offloading). The attached documentation patch attempts to clarify this for both users – and for implementers, for the latter, there is also a comment in the .texi with more details. Comments, suggestions, remarks? Tobias (*) This could be changed by checking for "#ifndef ACCEL_COMPILER" in gcc/config/{gcn/nvptx}/ but that does not seem to be worthwhile. ----------------- 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 libgomp.texi: Clarify that no other OpenMP context selectors are implemented libgomp/ChangeLog: * libgomp.texi (OpenMP Context Selectors): Clarify 'kind' trait and that other target archs have no 'arch'/'isa' traits implemented. diff --git a/libgomp/libgomp.texi b/libgomp/libgomp.texi index f21557c3c52..d24f590fd84 100644 --- a/libgomp/libgomp.texi +++ b/libgomp/libgomp.texi @@ -4982,18 +4982,27 @@ smaller number. On non-host devices, the value of the @code{vendor} is always @code{gnu}. References are to the GCC manual. -@multitable @columnfractions .60 .10 .25 -@headitem @code{arch} @tab @code{kind} @tab @code{isa} +@c NOTE: Only the following selectors have been implemented. To add +@c additional traits for target architecture, TARGET_OMP_DEVICE_KIND_ARCH_ISA +@c has to be implemented; cf. also PR target/105640. +@c For offload devices, add *additionally* gcc/config/*/t-omp-device. + +For the host compiler, @code{kind} always matches @code{host}; for the +offloading architectures AMD GCN and Nvidia PTX, @code{kind} always matches +@code{gpu}. For the x86 family of computers, AMD GCN and Nvidia PTX +the following traits are supported in addition; while OpenMP is supported +on more architectures, GCC currently does not match any @code{arch} or +@code{isa} traits for those. + +@multitable @columnfractions .65 .30 +@headitem @code{arch} @tab @code{isa} @item @code{x86}, @code{x86_64}, @code{i386}, @code{i486}, @code{i586}, @code{i686}, @code{ia32} - @tab @code{host} @tab See @code{-m...} flags in ``x86 Options'' (without @code{-m}) @item @code{amdgcn}, @code{gcn} - @tab @code{gpu} @tab See @code{-march=} in ``AMD GCN Options''@footnote{Additionally, @code{gfx803} is supported as an alias for @code{fiji}.} @item @code{nvptx} - @tab @code{gpu} @tab See @code{-march=} in ``Nvidia PTX Options'' @end multitable