From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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-Archive: List-Post: List-Help: Sender: gcc-patches-owner@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 21:18:00 -0000 Message-ID: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain Return-Path: julian@codesourcery.com X-IsSubscribed: yes X-SW-Source: 2020-01/txt/msg01063.txt.bz2 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 -- 2.23.0