From patchwork Sun Dec 3 00:32:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Stubbs X-Patchwork-Id: 17452 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp2015830vqy; Sat, 2 Dec 2023 16:33:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IEozsnoC1+hbg68l20RGBaxNK/2iqxgzI6+EdGXKzeVkxgS0RQC0J+GlRxUUgkqMl9qa2B6 X-Received: by 2002:ac8:5e4a:0:b0:421:c49b:905d with SMTP id i10-20020ac85e4a000000b00421c49b905dmr33387987qtx.50.1701563600683; Sat, 02 Dec 2023 16:33:20 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1701563600; cv=pass; d=google.com; s=arc-20160816; b=Dhps2N9zRgea+J4Snf0vEHpNXhTSLfRa7lYWSIrT9e+vP2/VIOhqbVp/llcDEqdnFO MSGTmDSXkwDD5lXBw5Y22RFjHLbVQ7r5TKKcPIJcJo9cIkPJbxa5TGqPOazmh2xErauV Aaau4CY3yxNHs+8L7iTHzbOuoOio/B4bul+WkvcrCL2t6INcEh8TeeEGtxfF9hvtooGx EGP3+KFHrsWKf+6P3R+Vv96FaxG+8wdF9ohFnd0BpU8YSfG7NefUHifUg6vELSYHyKqh 8gq4upGUkQyhXXQsBdqfDcHhtVhJHekglX0WaxBvgiaCm2UEwon0W2aiogUCXDXo7NMp Jrng== 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:content-transfer-encoding :mime-version:message-id:date:subject:to:from:ironport-sdr :arc-filter:dmarc-filter:delivered-to; bh=Xv5o/QRkivEs7u0M34T8UzI8sNuY/cK+XYWnqbsnmxM=; fh=gk9A5O7Gbglvz1MjrRQ4hZ2i3c68kYkpOZJg1emXh+g=; b=W2hQ6kIuw9ulnfF2gzCvQlP0n+GQ81JeeMOZTrGx+UryqDlmwuUypArxPZVyIC/PDk Mqa1SjraspZzDujJwWJoVteCKQOrohJmTPLejvEA1HBg9+EdP/6bY4/0SS7j+nKhYxCg 9hz0sfKkHZV8E+p7sK+9TMu1zNDB66fBrGow9VqfH4PzBrQde+7bxp1fOuF1JJcuv2Et pXCh/ToGxKfUQK3fKsTjY7wtAI2QxuEjk8G0eFX1k4mTwq4tz+OYVadl8rfxDp0ddouQ Gal7hsVQPMFEvDtVfDhnzdXTuwE3mx52C/doI+SuCxif/R0oUC4+KGdKip73Awyc+SE3 ElYg== 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 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id kf18-20020a05622a2a9200b004238b1f8c09si6245929qtb.743.2023.12.02.16.33.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Dec 2023 16:33:20 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; 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 2620:52:3:1:0:246e:9693:128c 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 DC6953861002 for ; Sun, 3 Dec 2023 00:33:13 +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 309D3385700F for ; Sun, 3 Dec 2023 00:32:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 309D3385700F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 309D3385700F Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=68.232.137.252 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701563569; cv=none; b=LVLmUQhpYgu/pAj47cTczcdDcnY8Cjfk/9yKPD3FmVFsvyC2VWlNt3EW57hBYai7OOXUwT+4n2BzYA87mR3up9H3PsWu7SKanIzzp0PIe/JyKf5M5opLnWDhz7Zbuecjmekn5wSeue8fsPcyDjsa6mtCf7V7nG18lHywT4R0M0g= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701563569; c=relaxed/simple; bh=7BVWHXEwk6CwGw+VbNrS2t6U7UUBM1gzhqHMZLjF/Sw=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=HLqioEP1M6RYyH4otGgoqQJ5FqX4dIMWHK399b1rQV+SBA/pHbCzSyUTRNHARz+Q4+MwQN9DP3gKCcXBsf1Iht7pMmkv76d+YQZfNjiw2cChSZBqDrDdN3d6zM2BrKf56gq68iFBGQbeThioui7nb6CiTSaGV9mhO7on0Ayf1pM= ARC-Authentication-Results: i=1; server2.sourceware.org X-CSE-ConnectionGUID: fheKjpAFRpWd69u/jbGQGg== X-CSE-MsgGUID: jBX/87GWSXCf9p72RPNklQ== X-IronPort-AV: E=Sophos;i="6.04,246,1695715200"; d="scan'208";a="24279923" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa4.mentor.iphmx.com with ESMTP; 02 Dec 2023 16:32:47 -0800 IronPort-SDR: 4Du2vG5aDq1LYWkzLwJjEjF7HZVzMyPV4lEErS4/R16Mo86BOAfLsu4vXtswNxhC7fLwnmuqS6 S2GClzCfyGH98vXeoVbtVv0w1rs1y35A95r17bAYGvwoZMj392Zknbwoa8Cnlbj/kgQYOqKQyK miDgPq/HRY2XEkkpEzhSt3pjAn2LCqgS6/vHJFlznQJlvkAxqE8t0nAL3RIKTR62wnO6FOYRCO qaBiB2E/YYsAG7wAp3wNOg5llzw+TLXtRh5TN/oUr80vYGGhhSr4eIX9s1fsaUhq226AY1UIsx NZA= From: Andrew Stubbs To: Subject: [PATCH v3 0/3] libgomp: OpenMP low-latency omp_alloc Date: Sun, 3 Dec 2023 00:32:21 +0000 Message-ID: <20231203003224.1638841-1-ams@codesourcery.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-15.mgc.mentorg.com (139.181.222.15) To svr-ies-mbx-11.mgc.mentorg.com (139.181.222.11) X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no 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: 1784218754186452357 X-GMAIL-MSGID: 1784218754186452357 This patch series is a rework of the patch series posted in August. https://patchwork.sourceware.org/project/gcc/list/?series=23045&state=%2A&archive=both The series implements device-specific allocators and adds a low-latency allocator for both GPUs architectures. This time the omp_low_lat_mem_alloc does not work because the default traits are incompatible (GPU low-latency memory is not accessible to other teams). I've also included documentation and addressed the comments from Tobias's review. Andrew Andrew Stubbs (3): libgomp, nvptx: low-latency memory allocator openmp, nvptx: low-lat memory access traits amdgcn, libgomp: low-latency allocator gcc/config/gcn/gcn-builtins.def | 2 + gcc/config/gcn/gcn.cc | 16 +- libgomp/allocator.c | 266 +++++++----- libgomp/basic-allocator.c | 380 ++++++++++++++++++ libgomp/config/gcn/allocator.c | 127 ++++++ libgomp/config/gcn/libgomp-gcn.h | 6 + libgomp/config/gcn/team.c | 12 + libgomp/config/nvptx/allocator.c | 141 +++++++ libgomp/config/nvptx/team.c | 18 + libgomp/libgomp.h | 3 - libgomp/libgomp.texi | 40 +- libgomp/plugin/plugin-gcn.c | 35 +- libgomp/plugin/plugin-nvptx.c | 23 +- libgomp/testsuite/libgomp.c/omp_alloc-1.c | 66 +++ libgomp/testsuite/libgomp.c/omp_alloc-2.c | 72 ++++ libgomp/testsuite/libgomp.c/omp_alloc-3.c | 49 +++ libgomp/testsuite/libgomp.c/omp_alloc-4.c | 197 +++++++++ libgomp/testsuite/libgomp.c/omp_alloc-5.c | 71 ++++ libgomp/testsuite/libgomp.c/omp_alloc-6.c | 118 ++++++ .../testsuite/libgomp.c/omp_alloc-traits.c | 66 +++ 20 files changed, 1595 insertions(+), 113 deletions(-) create mode 100644 libgomp/basic-allocator.c create mode 100644 libgomp/config/gcn/allocator.c create mode 100644 libgomp/config/nvptx/allocator.c create mode 100644 libgomp/testsuite/libgomp.c/omp_alloc-1.c create mode 100644 libgomp/testsuite/libgomp.c/omp_alloc-2.c create mode 100644 libgomp/testsuite/libgomp.c/omp_alloc-3.c create mode 100644 libgomp/testsuite/libgomp.c/omp_alloc-4.c create mode 100644 libgomp/testsuite/libgomp.c/omp_alloc-5.c create mode 100644 libgomp/testsuite/libgomp.c/omp_alloc-6.c create mode 100644 libgomp/testsuite/libgomp.c/omp_alloc-traits.c