From patchwork Mon Dec 9 11:48:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 1206147 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-515502-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="Vq8Gj6MD"; 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 47WhKx6RpJz9sP6 for ; Mon, 9 Dec 2019 22:48:52 +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:subject:date:message-id:mime-version:content-type; q=dns; s= default; b=Hci3VvBhpOKfP701FlM1XT6QbQx1Rc7TtT9v5uHqiS0gks2O3CH4s Y8tvqyxAkPKV+39toSV/iQcpbHjeFQmvbYimYNEBo1i4U6oiZOymqoTWGetZ3kne ju3m58enxHI7zGFLMmo9yZCpBlfhdRbFP3HtwzFzve5lgCNujT/JYY= 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:subject:date:message-id:mime-version:content-type; s= default; bh=RAq2X6oicv7NEUSA2wY3LGFmrM0=; b=Vq8Gj6MDCPzpXsMCj9PB rY1u7Y+BYApO5b5kvQv7Ej2p3t0kMT6dlNyt5AjjsmHbD+9pTLW7uNAQ7CsezhWT IB9+6Lb/S30mLxzHQvQHZRdfVCIO5LDH5ztlpS4npe1SpCRKPsxRgpRoLXLQmNY/ VFalyY3+i7DpZVxVeVWn/b4= Received: (qmail 51434 invoked by alias); 9 Dec 2019 11:48:45 -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 51312 invoked by uid 89); 9 Dec 2019 11:48:34 -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: esa2.mentor.iphmx.com Received: from esa2.mentor.iphmx.com (HELO esa2.mentor.iphmx.com) (68.232.141.98) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Dec 2019 11:48:33 +0000 IronPort-SDR: vZD0cVwV9+0tRNJBv5LKHED+x2EwT3yy6VyLvCSoB4EzgYJu5GHOtDXWFRLNVYMR1LIse4yw4A K+GQg7QF8MP7asY1SosthpMUqru5c7ERdHxkyOW/KgBZUgLvOlucKDPv610V1fm2SGKYYDppP0 mCStSX64dwKC++w1rV1qYnQRLI9ABWMxeWspY+l85bM8ds/VqiJ0yXvt2skqrCx3k52wPqrLwS IgFq1xMbh1QCbBKLo94u+Xxm0LNVyP5dSD+iTkE8pNI8PI2d3tLbP1fKE6OuuL8/SGi/14S4fj Cxs= Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa2.mentor.iphmx.com with ESMTP; 09 Dec 2019 03:48:25 -0800 IronPort-SDR: XZKy7LPD8n220N1Ym77kYaJbKl2Dh/L6f+F6i0uvy1f4Ox6DE5FQ9o/QQJi+i4KzCcSQAEgN3n Yd3D6uppsFfa9DpBiQlYO5YL8iuRQQFc9S71GqBeBF+iKAF45fG4Ykn+zQm+Hnq7KfC+MTDeS3 lpW3euHwKUKxtvtj1f/uoTYoRV6IwQzu8SghzK3sEAsBZqk1nWpycizN/2V9d11vsdXIbs21j1 57SlJFwX7Z3eDS1v1jpaLBb0gdWp3C/6/F5rg7rKLZuCKyfK5KL5heIkChVhYsOCkr3K8X2zKf AZs= From: Thomas Schwinge To: Subject: Add 'libgomp.oacc-c-c++-common/host_data-6.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:48:08 +0100 Message-ID: <87r21d3ekn.fsf@euler.schwinge.homeip.net> MIME-Version: 1.0 Hi! See attached "Add 'libgomp.oacc-c-c++-common/host_data-6.c'", committed to trunk in r279119. Grüße Thomas From e5247d4a6930ca12fef2d38922cf6dbd9812da22 Mon Sep 17 00:00:00 2001 From: tschwinge Date: Mon, 9 Dec 2019 11:40:08 +0000 Subject: [PATCH] Add 'libgomp.oacc-c-c++-common/host_data-6.c' libgomp/ * testsuite/libgomp.oacc-c-c++-common/host_data-6.c: New file. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@279119 138bc75d-0d04-0410-961f-82ee72b054a4 --- libgomp/ChangeLog | 2 + .../libgomp.oacc-c-c++-common/host_data-6.c | 47 +++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 libgomp/testsuite/libgomp.oacc-c-c++-common/host_data-6.c diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index c5541bcec81..6ef2f24e4d5 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,5 +1,7 @@ 2019-12-09 Thomas Schwinge + * testsuite/libgomp.oacc-c-c++-common/host_data-6.c: New file. + * target.c (gomp_exit_data): Use 'gomp_remove_var'. 2019-12-09 Tobias Burnus diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/host_data-6.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/host_data-6.c new file mode 100644 index 00000000000..1cda442b001 --- /dev/null +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/host_data-6.c @@ -0,0 +1,47 @@ +/* Call 'acc_memcpy_from_device' inside '#pragma acc host_data'. */ + +/* { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } } */ + +#include +#include +#include +#include + +int +main () +{ + const int SIZE = 318; + const int c0 = 22; + const int c1 = 112; + + char *h = (char *) malloc (SIZE); + + memset (h, c0, SIZE); + +#pragma acc data create (h[0:SIZE - 44]) + { +#pragma acc update device (h[0:SIZE - 44]) + + memset (h, c1, 67); + + void *d = h; +#pragma acc host_data use_device (d) + { + acc_memcpy_from_device (h, d, 12); + } + } + + for (int i = 0; i < SIZE; ++i) + { + if (i < 12) + assert (h[i] == c0); + else if (i < 67) + assert (h[i] == c1); + else + assert (h[i] == c0); + } + + free (h); + + return 0; +} -- 2.17.1