From patchwork Wed Dec 7 08:08:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tobias Burnus X-Patchwork-Id: 30692 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp47358wrr; Wed, 7 Dec 2022 00:08:52 -0800 (PST) X-Google-Smtp-Source: AA0mqf7h8IA+WvEK6cwxiBhnBLFgRW1PaerpdoFTz3FUa/k9Aq+NRToJq0X+KR7ntVH656qrPxat X-Received: by 2002:a17:906:c042:b0:781:541:8f1d with SMTP id bm2-20020a170906c04200b0078105418f1dmr77033911ejb.117.1670400531903; Wed, 07 Dec 2022 00:08:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670400531; cv=none; d=google.com; s=arc-20160816; b=ng63p9xtSt72GYqfLj7JqY0lJGO1KzBwFxMWa/rCcUDlhveZYFSo/pnGNQFfWrbJO3 2Kt7DitwBj9GuabO0VenzURbSBN14up0zTr99TtvqRO4rjO+XTXUULFOs+yctjJSOsln HxlH/atJUe2+rG4tf1H8SOaLWGPP32CWon4NY8M0Q3XLXBtIxGiRrqsuxEXk3q8uDDW/ Im1sMFs/mi7c/LnbU0xrNlf0v5pqy0fCJqynCNAxJuSZTzMehnD7fCB8OZHwgxUMz/oK kA1xAdFAs1VXy6zyRrCGt+rhKPEz16omecrtZR5By9TYiZHnmay7KwO/b8Q437RNnWTi epRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:in-reply-to:references:to:from :content-language:subject:user-agent:mime-version:date:message-id :ironport-sdr:dmarc-filter:delivered-to; bh=LdmoTklnKb/n1ImrDcd2EY4d9xXi20gVw+3bSs1o8lc=; b=IvGRIsJNvtNCqPzZZdxmf2vQex6sp96c7OsQCEhLDf1TtOCi/z7RExEz8jIRQeRGsO waaETrAi4aCzU/o46BF/QLeGj0EtsIuFIHv0+seh5uhXxVjw5R4YpypPs114mDBwLwm2 yS270tYrTkvdMqvRBQxhWPu7n0x3T+JIpMwsJBPROqA0xSNrk8BI33m67mpaD8vCxQCQ zZpBJFGIP8251ygVfRa5sDtPzfMsrP7aizRSfro6C6a/gNWV02mRW5ePm8GTUszTBfTC OEouC6qUfJdyTfaPIMHEzDIJF3e0elyALuXn+v4UFVZTly+4FAZ+Y8e/b57HKmF5RYZY zL1w== 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 sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id lg15-20020a170906f88f00b007be268708b3si13263799ejb.926.2022.12.07.00.08.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Dec 2022 00:08:51 -0800 (PST) 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 D960C392B10D for ; Wed, 7 Dec 2022 08:08:46 +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 804673842583 for ; Wed, 7 Dec 2022 08:08:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 804673842583 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.96,223,1665475200"; d="diff'?scan'208";a="88660037" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa3.mentor.iphmx.com with ESMTP; 07 Dec 2022 00:08:16 -0800 IronPort-SDR: 6sqxn+ydJSEJ5AzVjkQZTYG9J/tCyWG4PLG6fMFnZd1l15snmBr1zgRTRmUO9D9tEBltkM2Jd9 n1r/qX1fGwc1OjRYfWntBkX81Mp4Oq9TzuYeFukeZ6StRMR71Vo8bSgoHqgOTdm7e/hLG/68j7 bx60t9H7cFMV/91ivieCVyzqcDkCZmSOkFeVG4kAXa0/tuTfsgetr1Ka3j/alQ1u4LjHu3SMyF 9wlfRkr5S6lCjkRapfgf4MMSu0ziJk6rvyVnfv1GefJY71yj4eTS3RtzARd62uuPHb3kn1A/QQ 1f4= Message-ID: Date: Wed, 7 Dec 2022 09:08:09 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Subject: [Patch] libgomp.texi: Reverse-offload updates (was: [Patch] libgomp: Handle OpenMP's reverse offloads) Content-Language: en-US From: Tobias Burnus To: gcc-patches , Jakub Jelinek References: <0567b7c6-fede-72b8-63d1-1fc10dca36a0@codesourcery.com> In-Reply-To: <0567b7c6-fede-72b8-63d1-1fc10dca36a0@codesourcery.com> X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: SVR-IES-MBX-07.mgc.mentorg.com (139.181.222.7) 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 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+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751541907823593644?= X-GMAIL-MSGID: =?utf-8?q?1751541907823593644?= On 06.12.22 08:45, Tobias Burnus wrote: > * As follow-up, libgomp.texi must be updated That is what the attached patch does – obviously, it is depending on the main patch. OK (once the main patch is in)? 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: Reverse-offload updates libgomp/ * libgomp.texi (5.0 Impl. Status): Update 'requires' and 'ancestor'. (GCN): Add item about 'omp requires'. (nvptx): Likewise; add item about reverse offload. diff --git a/libgomp/libgomp.texi b/libgomp/libgomp.texi index efa7d956a33..e9ab079ecf5 100644 --- a/libgomp/libgomp.texi +++ b/libgomp/libgomp.texi @@ -192,8 +192,8 @@ The OpenMP 4.5 specification is fully supported. env variable @tab Y @tab @item Nested-parallel changes to @emph{max-active-levels-var} ICV @tab Y @tab @item @code{requires} directive @tab P - @tab complete but no non-host devices provides @code{unified_address}, - @code{unified_shared_memory} or @code{reverse_offload} + @tab complete but no non-host devices provides @code{unified_address} or + @code{unified_shared_memory} @item @code{teams} construct outside an enclosing target region @tab Y @tab @item Non-rectangular loop nests @tab Y @tab @item @code{!=} as relational-op in canonical loop form for C/C++ @tab Y @tab @@ -228,7 +228,7 @@ The OpenMP 4.5 specification is fully supported. @item @code{allocate} clause @tab P @tab Initial support @item @code{use_device_addr} clause on @code{target data} @tab Y @tab @item @code{ancestor} modifier on @code{device} clause - @tab Y @tab See comment for @code{requires} + @tab Y @tab Host fallback with GCN devices @item Implicit declare target directive @tab Y @tab @item Discontiguous array section with @code{target update} construct @tab N @tab @@ -288,7 +288,7 @@ The OpenMP 4.5 specification is fully supported. @code{append_args} @tab N @tab @item @code{dispatch} construct @tab N @tab @item device-specific ICV settings with environment variables @tab Y @tab -@item @code{assume} directive @tab Y @tab +@item @code{assume} and @code{assumes} directives @tab Y @tab @item @code{nothing} directive @tab Y @tab @item @code{error} directive @tab Y @tab @item @code{masked} construct @tab Y @tab @@ -4455,6 +4455,9 @@ The implementation remark: @item I/O within OpenMP target regions and OpenACC parallel/kernels is supported using the C library @code{printf} functions and the Fortran @code{print}/@code{write} statements. +@item OpenMP code that has a requires directive with @code{unified_address}, + @code{unified_shared_memory} or @code{reverse_offload} will remove + any GCN device from the list of available devices (``host fallback''). @end itemize @@ -4504,6 +4507,13 @@ The implementation remark: @item Compilation OpenMP code that contains @code{requires reverse_offload} requires at least @code{-march=sm_35}, compiling for @code{-march=sm_30} is not supported. +@item For code containing reverse offload (i.e. @code{target} regions with + @code{device(ancestor:1)}), there is a slight performance penality + for @emph{all} target regions, consisting mostly of shutdown delay + between zero to one microsecond and a tiny device querying overhead. +@item OpenMP code that has a requires directive with @code{unified_address} + or @code{unified_shared_memory} will remove any nvptx device from the + list of available devices (``host fallback''). @end itemize