From patchwork Mon Sep 4 12:54:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 1829588 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RfTB16r6cz1ygx for ; Mon, 4 Sep 2023 22:54:49 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 10E663857702 for ; Mon, 4 Sep 2023 12:54:48 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa4.mentor.iphmx.com (esa4.mentor.iphmx.com [68.232.137.252]) by sourceware.org (Postfix) with ESMTPS id D7C733858428 for ; Mon, 4 Sep 2023 12:54:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D7C733858428 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-IronPort-AV: E=Sophos;i="6.02,226,1688457600"; d="scan'208,223";a="16050981" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa4.mentor.iphmx.com with ESMTP; 04 Sep 2023 04:54:33 -0800 IronPort-SDR: ur04SeyZifiGkIO2N1yNnbJwqnPZHRmKvIUoatV/MipoNvqGP6jd3pKz1h7RvQsO5EaqAYs04J BPCNG1B8ovrA367bkdcs3SZAmdMPNbXUZBxH4/QY284flNFwzQSSOpE1Q/Iia5RrYIpbMwz4vI OR5zow2IIaNNbYi9IxAV/U4Alx0DYuC+HyRCIYpjNOME0zraOLgzRkuKSZGo8x4/HKkWam9etj DMAcx5FUzWnQMvf2qUAtBVWXfyHWHVIS74PS73A57li1vFoBm6LX2Ki3QCxuv2EDu6sd5oitA9 ehY= From: Thomas Schwinge To: , Tobias Burnus CC: Jakub Jelinek Subject: Add 'libgomp.c-c++-common/pr100059-1.c' [PR100059] User-Agent: Notmuch/0.29.1+93~g67ed7df (https://notmuchmail.org) Emacs/27.1 (x86_64-pc-linux-gnu) Date: Mon, 4 Sep 2023 14:54:26 +0200 Message-ID: <87ttsat7y5.fsf@dem-tschwing-1.ger.mentorg.com> MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-14.mgc.mentorg.com (139.181.222.14) To svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, KAM_LOTSOFHASH, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Hi! Pushed to master branch commit fe0f9e09413047484441468b05288412760d8a09 "Add 'libgomp.c-c++-common/pr100059-1.c'" (omitting PR100059 tag unfortunately), see attached. Grüße Thomas ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955 From fe0f9e09413047484441468b05288412760d8a09 Mon Sep 17 00:00:00 2001 From: Tobias Burnus Date: Tue, 13 Apr 2021 08:58:51 +0000 Subject: [PATCH] Add 'libgomp.c-c++-common/pr100059-1.c' For nvptx offloading, it'll FAIL its execution test until nvptx-tools updated to include commit 1b5946d78ef5dcfb640e9f545a7c791b7f623911 "Merge commit '26095fd01232061de9f79decb3e8222ef7b46191' into HEAD [#29]", . libgomp/ * testsuite/libgomp.c-c++-common/pr100059-1.c: New. Co-authored-by: Thomas Schwinge --- .../libgomp.c-c++-common/pr100059-1.c | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 libgomp/testsuite/libgomp.c-c++-common/pr100059-1.c diff --git a/libgomp/testsuite/libgomp.c-c++-common/pr100059-1.c b/libgomp/testsuite/libgomp.c-c++-common/pr100059-1.c new file mode 100644 index 00000000000..af12295541a --- /dev/null +++ b/libgomp/testsuite/libgomp.c-c++-common/pr100059-1.c @@ -0,0 +1,55 @@ +/* Based on sollve_vv's tests/5.0/declare_target/test_nested_declare_target.c. */ + +#define N 1024 +int a[N], b[N], c[N]; +int i = 0; + +void +update () +{ + for (i = 0; i < N; i++) + { + a[i] += 1; + b[i] += 2; + c[i] += 3; + } +} + +#pragma omp declare target +#pragma omp declare target link(a,c,b,i) +#pragma omp declare target to(update) +#pragma omp end declare target + +int +main () +{ + for (i = 0; i < N; i++) + { + a[i] = i; + b[i] = i + 1; + c[i] = i + 2; + } + + //__builtin_printf("i=5: A=%d, B=%d, C=%d\n", a[5], b[5], c[5]); + + #pragma omp target map(to: i) map(tofrom: a, b, c) + { + update(); /* Device. */ + } + + //__builtin_printf("i=5: A=%d, B=%d, C=%d\n", a[5], b[5], c[5]); + + for (i = 0; i < N; i++) + if ( a[i] != i + 1 || b[i] != i + 3 || c[i] != i + 5) + __builtin_abort(); + + update(); /* Host. */ + + //__builtin_printf("i=5: A=%d, B=%d, C=%d\n", a[5], b[5], c[5]); + + for (i = 0; i < N; i++) + if ( a[i] != i + 2 || b[i] != i + 5 || c[i] != i + 8) + __builtin_abort (); + + return 0; +} -- 2.34.1