From patchwork Wed Aug 2 17:00:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Stubbs X-Patchwork-Id: 13011 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f41:0:b0:3e4:2afc:c1 with SMTP id v1csp597095vqx; Wed, 2 Aug 2023 10:02:07 -0700 (PDT) X-Google-Smtp-Source: APBJJlGsJZVpn/YJLPZWmUNjjTOpyFuP1wH8xoJXB4OG39QwsxGxZ/qkHaolBzE4LriVmZecAO4v X-Received: by 2002:a17:907:7751:b0:99b:4d3d:c9b7 with SMTP id kx17-20020a170907775100b0099b4d3dc9b7mr9149896ejc.31.1690995727123; Wed, 02 Aug 2023 10:02:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690995727; cv=none; d=google.com; s=arc-20160816; b=k1xVXnvLXzAYwm2nB66sjarS1heawT+WPxgzWsCc2J4kM9vpGxRmS2H+YKdSTdSmqw lps1yqm2SkAduJXjNQZOA+3zrMV4MFPmn0ecZ7F/pVy1ANp3mmIFNVigMGXx3kjftcOQ EBVlPez56BHh8Ux3nYcn9B40g486mXz4TpfUjueiMcb5k1wpiVSspckcrcx6X4o2X8oW BIk0wvVACPrTKgisfC12w3mJCdkSklN/uljk3sWWdb1DIu0tyJez6TWmeQn/8w9/rfOl COtTYEWgqnSW3aH+I2sKCi/tG+mPoorrUn9HCX69IDCBvpXgJk8VLumVQgZXNsdZWGh3 Lapw== 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:content-transfer-encoding :mime-version:message-id:date:subject:to:from:ironport-sdr :dmarc-filter:delivered-to; bh=CFx3KHcKTpRY1kO0IodyVsDo7k9gNwXGHJdJqpiUG30=; fh=9xD62naDDQ44CEuxrRV0ts5PrjZies6B3X/DCYdxTRw=; b=hDQmY+H7WAZpG32ZlW0zJfNIqL7odxZ+2eZ+CKxWK3v260dpxTt+1rhbgQHYWQB/s2 NTNOR1zgEW5aUMiWWheMWxtFJhb2gtpAfPCGD9n1avuKKT9am0VmHoJHTfweGk/2D4eQ oCGQsD4kALnxkTMxrWNqb3JtXAyeuTuLlO2X1q0/0Uo22FRbPt3ZYvFVdkdrKIwDZp6/ hwd08Ft+w15eBcBKZ6bGVF+17Q7ZdbaOirB9V/8Qn3fbRdy0uKMjQ4r2yCPFgpnCDYpg znUvM7usm4LChxCh3yEbBUIn//+kacYJIVrcqVF5ctohiiKL/UwSi52no/7kDxt+P81k 24iw== 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 server2.sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id k13-20020a170906970d00b00991c32f3565si1576437ejx.30.2023.08.02.10.02.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Aug 2023 10:02:07 -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; 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 6DD13385700D for ; Wed, 2 Aug 2023 17:01:28 +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 C50793858D1E for ; Wed, 2 Aug 2023 17:00:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C50793858D1E 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="6.01,249,1684828800"; d="scan'208";a="13385818" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa3.mentor.iphmx.com with ESMTP; 02 Aug 2023 09:00:56 -0800 IronPort-SDR: YT0ukuDbJKY3GWGmU5ZD6dz9xZMG0QMA9UdVQIUSDFV0fjQ9OtZ6lB1tVMnYLSdgUMa2nLJf+T HqJqYwR7t4VPbStDb4SrDWK4jWOc7Vzo2PGlevQK6Wb+drSkQkWAtAUVbGCeoeXQGqvPb9dD9S NwpJz2BQhR76uTZXBmFHEZMUA4xkpePywZ0v9Z6mNnto7TgMAe3X3LqlG7EVOoaj0JGMn3ypcm Qr/4ZNHcL0Zbk3mh3RYpejlkbsAyPwgh3nH67tVFzObARsfpHJyw/ECE3HcRXN5zKeJR5AuYlb DKw= From: Andrew Stubbs To: Subject: [PATCH v2 0/3] libgomp: OpenMP low-latency omp_alloc Date: Wed, 2 Aug 2023 18:00:33 +0100 Message-ID: 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=-6.0 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.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: INBOX X-GMAIL-THRID: 1773137535439701708 X-GMAIL-MSGID: 1773137535439701708 This patch series is an updated and reworked version of some of the patch set posted about a year ago (the other features will be posted soon), this time supporting amdgcn, in addition to nvptx: https://patchwork.sourceware.org/project/gcc/list/?series=10748&state=%2A&archive=both The series implements device-specific allocators and adds a low-latency allocator for both GPUs architectures. The previous review comments have been addressed, I hope, plus a lot of bugs have been found and fixed since the original post. With the addition of amdgcn I have broken out the heap implementation so both architectures can share the code. 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 | 269 +++++++++---- libgomp/basic-allocator.c | 380 ++++++++++++++++++ libgomp/config/gcn/allocator.c | 123 ++++++ libgomp/config/gcn/libgomp-gcn.h | 6 + libgomp/config/gcn/team.c | 12 + libgomp/config/nvptx/allocator.c | 131 ++++++ libgomp/config/nvptx/team.c | 18 + libgomp/libgomp.h | 3 - libgomp/plugin/plugin-gcn.c | 35 +- libgomp/plugin/plugin-nvptx.c | 23 +- libgomp/testsuite/libgomp.c/omp_alloc-1.c | 56 +++ libgomp/testsuite/libgomp.c/omp_alloc-2.c | 64 +++ libgomp/testsuite/libgomp.c/omp_alloc-3.c | 42 ++ libgomp/testsuite/libgomp.c/omp_alloc-4.c | 197 +++++++++ libgomp/testsuite/libgomp.c/omp_alloc-5.c | 63 +++ libgomp/testsuite/libgomp.c/omp_alloc-6.c | 118 ++++++ .../testsuite/libgomp.c/omp_alloc-traits.c | 68 ++++ 19 files changed, 1528 insertions(+), 98 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