From patchwork Mon Dec 9 11:52:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 1206148 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-515503-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="D/Q40vuB"; 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 47WhQ32Cs4z9sPc for ; Mon, 9 Dec 2019 22:52:26 +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-type; q=dns; s=default; b=loADOpW8VglQjL69r6Z/f+x9m5hVPb4schv3sHRkf2JpqNyzQg bfeaktMfHbHBfYZYTqejHy92OR1o+93p9JApM2uqpPNZ+j99GcLpKU8SNMHo4mLw H+RG9DnXl2PoG5IuIva8o6NvQv81o7OaQPZpYnYNjMmsvBZuLnxgo8rrI= 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-type; s= default; bh=/ep4QjRayJt7Ma208CziXtW0ZD8=; b=D/Q40vuBaMhIK9DoEGU/ n72IXYvBz6iK2QfJQTOWJsN11qGqHwp4AZuoOQw22L1MlpQQu+wigkLuF2e7PIzG 3g6IBAOgjG64hlTEUljd8DvGGp6KKz2q31RufLWsKGuwSOesjnqGNO7X2zQLko7y 3H2TJvnemfnNMjf1C20bqTg= Received: (qmail 55603 invoked by alias); 9 Dec 2019 11:52:19 -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 55578 invoked by uid 89); 9 Dec 2019 11:52:18 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-18.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.1 spammy= 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; Mon, 09 Dec 2019 11:52:17 +0000 IronPort-SDR: MCqK1n1z1tIacYESS3ORQRux3EILCh/DyQSwmSsE4IOGNZmAPeWO47v/rXfWOdvcMAk0oFqVnZ eGA1jmre4PVzYsuLDYcsU78ZF9hHYBYHtcrp2IzlK/93OZeu9kYAu+BCKCsv5MzIunxZZPpyuk Rzr/gZFf6JO0MSIUMX3UggrGPSbJzJddvDy0PqWKIj+KcNMoHnt2zCw8+R8tJpm+JZhw0mQ6HU ayo4y887VjUOcWCzcHm2t1i9dtova7eqde9Wt2U6Hfw+XDuJFAyVq7FAmL8lFDQs9z6IJmFATN 0JI= Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa4.mentor.iphmx.com with ESMTP; 09 Dec 2019 03:52:16 -0800 IronPort-SDR: XJ4AxR8M6ZktiBHMizZoJGezGxxEPV1bXYiJewDcKYtA5B5szIqPTeUy0l1h4kmAGtaShAJ31P ks4RILmJQYw8U02i/9+YFOuQVvkGro0WEtyIi1zrTStbywZhCSTGBcvxUXcNvX3+tVu+OzwVbA Kf5ksAP/DjFaQv0sAvuVSWTdH/ZZEO9OnsxViJbvmWrfvywCJFS0e7o6YnMmXcvrFkCC9BwnXr CP3CsQ1sxSTzDJgFseHlzxrcH14zfMrF4VRJCtRvJW7OfgAGQWzqtccYXL4zt4Iv+YGsvq01pc PXA= From: Thomas Schwinge To: CC: Julian Brown Subject: [PR92854] Add 'libgomp.oacc-c-c++-common/pr92854-1.c' User-Agent: Notmuch/0.29.1+93~g67ed7df (https://notmuchmail.org) Emacs/26.1 (x86_64-pc-linux-gnu) Date: Mon, 9 Dec 2019 12:52:02 +0100 Message-ID: <87lfrl3ee5.fsf@euler.schwinge.homeip.net> MIME-Version: 1.0 Hi! See attached "[PR92854] Add 'libgomp.oacc-c-c++-common/pr92854-1.c'", committed to trunk in r279120, "to document the status quo", which does match my understanding of the OpenACC 2.6 semantics. Grüße Thomas From e14bd9d202bc4140d825a396ddaf64a5930ee3d1 Mon Sep 17 00:00:00 2001 From: tschwinge Date: Mon, 9 Dec 2019 11:40:17 +0000 Subject: [PATCH] [PR92854] Add 'libgomp.oacc-c-c++-common/pr92854-1.c' ... to document the status quo. libgomp/ PR libgomp/92854 * testsuite/libgomp.oacc-c-c++-common/pr92854-1.c: New file. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@279120 138bc75d-0d04-0410-961f-82ee72b054a4 --- libgomp/ChangeLog | 3 ++ .../libgomp.oacc-c-c++-common/pr92854-1.c | 31 +++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 libgomp/testsuite/libgomp.oacc-c-c++-common/pr92854-1.c diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index 6ef2f24e4d5..aac3b1887b0 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,5 +1,8 @@ 2019-12-09 Thomas Schwinge + PR libgomp/92854 + * testsuite/libgomp.oacc-c-c++-common/pr92854-1.c: New file. + * testsuite/libgomp.oacc-c-c++-common/host_data-6.c: New file. * target.c (gomp_exit_data): Use 'gomp_remove_var'. diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/pr92854-1.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/pr92854-1.c new file mode 100644 index 00000000000..6ba96b6bf8f --- /dev/null +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/pr92854-1.c @@ -0,0 +1,31 @@ +/* Verify that 'acc_unmap_data' unmaps even in presence of dynamic reference + counts. */ + +/* { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } } */ + +#include +#include +#include + +int +main () +{ + const int N = 180; + + char *h = (char *) malloc (N); + char *d = (char *) acc_malloc (N); + if (!d) + abort (); + acc_map_data (h, d, N); + + char *d_ = (char *) acc_create (h + 3, N - 77); + assert (d_ == d + 3); + + d_ = (char *) acc_create (h, N); + assert (d_ == d); + + acc_unmap_data (h); + assert (!acc_is_present (h, N)); + + return 0; +} -- 2.17.1