From patchwork Sat Oct 14 19:43:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tobias Burnus X-Patchwork-Id: 152956 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp2635723vqb; Sat, 14 Oct 2023 12:43:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGIzWnwR+CSu6/ji41t9hS9o8DhgvUQhYS0EiUIKAKlcFX4Iz7/2vMUb6RPO9qcxiWHX0ou X-Received: by 2002:a05:622a:14d:b0:418:1f52:1421 with SMTP id v13-20020a05622a014d00b004181f521421mr37777370qtw.9.1697312626191; Sat, 14 Oct 2023 12:43:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697312626; cv=pass; d=google.com; s=arc-20160816; b=fn/EZ/VbEvcRlX2yO8iVV7kfYLlnKLMC+aZ/hQY3rLOTI34mKMQrNWXkd8PoKQqsKX aV9i16Ar0xMz3jdH4PUmnZ6xFiwMVTGaLDgX9ZZHpSKg5IsaUmIwoTShYXCuNSb1To0s /Eqws3sEjOco/9FhwJmYgkNRjjrX0ZgsoDuvsmUInlWVQ/zcWaCo72H/Y9RDn7GfVHC2 E7sB9B57WEQgHAbpPnSSrLDRpyCwbSPdfID1i+3Dzg7Py43sLeUYG8L8oKGumR7YUTck d/3UdFFOCHb3KhJMLqlHg562n3nhb0ZmQDfqIoV/RkmumcfDNvqjYvJKLHV5SCae9OPw xuUQ== ARC-Message-Signature: i=2; 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:subject:from:to :content-language:user-agent:mime-version:date:message-id :ironport-sdr:dmarc-filter:arc-filter:delivered-to; bh=JHbWmaKCRyykVc7a8zC1KPO6lcrOgQZgDKvqPfzKmZ4=; fh=qkNWUlRBZkew0ISI4uevDbSSAIG4eEcsJO0pUMvFaAo=; b=nChmVhwF2P8IK5ibcvbqGbmAb1cQXDV66nxoikQSpcqdx/8O8hV9vmc+NAJZMVnI/v QWmy3b4LhThImwiebozJrNglpnKHT6FhGntjoSLAK6DARqbff5IfRt6JmkgfL11y9y/f s11nBkMwE8N9Cj/O8ZOOK29Rc4HdayKntcXHhv+VTM8ydMfHkqzqknLsuPSf3ern+ebk WlDjZxkaQBMIv+z3qvbUhNDraA8mspPZSu5XhTbeO4m55bGG6ACDRi5lLscqpZ44P1bq ZhRirEyxBYpu4l9HOlG1wIqMdLATke36lss0AiU3YTnZTpE0+yMrtQqUZ0SFObEgtaVz GwXA== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); 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 c17-20020a05622a059100b0041961342cb5si3137020qtb.431.2023.10.14.12.43.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Oct 2023 12:43:46 -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; arc=pass (i=1); 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 E0A62385772D for ; Sat, 14 Oct 2023 19:43:45 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa3.mentor.iphmx.com (esa3.mentor.iphmx.com [68.232.137.180]) by sourceware.org (Postfix) with ESMTPS id 358EA3858032 for ; Sat, 14 Oct 2023 19:43:21 +0000 (GMT) ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 358EA3858032 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=68.232.137.180 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697312603; cv=none; b=OMtKT9bDklJdAaV6Ho3+au8YNBmwQgcL+gECHaWssa6rp4/+IGcJ6Tm+NJn8DLzI21v7CfBFG3B9aGjfB0PrYpUXLIlEnk5QLwCsWxY35awexScVj79+0N0M+kuXnnK5DIW2gPunYWVlfkpud3kiZuHkpcuCA02+oPtWH8ICj8g= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697312603; c=relaxed/simple; bh=MYOEYQq0Q9IlTsPGoxTubKtg8QaAe5yl/3m0pNpltaQ=; h=Message-ID:Date:MIME-Version:To:From:Subject; b=o3ctNKJ5YrzywU8m1TmOcd7QSH/lmSDLooeVJq1o7bZCynIBFea+rXMQ+yj3TJs3Wbe95iS9KPSsqOw3kSNEa5+5r9KBgYfs9DiAfdulS25FRduNfCwnNK7Q4qTjT5oYihZGu8E8LDTKV2jB85jKKfGRjIq/nq3Leg+aOEGmuhs= ARC-Authentication-Results: i=1; server2.sourceware.org DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 358EA3858032 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: 54gwsGDNRnamPSgzq1pdSA== X-CSE-MsgGUID: EmhK4nYeQxOd1N2w//JW8A== X-IronPort-AV: E=Sophos;i="6.03,224,1694764800"; d="diff'?scan'208";a="19519072" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa3.mentor.iphmx.com with ESMTP; 14 Oct 2023 11:43:19 -0800 IronPort-SDR: ow5vrrHxrfW6BGJnkuu+yhHeWkMoz6rPaJplm+Us0Pfyy1gnLyYMvz2q/XfXiPUQMGSKOMmSxS 4IkD8YQP5EMshkvSljdjZy6NSfHTxnjZOZo/YiqY4eBN+pAVIgo5Q2TlWBPGdVC51D9+Vaxlcj R6gmS3htG+KRmIxmsiYuNov158Rpc8L8S3DKXQIdzF7YmLVpI+c2YVacUX3hJg/Bc2ZdEqNRCE AvaoTTBBOJGj/56x7utisPGP35AT/wnEhCviV0pyZr1v7MMvHJooGJWpXgweX3tryw9DDh7/x6 gG0= Message-ID: <507d6d48-1ca1-411a-a95d-45adb7a8f446@codesourcery.com> Date: Sat, 14 Oct 2023 21:43:14 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: gcc-patches , Sandra Loosemore , Jakub Jelinek From: Tobias Burnus Subject: [patch] libgomp.texi: Update "Enabling OpenMP" 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: 1779761284324156382 X-GMAIL-MSGID: 1779761284324156382 When browsing libgomp doc, I came across https://gcc.gnu.org/onlinedocs/libgomp/Enabling-OpenMP.html First, I found especially the Fortran part difficult to read. Secondly, it missed the C++ attribute syntax. And I also missed a reference to -fopenmp-simd. The attached patch tries to improve this. Note that it talks about C and C++ attributes, even though C23's [[omp::]] support has not yet landed. (But is expected very soon.) I also do not try to list what -fopenmp-simd supports as that's at https://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html#index-fopenmp and I bet we won't keep both in sync and "man gcc" is more likely to be up to date. Comments? Tobias ----------------- 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: Update "Enabling OpenMP" libgomp/ * libgomp.texi (Enabling OpenMP): Update for C/C++ attributes; improve wording especially for Fortran; mention -fopenmp-simd. diff --git a/libgomp/libgomp.texi b/libgomp/libgomp.texi index 526d1be2955..d8126f96fe4 100644 --- a/libgomp/libgomp.texi +++ b/libgomp/libgomp.texi @@ -136,15 +136,22 @@ changed to GNU Offloading and Multi Processing Runtime Library. @node Enabling OpenMP @chapter Enabling OpenMP -To activate the OpenMP extensions for C/C++ and Fortran, the compile-time -flag @command{-fopenmp} must be specified. This enables the OpenMP directive -@code{#pragma omp} in C/C++ and @code{!$omp} directives in free form, -@code{c$omp}, @code{*$omp} and @code{!$omp} directives in fixed form, -@code{!$} conditional compilation sentinels in free form and @code{c$}, -@code{*$} and @code{!$} sentinels in fixed form, for Fortran. The flag also -arranges for automatic linking of the OpenMP runtime library +To activate the OpenMP extensions for C/C++ and Fortran, the compile-time +flag @command{-fopenmp} must be specified. For C and C++, this enables +the handling of the OpenMP directives using @code{#pragma omp} and the +@code{[[omp::directive(...)]]}, @code{[[omp::sequence(...)]]} and +@code{[[omp::decl(...)]]} attributes. For Fortran, it enables for +free source form the @code{!$omp} sentinel for directives and the +@code{!$} conditional compilation sentinel and for fixed source form the +@code{c$omp}, @code{*$omp} and @code{!$omp} sentinels for directives and +the @code{c$}, @code{*$} and @code{!$} conditional compilation sentinels. +The flag also arranges for automatic linking of the OpenMP runtime library (@ref{Runtime Library Routines}). +The @command{-fopenmp-simd} flag can be used to enable a subset of +OpenMP directives, which do not require the linking of neither the +OpenMP runtime library nor the POSIX threads library. + A complete description of all OpenMP directives may be found in the @uref{https://www.openmp.org, OpenMP Application Program Interface} manuals. See also @ref{OpenMP Implementation Status}.