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: 1843232 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S0sPc4h0Dz1ypx for ; Wed, 4 Oct 2023 22:08:36 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9D2B73856DDC for ; Wed, 4 Oct 2023 11:08:34 +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+incoming=patchwork.ozlabs.org@gcc.gnu.org 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