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: 137452 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ab0a:0:b0:3f2:4152:657d with SMTP id m10csp1071972vqo; Mon, 4 Sep 2023 05:55:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFZ7b9mDQ0rsl58FNy9WeFBZTuixY7uY309GYfrcMEsJ3Ku3HQ6WarBlc/BN0odcbblb+/P X-Received: by 2002:ac2:4897:0:b0:500:80af:e199 with SMTP id x23-20020ac24897000000b0050080afe199mr5269366lfc.55.1693832105821; Mon, 04 Sep 2023 05:55:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693832105; cv=none; d=google.com; s=arc-20160816; b=p37XY1vrufBm+trS4SEO0hpyML+5m56ey93m2n4prsCL7CRoyMA8XbHYkTLhUYrKv3 4PWqiqzNbdRTLnPlhbDnreSWaznd/uKkNMq3S5yiKAj1ZXAw3oG+2dPERaYzm/Fu3rsZ F76kI0O9gdXRG6SND705clJ5tx8TyGmoI1sLg7/b0TET+KeY5uvKpGfTpmMrqWJH/GOn QYmiY2ATBhRK6aqebrdfW8HjPMTit3cSgiZqUsgUvJVT7pej8aVem0lag1bxM6RhIMuC Y1Z7hsvZM6UDWLO1YNUOZVb3atmtmhLTftxTLx72NtnwJIcT9zF4psp/ePQ6YU6bHkEP RGZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mime-version:message-id:date :user-agent:subject:cc:to:from:ironport-sdr:dmarc-filter :delivered-to; bh=Lrc1vHjVW+ii/4Etdzz2+BiR1McTUiiw/y82GOzKQ18=; fh=b7yh6hgVXU1ji5ATMZOd9ZFZUzlFc7UY+0FpuhdhR64=; b=wmcBfKRL6w19EwTdvT8BtGWo9OEus+C3ZBs/vSeB0/Bp57f5HEP+xD3AaFqL8uASvy gOpeLXINER5QrP2f1eBAfI0L5bW/lnSuugveAb2o61PtR+Uu8SnNbrQ41NLd/BGhDVtr cIGWwMQU5KWsNvdDXX8MYQmqrA2pdpjxJr/4BEoofmk5Fc3aLuWd7wNa/KX5Fpv0owbY 1YhMNEReXy6B8JEeClo7zH37elyAxge+zbhcwiTTM0Nzi9R44OXoCn9ErPAJ4Q9BzZpP gu7XajrFin4iEpH4DQsaK2Vkx9o40nC89vKxKA2sZY+4wgsQ53juBxbzvBcEqFUIi6g2 3Nxg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id m16-20020a056402051000b0052a1a4b3879si6430877edv.232.2023.09.04.05.55.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Sep 2023 05:55:05 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 383263858028 for ; Mon, 4 Sep 2023 12:55:00 +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+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776111694196480926 X-GMAIL-MSGID: 1776111694196480926 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