From patchwork Wed Jul 10 00:51:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julian Brown X-Patchwork-Id: 1130087 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-504786-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="dyjoan6I"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45k0yD0fT3z9sN6 for ; Wed, 10 Jul 2019 10:52:03 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=wZe5IG192WC1vJU4vT+kL7wnwCJCdotjz3rkXakHa1EhY2xWBAEon JinOOoXsu24IfxAtJ9WYDFKdBj2Oe3SPhtZ/UVdTzl9aDUsNct1pOkl+mXrDSjsT PHHnc0prvAQ4cG5w22wMtWLOIXWn38M0I2rxl2T4ZickMdFO6nO8fE= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=bJrdvR3xjRkYQFlvXaFIHnq7mbU=; b=dyjoan6IP7+wkut/MTiX zUOEzPZbDVk3sh2vn/IHqxGtIh/8KENK6f1XitXprkoXMxeZ87lmaGVEeEQ+PZZG On+GUD5/degSgXFORODfc9ALskdURco4EcBNP31KXPuzEGtgu+cZVza7qRliZzvj k/0kmgPx7DacsP0DX5tDhis= Received: (qmail 26448 invoked by alias); 10 Jul 2019 00:51:57 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 26437 invoked by uid 89); 10 Jul 2019 00:51:56 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-15.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy= X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 10 Jul 2019 00:51:55 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-MBX-04.mgc.mentorg.com) by relay1.mentorg.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-SHA384:256) id 1hl0pu-0004fp-9t from Julian_Brown@mentor.com for gcc-patches@gcc.gnu.org; Tue, 09 Jul 2019 17:51:54 -0700 Received: from squid.athome (137.202.0.90) by SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Wed, 10 Jul 2019 01:51:50 +0100 Date: Wed, 10 Jul 2019 01:51:49 +0100 From: Julian Brown To: Subject: [og9] Allow the accelerator to have more offloaded functions than the host Message-ID: <20190710015149.69d46586@squid.athome> MIME-Version: 1.0 X-IsSubscribed: yes Hi, This patch was previously posted here by Cesar: https://gcc.gnu.org/ml/gcc-patches/2017-10/msg00668.html This patch is necessary when not all objects containing offload code are linked into the final executable, including those in static libraries. Re-tested with offloading to nvptx. I will apply to the openacc-gcc-9-branch shortly. Thanks, Julian ChangeLog 2019-07-10 Cesar Philippidis libgomp/ * target.c (gomp_load_image_to_device): Allow the accelerator to possess more offloaded functions than the host. From 8fa310efa11254ed430d7e5dca80333a612b699e Mon Sep 17 00:00:00 2001 From: Cesar Philippidis Date: Sun, 7 Jul 2019 11:25:51 -0700 Subject: [PATCH 3/3] Allow the accelerator to have more offloaded functions than the host libgomp/ * target.c (gomp_load_image_to_device): Allow the accelerator to possess more offloaded functions than the host. --- libgomp/ChangeLog.openacc | 5 +++++ libgomp/target.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/libgomp/ChangeLog.openacc b/libgomp/ChangeLog.openacc index 1d88bd54cd2..00c58601336 100644 --- a/libgomp/ChangeLog.openacc +++ b/libgomp/ChangeLog.openacc @@ -1,3 +1,8 @@ +2019-07-10 Cesar Philippidis + + * target.c (gomp_load_image_to_device): Allow the accelerator to + possess more offloaded functions than the host. + 2019-07-10 Julian Brown * oacc-parallel.c (GOACC_enter_exit_data): Fix optional arguments for diff --git a/libgomp/target.c b/libgomp/target.c index a4ed763d507..c81e5ababb7 100644 --- a/libgomp/target.c +++ b/libgomp/target.c @@ -2131,7 +2131,7 @@ gomp_load_image_to_device (struct gomp_device_descr *devicep, unsigned version, = devicep->load_image_func (devicep->target_id, version, target_data, &target_table); - if (num_target_entries != num_funcs + num_vars) + if (num_target_entries < num_funcs + num_vars) { gomp_mutex_unlock (&devicep->lock); if (is_register_lock) -- 2.22.0