From patchwork Mon Mar 27 11:26:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 66939 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 083AC3857352 for ; Mon, 27 Mar 2023 11:27:00 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa4.mentor.iphmx.com (esa4.mentor.iphmx.com [68.232.137.252]) by sourceware.org (Postfix) with ESMTPS id 397FC3858417 for ; Mon, 27 Mar 2023 11:26:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 397FC3858417 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.98,294,1673942400"; d="scan'208,223";a="506546" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa4.mentor.iphmx.com with ESMTP; 27 Mar 2023 03:26:36 -0800 IronPort-SDR: FIjoEO7MVVJzDV0ZDk8Lwdi8W8H9jG+rlDUDoJK1IviQL3o2QYh3oWbaD/9QKx6e2Tl8ocLIE7 5eqCnNuKyuwZM540itoWZfclnhGsIo6asmypNzB/AeKj/BX1NYTtWnSByCqQaPrI5bmtC1YROk ytF74NYA2YqcO1L8PvREbxKXHjXf3Wcx/OObl7HhjYhE5oLk7Sa+cnbdjhPASF853r2Ng6+tr4 ZjMdVPJqW5o+JgC/2CXT6qYGrww6tLLxr6pfkbqFqdbgmnACjTfvvUDWTa8l/lvkJhEiT9G09f K0E= From: Thomas Schwinge To: , Andrew Stubbs , "Tobias Burnus" Subject: [og12] libgomp: Document OpenMP 'pinned' memory (was: [PATCH] libgomp, openmp: pinned memory) In-Reply-To: References: <87bkki9mji.fsf@euler.schwinge.homeip.net> User-Agent: Notmuch/0.29.3+94~g74c3f1b (https://notmuchmail.org) Emacs/28.2 (x86_64-pc-linux-gnu) Date: Mon, 27 Mar 2023 13:26:28 +0200 Message-ID: <878rfiqvtn.fsf@euler.schwinge.homeip.net> MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-14.mgc.mentorg.com (139.181.222.14) To svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) X-Spam-Status: No, score=-11.9 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+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" Hi! On 2023-03-27T09:27:31+0000, "Stubbs, Andrew" wrote: >> -----Original Message----- >> From: Thomas Schwinge >> Sent: 24 March 2023 15:50 >> >> On 2022-01-04T15:32:17+0000, Andrew Stubbs >> wrote: >> > This patch implements the OpenMP pinned memory trait [...] >> >> I figure it may be helpful to document the current og12 state of affairs; does >> the attached "libgomp: Document OpenMP 'pinned' memory" look good to >> you? > > I don't really know what "allocated via the device" means? Heh, you're right. > I mean, I presume you mean "via CUDA", but I don't think this is obvious to the average reader. > Maybe "allocation is optimized for the device" or some such thing? As we're in sections that are documenting GCN vs. nvptx specifics, we might indeed call out which exact interfaces we're using. How's the updated "libgomp: Document OpenMP 'pinned' memory", see attached? Grüße Thomas ----------------- 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 From 03e09ad4e0b4cd2232e8bb036dd2562b18ea2686 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Fri, 24 Mar 2023 15:14:57 +0100 Subject: [PATCH] libgomp: Document OpenMP 'pinned' memory libgomp/ * libgomp.texi (AMD Radeon, nvptx): Document OpenMP 'pinned' memory. --- libgomp/libgomp.texi | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libgomp/libgomp.texi b/libgomp/libgomp.texi index 288e0b3a8ea..6355ce2a37b 100644 --- a/libgomp/libgomp.texi +++ b/libgomp/libgomp.texi @@ -4456,6 +4456,9 @@ The implementation remark: @item OpenMP code that has a requires directive with @code{unified_address} or @code{unified_shared_memory} will remove any GCN device from the list of available devices (``host fallback''). +@item OpenMP @emph{pinned} memory (@code{omp_atk_pinned}, + @code{ompx_pinned_mem_alloc}, for example) + is allocated via @code{mmap}, @code{mlock}. @end itemize @@ -4518,6 +4521,11 @@ The implementation remark: @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''). +@item OpenMP @emph{pinned} memory (@code{omp_atk_pinned}, + @code{ompx_pinned_mem_alloc}, for example) + is allocated via @code{cuMemHostAlloc} (CUDA Driver API). + This potentially helps optimization of host <-> device data + transfers. @end itemize -- 2.25.1