| Message ID | 20260505134929.3522938-1-aarsenovic@baylibre.com |
|---|---|
| Headers |
Return-Path: <gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 5341B4BA23C2 for <patchwork@sourceware.org>; Tue, 5 May 2026 13:52:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5341B4BA23C2 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=baylibre-com.20251104.gappssmtp.com header.i=@baylibre-com.20251104.gappssmtp.com header.a=rsa-sha256 header.s=20251104 header.b=Ni7hDO/K X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) by sourceware.org (Postfix) with ESMTPS id 15C3D4BA9014 for <gcc-patches@gcc.gnu.org>; Tue, 5 May 2026 13:50:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 15C3D4BA9014 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=baylibre.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 15C3D4BA9014 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::52a ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1777989008; cv=none; b=T1gWLNIypo7S2ZTPa3PrtrWJ9AzivPS3gfnu663TMepArsccv55MJ9tdFrWb1MPEGeGrXhoN0CdOZMOu9yOdAZZJLte340FKfDt7hY/HuNNxD3/4RAjJDm9MoS/nqzDtlcQnysy4QY6Rwf9Lbu3lbMtP8oeMiTn5s91MuWCa58w= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1777989008; c=relaxed/simple; bh=6rgIMd6QxVwnRwotIwDfLeChwQcG9Jg891HL2+9iDX0=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=ZGOzriBW0dM9NBRYN3FFoHqigZFVfv2QKEchk/K2Tss2URtpOH6I5yIdLCVxTh26kmFbWTS8olnSBNXVByFAJIYuInFOtIP3EdyvedV4eOS7zQQp6UXoQlRjnRrSVWRjdqI1X+2x2etLHsJe4i6VjofahEiytGoxYjr1mAtKDzA= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 15C3D4BA9014 Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-67c3cb1433cso4446595a12.0 for <gcc-patches@gcc.gnu.org>; Tue, 05 May 2026 06:50:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20251104.gappssmtp.com; s=20251104; t=1777989006; x=1778593806; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=nZBExAblNdz/yqmop5WuAEH7FohCGuSowpz1Mer2cos=; b=Ni7hDO/Ksds3P/ZNVowxZgBBjcsNkj2goJR1qSks2nuf2R1aQMw/CCVH99vB5k+C2c 7o7U23ph6WeF11tsalV2GZkGl7UBaxilHXkd2vJ96wZXxzHrT5Cd3si6YraH4y3YLbpg 1IYYJektsYN8anLgN+TurJP8nCJwcMiZHmxJWZAv+t2tB07zVCxcry/1EnB7xOO3jauD QQyoRJjwzn8TQOAf7YAvdteF6L6sGgI2tRi16WIp93TOjQdhPGCQzVansbk7CPKxHib2 7vj8QyD6TEf5l3PUNGBIro3zXUzLOUcWqnHPOXAdJ+gC2D16eXEYEWSd7WyjaKbKv7DF l/kQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777989006; x=1778593806; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=nZBExAblNdz/yqmop5WuAEH7FohCGuSowpz1Mer2cos=; b=ff+LwbnRR7dWyGluN1qcPfBg7shNWn8lmDK5oLfZpG9O9l3TrsvGtaF/miV3sgcAz2 5iUMECtZRdA3EwUXeL34lcPrY7Teb+zkVfVeZUQhdbAc+75E6W5mirCd8YYJekBoVJGJ mNmA9EZgxWkNwwDUY7gN1PI0VZHXcOOcj8IOp3zKGBCc1vGr9zcWJEsk0tsKWK52REnY SJqczvidCDG8W7g8c6jT7ZVpwLPY7Hs4hH3gbyPq4DHbNarz/VqOFq8puYo1PRblf+wq d+VbmK+3haukdjmF2IRb58ljRrr2/AVVxb8/+jPKCc5ieCuZaB9jgIRX0/+6MujobPw0 avpw== X-Gm-Message-State: AOJu0YyqejGaO4ZR9yLd6WjSnlN2UnFmZ9WBhPmVNRzae+xC0LQSsQUs Q8H1ElGBYKt+EEwklmV0pMpmMr7M64afEB0oXhw7fy/I9I5mWuJRCBeZyOhWgqBLHbsxHxoQmcB zKpRYFE4= X-Gm-Gg: AeBDietIDRauG6Haj7d1nBWbUPebAuTqcTLlYx5t7Hzk6AeZDwiybp5Nh+pTwmdboKV fYJYLjeYFNpGwqfuwOPk31RWt/GGSR9azqOafIU/CYX36CIzwZi2B7neZkiHq4F0HSWAqKbaLBi OwZtNl8Mp4GFe4Ld3FTURzA3ewEjO49vZYk3vpAB1OOrk9iN8sTzl3M2RJtoNpwjK5lpbmk2big v/cnSWrBbzG48kmUwEmUXeSKTVLdTYh0n+npM/J6bxvna5Ou0qgmM/B80tM/mi/1OCPnVEPKYAn fEJ3hTOwBV7qKIW2d+3wlazs9raKalVeoMm5BMzO+hCoF5Q2FMWNfLNhNGxqyq83dvy+G/cZNZu PK1zl5ZU0EJbhAzU/gCSzj1OTIadsU26ahzAFd3HNGtpruXbwltUyE7P3ja3g5WgTW25LIDJTAa lTocawUdpY25gtU76ELhiUE6GHel5skwGahfPY4t/tP/mkxw== X-Received: by 2002:a17:906:7312:b0:bc3:5164:bc1 with SMTP id a640c23a62f3a-bc351640eecmr413759166b.10.1777989006249; Tue, 05 May 2026 06:50:06 -0700 (PDT) Received: from localhost ([146.70.193.12]) by smtp.googlemail.com with ESMTPSA id a640c23a62f3a-bc1671c1d3esm265323666b.42.2026.05.05.06.50.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 May 2026 06:50:05 -0700 (PDT) From: =?utf-8?q?Arsen_Arsenovi=C4=87?= <aarsenovic@baylibre.com> To: gcc-patches@gcc.gnu.org Cc: =?utf-8?q?Arsen_Arsenovi=C4=87?= <aarsenovic@baylibre.com> Subject: [PATCH 0/4] GCN: Target offload overhead improvements, batch 2 Date: Tue, 5 May 2026 15:14:56 +0200 Message-ID: <20260505134929.3522938-1-aarsenovic@baylibre.com> X-Mailer: git-send-email 2.54.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org |
| Series |
GCN: Target offload overhead improvements, batch 2
|
|
Message
Arsen Arsenović
May 5, 2026, 1:14 p.m. UTC
Hi! This patch series further reduces overhead of launching kernels on GCN devices on top of the already-landed patches, by removing a redundant allocation and reducing the overhead of constructing the target variable table (the table of addresses of mapped variables in device memory) by moving it into host memory and kernel arguments. This then piggy-backs off of the kernel argument cache previously added to avoid allocating a new target variable table in most cases. It also introduces the concept of "offload sessions", that can be further expanded in the future, to carry the state required to start a target region. This reduces the overhead of launching a kernel by ~27%. The series also reduces the overhead of launching threads on the actual GCN device, by parallelizing thread initialization, akin to what the patch proposed by Matthew Malcomson does here: https://inbox.sourceware.org/gcc-patches/20251126131142.644866-6-mmalcomson@nvidia.com/ Arsen Arsenović (4): libgomp/gcn: parallelize initializing threads of a team libgomp: let plugins handle allocating the target variable table libgomp/plugin-gcn: remove unneeded heap allocation in run_kernel libgomp/oacc-mem: add missing assert to goacc_enter_datum include/gomp-constants.h | 2 +- libgomp/config/gcn/team.c | 121 ++++--- libgomp/libgomp-plugin.h | 81 ++++- libgomp/libgomp.h | 58 +++- libgomp/oacc-host.c | 63 +++- libgomp/oacc-mem.c | 11 +- libgomp/oacc-parallel.c | 24 +- libgomp/plugin/plugin-gcn.c | 310 ++++++++++++------ libgomp/plugin/plugin-nvptx.c | 45 ++- libgomp/target.c | 191 +++++++---- libgomp/task.c | 33 +- .../gcn-kernel-launch-no-tvt-alloc.c | 51 +++ .../gcn-kernel-launch-tvt-alloc.c | 16 + 13 files changed, 750 insertions(+), 256 deletions(-) create mode 100644 libgomp/testsuite/libgomp.c-c++-common/gcn-kernel-launch-no-tvt-alloc.c create mode 100644 libgomp/testsuite/libgomp.c-c++-common/gcn-kernel-launch-tvt-alloc.c