From patchwork Fri Jan 17 21:18:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julian Brown X-Patchwork-Id: 1224975 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-517618-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.a=rsa-sha1 header.s=default header.b=QNmp2P6p; 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 47zv7q3dPFz9sR4 for ; Sat, 18 Jan 2020 08:19:01 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:mime-version :content-transfer-encoding:content-type; q=dns; s=default; b=fYW w2Z+qI11vDQfVgczC3j1VDo1JJwsXWmvnSaCJl4TLGi9sETmqhbb1RSSXv106a4V hA3o2HpjIrFIe5m5AqNIl5/qiNC4WP5fjAQEtubRKjVsjTUTo3zvCNNNtyK6nNck plM6Jzy7BJlnxg82s/lgt2IaS3o8Iq8AUb5jkffQ= 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:from :to:cc:subject:date:message-id:mime-version :content-transfer-encoding:content-type; s=default; bh=rV3l1sgoc i4hYlKm2e3qol/9b3E=; b=QNmp2P6pqq57FqUGP5MajrpS67nr1M5hGh/reDwEW Ih6riLQFjXX96nZHM+BEvV+3cwinm6L1NikukdQ6oSGJYd9M0GkcZTAn0TB79vZg /Rc5OTHiH4GWP/OgUB0yGbgwZWVdCtoNHeTKqVA13kdOVbx/yPLEvojxIC/Nyp/9 tc= Received: (qmail 128300 invoked by alias); 17 Jan 2020 21:18:43 -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 128273 invoked by uid 89); 17 Jan 2020 21:18:43 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-16.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.1 spammy=Mixed, HContent-Transfer-Encoding:8bit X-HELO: esa4.mentor.iphmx.com Received: from esa4.mentor.iphmx.com (HELO esa4.mentor.iphmx.com) (68.232.137.252) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 17 Jan 2020 21:18:42 +0000 IronPort-SDR: vU6+dCW0kPrOTLfkwDNq38x3kharFYl8rZdV4asNPuViOWuyLOwNtAu4kce+WXh65bSsf7dqdN 17idsmoE+yCac+g6IMvf86Bl0igUABe1C4SBRKSs5FJSczvoWJbeBGEOegFGTxBH5bvX+9Eo9x ZuH1/QaPWMeynDSyAe6PsBTrNvK82/NzBXs2Pb+FEfFT3qBY/TUrhatByXPiSK40fZVef+ecjK Rebo1ZISmzooCV3iWjdyVinfPBoFGA/IWRYlxAJDk+5kv+GXoHx37aHU/Qt//ig74AES7FuId/ J9I= Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa4.mentor.iphmx.com with ESMTP; 17 Jan 2020 13:18:40 -0800 IronPort-SDR: ZWlAWr0pDmb3xKFY3rZYvksLr7V2xOwqjCs3DaQjavRjI5077X8tlmqVRSShiTjWgzdl6f+zhB NHTsMxy6DoUg== From: Julian Brown To: CC: Thomas Schwinge , Jakub Jelinek Subject: [PATCH 0/3] Mixed static/dynamic data lifetimes with OpenACC (PR92843) Date: Fri, 17 Jan 2020 13:18:18 -0800 Message-ID: MIME-Version: 1.0 X-IsSubscribed: yes This patch series provides fixes for some cases of mixing static and dynamic data lifetimes in OpenACC, hopefully addressing some of Thomas's concerns in PR92843 -- in particular that an "exit data"-type operation on a given variable inside a structured block (also mapping that variable) should be a no-op. On further investigation of related patterns, other cases of mixing static and dynamic lifetimes also turn out to problematic at present. Some of these cases are handled by this patch series, and others are diagnosed as errors (rather than allowing silent and hard-to-diagnose failures later during runtime). The first two patches are sufficient to fix the test case introduced for PR92843, and the third patch provides further support/diagnostics for dynamic unmapping operations taking place within structured blocks. Further commentary provided alongside individual patches. Tested with offloading to NVPTX, also with a version of my refcount-verification patch (not currently on trunk). I believe this (at least the first two parts) fixes a regression (for the pr92843-1.c test case), so OK for stage 4? Thanks, Julian Julian Brown (3): Introduce dynamic data mapping sentinel for OpenACC Don't copy back vars mapped with acc_map_data OpenACC dynamic data lifetimes ending within structured blocks libgomp/libgomp.h | 3 +- libgomp/oacc-int.h | 2 + libgomp/oacc-mem.c | 158 ++++++++++++--- libgomp/target.c | 56 +++++- .../libgomp.oacc-c-c++-common/pr92843-1.c | 4 +- .../static-dynamic-lifetimes-1-lib.c | 3 + .../static-dynamic-lifetimes-1.c | 160 +++++++++++++++ .../static-dynamic-lifetimes-2-lib.c | 3 + .../static-dynamic-lifetimes-2.c | 166 ++++++++++++++++ .../static-dynamic-lifetimes-3-lib.c | 3 + .../static-dynamic-lifetimes-3.c | 183 ++++++++++++++++++ .../static-dynamic-lifetimes-4-lib.c | 6 + .../static-dynamic-lifetimes-4.c | 71 +++++++ .../static-dynamic-lifetimes-5-lib.c | 6 + .../static-dynamic-lifetimes-5.c | 63 ++++++ .../static-dynamic-lifetimes-6-lib.c | 5 + .../static-dynamic-lifetimes-6.c | 46 +++++ .../static-dynamic-lifetimes-7-lib.c | 5 + .../static-dynamic-lifetimes-7.c | 45 +++++ .../static-dynamic-lifetimes-8-lib.c | 5 + .../static-dynamic-lifetimes-8.c | 50 +++++ 21 files changed, 1000 insertions(+), 43 deletions(-) create mode 100644 libgomp/testsuite/libgomp.oacc-c-c++-common/static-dynamic-lifetimes-1-lib.c create mode 100644 libgomp/testsuite/libgomp.oacc-c-c++-common/static-dynamic-lifetimes-1.c create mode 100644 libgomp/testsuite/libgomp.oacc-c-c++-common/static-dynamic-lifetimes-2-lib.c create mode 100644 libgomp/testsuite/libgomp.oacc-c-c++-common/static-dynamic-lifetimes-2.c create mode 100644 libgomp/testsuite/libgomp.oacc-c-c++-common/static-dynamic-lifetimes-3-lib.c create mode 100644 libgomp/testsuite/libgomp.oacc-c-c++-common/static-dynamic-lifetimes-3.c create mode 100644 libgomp/testsuite/libgomp.oacc-c-c++-common/static-dynamic-lifetimes-4-lib.c create mode 100644 libgomp/testsuite/libgomp.oacc-c-c++-common/static-dynamic-lifetimes-4.c create mode 100644 libgomp/testsuite/libgomp.oacc-c-c++-common/static-dynamic-lifetimes-5-lib.c create mode 100644 libgomp/testsuite/libgomp.oacc-c-c++-common/static-dynamic-lifetimes-5.c create mode 100644 libgomp/testsuite/libgomp.oacc-c-c++-common/static-dynamic-lifetimes-6-lib.c create mode 100644 libgomp/testsuite/libgomp.oacc-c-c++-common/static-dynamic-lifetimes-6.c create mode 100644 libgomp/testsuite/libgomp.oacc-c-c++-common/static-dynamic-lifetimes-7-lib.c create mode 100644 libgomp/testsuite/libgomp.oacc-c-c++-common/static-dynamic-lifetimes-7.c create mode 100644 libgomp/testsuite/libgomp.oacc-c-c++-common/static-dynamic-lifetimes-8-lib.c create mode 100644 libgomp/testsuite/libgomp.oacc-c-c++-common/static-dynamic-lifetimes-8.c