From patchwork Tue Jun 8 09:53:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 1489274 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=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from 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 RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Fzltm2vW9z9sSn for ; Tue, 8 Jun 2021 19:53:52 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DBFBD394FC20 for ; Tue, 8 Jun 2021 09:53:49 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa2.mentor.iphmx.com (esa2.mentor.iphmx.com [68.232.141.98]) by sourceware.org (Postfix) with ESMTPS id 828C63844051 for ; Tue, 8 Jun 2021 09:53:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 828C63844051 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com IronPort-SDR: fJK1tglRqjqVEtSi3Px9ztnliLA6zQvTZF9wzrj30xZmaLOOXmVXx+Uufy7vWGyFvnlStVNGBZ uU0FEwMu1UL4gg7T001WKyoDgTgceDd0car5e7R83QqJwWUXpIdQ0Bun20Wgkd+H0fI10ulJr9 GRSQ0cH7x0gsdUadNHPyM9YVO3PmYZ9uXMqasyGpG2MEp+SVozMnguBnONgvoSQC1i6YXEWT8Z FWZBUyNEzoNN7BHdsplyK4dKwZMkKaxgVmhbgG711qNf68ubBAVPutgJkOPh54HSjWJFbLvBOm B0U= X-IronPort-AV: E=Sophos;i="5.83,257,1616486400"; d="scan'208,223";a="62119339" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa2.mentor.iphmx.com with ESMTP; 08 Jun 2021 01:53:33 -0800 IronPort-SDR: l/O2uTGCjHZeP1jDMNrT7LqURpu4Z0tVIfuTBr7L5jT1WrQr7Ja+NPYx06KRZHrwu+9kEV7DVj Jd4EJGKekKj6ZkKujfIe1t4D3tRECoB3CSbyozgsRQHc9zpf8YAsLIsDjgSDvPrpWV4XXGEOtT 2cvdZkQZbhOkfe6l/S3ChRl6hGs8xATVEEua7XNzcRUCrwqijfys6eOsXwevJT4n8y99CixTu6 6E/uwBGusO3zHT05zvla8ptUTbuj2me8W5APtGt3QJVo4oOlh2pyIomJPaQbmMsZf4IQwdYAgx x/M= From: Thomas Schwinge To: Subject: Enable more 'libgomp.oacc-*/lib-*' testcases for non-'openacc_nvidia_accel_selected' User-Agent: Notmuch/0.29.3+94~g74c3f1b (https://notmuchmail.org) Emacs/27.1 (x86_64-pc-linux-gnu) Date: Tue, 8 Jun 2021 11:53:26 +0200 Message-ID: <87y2bkwull.fsf@euler.schwinge.homeip.net> MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: SVR-IES-MBX-03.mgc.mentorg.com (139.181.222.3) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, RCVD_IN_DNSWL_LOW, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 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! An old patch refreshed: pushed "Enable more 'libgomp.oacc-*/lib-*' testcases for non-'openacc_nvidia_accel_selected'" to master branch in commit c68ddd5e2a9dd0cfe21c3661404d7d4c323b23cf, see attached. Grüße Thomas ----------------- Mentor Graphics (Deutschland) GmbH, Arnulfstrasse 201, 80634 München Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Frank Thürauf From c68ddd5e2a9dd0cfe21c3661404d7d4c323b23cf Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Thu, 31 Oct 2019 17:40:13 +0100 Subject: [PATCH] Enable more 'libgomp.oacc-*/lib-*' testcases for non-'openacc_nvidia_accel_selected' libgomp/ * testsuite/libgomp.oacc-c-c++-common/lib-11.c: Enable for all but '-DACC_MEM_SHARED=0'. * testsuite/libgomp.oacc-c-c++-common/lib-13.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/lib-14.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/lib-15.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/lib-20.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/lib-23.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/lib-24.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/lib-34.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/lib-42.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/lib-44.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/lib-48.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/lib-88.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/lib-89.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/lib-92.c: Likewise. * testsuite/libgomp.oacc-fortran/lib-14.f90: Likewise. * testsuite/libgomp.oacc-c-c++-common/lib-5.c: Add 'acc_device_radeon' testing. * testsuite/libgomp.oacc-c-c++-common/lib-6.c: Likewise. * testsuite/libgomp.oacc-fortran/lib-5.f90: Likewise. * testsuite/libgomp.oacc-fortran/lib-7.f90: Likewise. * testsuite/libgomp.oacc-c-c++-common/lib-52.c: Enable for all. * testsuite/libgomp.oacc-c-c++-common/lib-53.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/lib-54.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/lib-86.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/lib-87.c: Likewise. * testsuite/libgomp.oacc-fortran/lib-10.f90: Likewise. * testsuite/libgomp.oacc-fortran/lib-8.f90: Likewise. * testsuite/libgomp.oacc-c-c++-common/lib-57.c: Improve checking for non-'openacc_nvidia_accel_selected'. * testsuite/libgomp.oacc-c-c++-common/lib-58.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/lib-62.c: Clarify that "Not all implement this checking". * testsuite/libgomp.oacc-c-c++-common/lib-63.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/lib-64.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/lib-65.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/lib-67.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/lib-68.c: Likewise. --- .../libgomp.oacc-c-c++-common/lib-11.c | 10 ++-- .../libgomp.oacc-c-c++-common/lib-13.c | 2 +- .../libgomp.oacc-c-c++-common/lib-14.c | 2 +- .../libgomp.oacc-c-c++-common/lib-15.c | 2 +- .../libgomp.oacc-c-c++-common/lib-20.c | 4 +- .../libgomp.oacc-c-c++-common/lib-23.c | 4 +- .../libgomp.oacc-c-c++-common/lib-24.c | 2 +- .../libgomp.oacc-c-c++-common/lib-34.c | 4 +- .../libgomp.oacc-c-c++-common/lib-42.c | 4 +- .../libgomp.oacc-c-c++-common/lib-44.c | 4 +- .../libgomp.oacc-c-c++-common/lib-48.c | 4 +- .../libgomp.oacc-c-c++-common/lib-5.c | 20 +++++++- .../libgomp.oacc-c-c++-common/lib-52.c | 6 +-- .../libgomp.oacc-c-c++-common/lib-53.c | 6 +-- .../libgomp.oacc-c-c++-common/lib-54.c | 6 +-- .../libgomp.oacc-c-c++-common/lib-57.c | 2 +- .../libgomp.oacc-c-c++-common/lib-58.c | 2 +- .../libgomp.oacc-c-c++-common/lib-6.c | 47 ++++++++++++++----- .../libgomp.oacc-c-c++-common/lib-62.c | 3 +- .../libgomp.oacc-c-c++-common/lib-63.c | 3 +- .../libgomp.oacc-c-c++-common/lib-64.c | 3 +- .../libgomp.oacc-c-c++-common/lib-65.c | 3 +- .../libgomp.oacc-c-c++-common/lib-67.c | 3 +- .../libgomp.oacc-c-c++-common/lib-68.c | 3 +- .../libgomp.oacc-c-c++-common/lib-86.c | 27 +++++++---- .../libgomp.oacc-c-c++-common/lib-87.c | 27 +++++++---- .../libgomp.oacc-c-c++-common/lib-88.c | 9 +--- .../libgomp.oacc-c-c++-common/lib-89.c | 18 +++---- .../libgomp.oacc-c-c++-common/lib-92.c | 18 +++---- .../testsuite/libgomp.oacc-fortran/lib-10.f90 | 6 +-- .../testsuite/libgomp.oacc-fortran/lib-14.f90 | 3 +- .../testsuite/libgomp.oacc-fortran/lib-5.f90 | 46 ++++++++++++++---- .../testsuite/libgomp.oacc-fortran/lib-7.f90 | 46 ++++++++++++++---- .../testsuite/libgomp.oacc-fortran/lib-8.f90 | 6 +-- 34 files changed, 225 insertions(+), 130 deletions(-) diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-11.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-11.c index 86cfeb68c5d..1f05161436c 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-11.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-11.c @@ -1,5 +1,4 @@ -/* Only nvptx plugin does the required error checking. - { dg-do run { target openacc_nvidia_accel_selected } } */ +/* { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } } */ #include #include @@ -22,6 +21,9 @@ main (int argc, char **argv) return 0; } -/* { dg-output "CheCKpOInT(\n|\r\n|\r).*" } */ -/* { dg-output "invalid device address" } */ +/* { dg-output "CheCKpOInT(\n|\r\n|\r)+" } */ +/* { dg-output "libgomp: invalid device address(\n|\r\n|\r)+" { target openacc_nvidia_accel_selected } } */ +/* { dg-output "libgomp: GCN fatal error: Could not free device memory(\n|\r\n|\r)+" { target openacc_radeon_accel_selected } } + { dg-output "Runtime message: HSA_STATUS_ERROR_INVALID_ALLOCATION: The requested allocation is not valid\.(\n|\r\n|\r)+" { target openacc_radeon_accel_selected } } */ +/* { dg-output "libgomp: error in freeing device memory in acc_free(\n|\r\n|\r)+$" } */ /* { dg-shouldfail "" } */ diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-13.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-13.c index aca4c252091..90b137fb20b 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-13.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-13.c @@ -1,6 +1,6 @@ /* Check acc_is_present and acc_delete. */ -/* { dg-do run { target openacc_nvidia_accel_selected } } */ +/* { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } } */ #include #include diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-14.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-14.c index de6d38b060c..892f97c31ef 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-14.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-14.c @@ -1,6 +1,6 @@ /* Check acc_is_present. */ -/* { dg-do run { target openacc_nvidia_accel_selected } } */ +/* { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } } */ #include #include diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-15.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-15.c index 50c17011fe7..335b26f8fca 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-15.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-15.c @@ -1,6 +1,6 @@ /* Check acc_is_present and acc_copyout. */ -/* { dg-do run { target openacc_nvidia_accel_selected } } */ +/* { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } } */ #include #include diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-20.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-20.c index 10d3cbc5cc6..f1d9a21ecd3 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-20.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-20.c @@ -1,6 +1,6 @@ -/* Exercise acc_copyin and acc_copyout on nvidia targets. */ +/* Exercise acc_copyin and acc_copyout. */ -/* { dg-do run { target openacc_nvidia_accel_selected } } */ +/* { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } } */ #include #include diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-23.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-23.c index b1f3e71f278..d39f31e6245 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-23.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-23.c @@ -1,6 +1,6 @@ -/* Exercise acc_copyin and acc_copyout on nvidia targets. */ +/* Exercise acc_copyin and acc_copyout. */ -/* { dg-do run { target openacc_nvidia_accel_selected } } */ +/* { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } } */ #include #include diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-24.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-24.c index 09e2817f41d..96e3129e563 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-24.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-24.c @@ -1,6 +1,6 @@ /* Exercise acc_create, acc_is_present and acc_delete. */ -/* { dg-do run { target openacc_nvidia_accel_selected } } */ +/* { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } } */ #include #include diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-34.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-34.c index a24916d1306..8ddd897826f 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-34.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-34.c @@ -1,6 +1,6 @@ -/* Exercise an invalid acc_present_or_create on nvidia targets. */ +/* Exercise an invalid acc_present_or_create. */ -/* { dg-do run { target openacc_nvidia_accel_selected } } */ +/* { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } } */ #include #include diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-42.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-42.c index 30b90d49c7b..adab1098ed8 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-42.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-42.c @@ -1,6 +1,6 @@ -/* Exercise acc_update_device on unmapped data on nvidia targets. */ +/* Exercise acc_update_device on unmapped data. */ -/* { dg-do run { target openacc_nvidia_accel_selected } } */ +/* { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } } */ #include #include diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-44.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-44.c index 8bbf016a191..f02fe2188dc 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-44.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-44.c @@ -1,6 +1,6 @@ -/* Exercise acc_update_device with size zero data on nvidia targets. */ +/* Exercise acc_update_device with size zero data. */ -/* { dg-do run { target openacc_nvidia_accel_selected } } */ +/* { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } } */ #include #include diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-48.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-48.c index afa137ff098..9975c9e990b 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-48.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-48.c @@ -1,6 +1,6 @@ -/* Exercise acc_update_self with a size zero data mapping on nvidia targets. */ +/* Exercise acc_update_self with a size zero data mapping. */ -/* { dg-do run { target openacc_nvidia_accel_selected } } */ +/* { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } } */ #include #include diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-5.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-5.c index 961a62c2b63..1e0ab9cca70 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-5.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-5.c @@ -35,6 +35,24 @@ main (int argc, char **argv) acc_shutdown (acc_device_nvidia); } - return 0; + if (acc_get_num_devices (acc_device_radeon) != 0) + { + acc_init (acc_device_radeon); + + if (acc_get_device_type () != acc_device_radeon) + abort (); + + acc_shutdown (acc_device_radeon); + + acc_init (acc_device_default); + acc_set_device_type (acc_device_radeon); + + if (acc_get_device_type () != acc_device_radeon) + abort (); + + acc_shutdown (acc_device_radeon); + } + + return 0; } diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-52.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-52.c index 25c70c226f4..9a562b3d0aa 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-52.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-52.c @@ -1,6 +1,4 @@ -/* Exercise acc_map_data with a NULL data mapping on nvidia targets. */ - -/* { dg-do run { target openacc_nvidia_accel_selected } } */ +/* Exercise acc_map_data with a NULL data mapping. */ #include #include @@ -30,6 +28,6 @@ main (int argc, char **argv) } /* { dg-output "CheCKpOInT(\n|\r\n|\r).*" } */ -/* { dg-output "\\\[\[^\n\r]*,\\\+256\]->\[\[0-9a-fA-FxX\]+,\\\+256\\\] is a bad map" { target openacc_nvidia_accel_selected } } */ +/* { dg-output "\\\[\[^\n\r]*,\\\+256\]->\[\[0-9a-fA-FxX\]+,\\\+256\\\] is a bad map" { target { ! openacc_host_selected } } } */ /* { dg-output "cannot map data on shared-memory system" { target openacc_host_selected } } */ /* { dg-shouldfail "" } */ diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-53.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-53.c index a8ee7df629c..d452a694750 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-53.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-53.c @@ -1,6 +1,4 @@ -/* Exercise acc_map_data with a NULL data mapping on nvidia targets. */ - -/* { dg-do run { target openacc_nvidia_accel_selected } } */ +/* Exercise acc_map_data with a NULL data mapping. */ #include #include @@ -30,6 +28,6 @@ main (int argc, char **argv) } /* { dg-output "CheCKpOInT(\n|\r\n|\r).*" } */ -/* { dg-output "\\\[\[0-9a-fA-FxX\]+,\\\+256\]->\\\[\[^\n\r]*,\\\+256\\\] is a bad map" { target openacc_nvidia_accel_selected } } */ +/* { dg-output "\\\[\[0-9a-fA-FxX\]+,\\\+256\]->\\\[\[^\n\r]*,\\\+256\\\] is a bad map" { target { ! openacc_host_selected } } } */ /* { dg-output "cannot map data on shared-memory system" { target openacc_host_selected } } */ /* { dg-shouldfail "" } */ diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-54.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-54.c index fc221f47116..19227546312 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-54.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-54.c @@ -1,6 +1,4 @@ -/* Exercise acc_map_data with data size of zero on nvidia targets. */ - -/* { dg-do run { target openacc_nvidia_accel_selected } } */ +/* Exercise acc_map_data with data size of zero. */ #include #include @@ -30,6 +28,6 @@ main (int argc, char **argv) } /* { dg-output "CheCKpOInT(\n|\r\n|\r).*" } */ -/* { dg-output "\\\[\[0-9a-fA-FxX\]+,\\\+0\\\]->\\\[\[0-9a-fA-FxX\]+,\\\+0\\\] is a bad map" { target openacc_nvidia_accel_selected } } */ +/* { dg-output "\\\[\[0-9a-fA-FxX\]+,\\\+0\\\]->\\\[\[0-9a-fA-FxX\]+,\\\+0\\\] is a bad map" { target { ! openacc_host_selected } } } */ /* { dg-output "cannot map data on shared-memory system" { target openacc_host_selected } } */ /* { dg-shouldfail "" } */ diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-57.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-57.c index 971a0147f3d..81653c6a083 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-57.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-57.c @@ -33,6 +33,6 @@ main (int argc, char **argv) } /* { dg-output "CheCKpOInT(\n|\r\n|\r).*" } */ -/* { dg-output "\[0-9a-fA-FxX\]+ is not a mapped block" { target openacc_nvidia_accel_selected } } */ +/* { dg-output "\[0-9a-fA-FxX\]+ is not a mapped block" { target { ! openacc_host_selected } } } */ /* { dg-output "cannot map data on shared-memory system" { target openacc_host_selected } } */ /* { dg-shouldfail "" } */ diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-58.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-58.c index fedda77004b..c6bc2610cac 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-58.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-58.c @@ -33,6 +33,6 @@ main (int argc, char **argv) } /* { dg-output "CheCKpOInT(\n|\r\n|\r).*" } */ -/* { dg-output "\[^\n\r]* is not a mapped block" { target openacc_nvidia_accel_selected } } */ +/* { dg-output "\[^\n\r]* is not a mapped block" { target { ! openacc_host_selected } } } */ /* { dg-output "cannot map data on shared-memory system" { target openacc_host_selected } } */ /* { dg-shouldfail "" } */ diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-6.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-6.c index afdd480cb71..a3affc0c20d 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-6.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-6.c @@ -11,26 +11,47 @@ main (int argc, char **argv) if (acc_get_device_type () == acc_device_default) abort (); - if (acc_get_num_devices (acc_device_nvidia) == 0) - return 0; + if (acc_get_num_devices (acc_device_nvidia)) + { + acc_set_device_type (acc_device_nvidia); - acc_set_device_type (acc_device_nvidia); + if (acc_get_device_type () != acc_device_nvidia) + abort (); - if (acc_get_device_type () != acc_device_nvidia) - abort (); + acc_shutdown (acc_device_nvidia); - acc_shutdown (acc_device_nvidia); + acc_set_device_type (acc_device_nvidia); - acc_set_device_type (acc_device_nvidia); + if (acc_get_device_type () != acc_device_nvidia) + abort (); - if (acc_get_device_type () != acc_device_nvidia) - abort (); + devnum = acc_get_num_devices (acc_device_host); + if (devnum != 1) + abort (); - devnum = acc_get_num_devices (acc_device_host); - if (devnum != 1) - abort (); + acc_shutdown (acc_device_nvidia); + } + + if (acc_get_num_devices (acc_device_radeon)) + { + acc_set_device_type (acc_device_radeon); + + if (acc_get_device_type () != acc_device_radeon) + abort (); + + acc_shutdown (acc_device_radeon); + + acc_set_device_type (acc_device_radeon); + + if (acc_get_device_type () != acc_device_radeon) + abort (); + + devnum = acc_get_num_devices (acc_device_host); + if (devnum != 1) + abort (); - acc_shutdown (acc_device_nvidia); + acc_shutdown (acc_device_radeon); + } if (acc_get_device_type () == acc_device_default) abort (); diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-62.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-62.c index ace4b058b9b..2e7184a918b 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-62.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-62.c @@ -1,4 +1,5 @@ -/* { dg-do run { target openacc_nvidia_accel_selected } } */ +/* Not all implement this checking. + { dg-skip-if "" { openacc_radeon_accel_selected || openacc_host_selected } } */ #include #include diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-63.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-63.c index a3fa728510f..84bbccb448e 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-63.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-63.c @@ -1,4 +1,5 @@ -/* { dg-do run { target openacc_nvidia_accel_selected } } */ +/* Not all implement this checking. + { dg-skip-if "" { openacc_radeon_accel_selected || openacc_host_selected } } */ #include #include diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-64.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-64.c index b57f67a0058..e26681a7b4d 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-64.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-64.c @@ -1,4 +1,5 @@ -/* { dg-do run { target openacc_nvidia_accel_selected } } */ +/* Not all implement this checking. + { dg-skip-if "" { openacc_radeon_accel_selected || openacc_host_selected } } */ #include #include diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-65.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-65.c index 0fca8214e76..69add3ffedb 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-65.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-65.c @@ -1,4 +1,5 @@ -/* { dg-do run { target openacc_nvidia_accel_selected } } */ +/* Not all implement this checking. + { dg-skip-if "" { openacc_radeon_accel_selected || openacc_host_selected } } */ #include #include diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-67.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-67.c index ec3c2a53baf..c13333b3b48 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-67.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-67.c @@ -1,4 +1,5 @@ -/* { dg-do run { target openacc_nvidia_accel_selected } } */ +/* Not all implement this checking. + { dg-skip-if "" { openacc_radeon_accel_selected || openacc_host_selected } } */ #include #include diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-68.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-68.c index f10903443d8..7fffd0b9f0b 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-68.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-68.c @@ -1,4 +1,5 @@ -/* { dg-do run { target openacc_nvidia_accel_selected } } */ +/* Not all implement this checking. + { dg-skip-if "" { openacc_radeon_accel_selected || openacc_host_selected } } */ #include #include diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-86.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-86.c index b8a8ee94a58..7e8a7e20203 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-86.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-86.c @@ -7,9 +7,6 @@ int main (int argc, char **argv) { - if (acc_get_num_devices (acc_device_nvidia) == 0) - return 0; - if (acc_get_current_cuda_device () != 0) abort (); @@ -20,18 +17,28 @@ main (int argc, char **argv) acc_shutdown (acc_device_host); - if (acc_get_num_devices (acc_device_nvidia) == 0) - return 0; - if (acc_get_current_cuda_device () != 0) abort (); - acc_init (acc_device_nvidia); + if (acc_get_num_devices (acc_device_nvidia)) + { + acc_init (acc_device_nvidia); - if (acc_get_current_cuda_device () == 0) - abort (); + if (acc_get_current_cuda_device () == 0) + abort (); + + acc_shutdown (acc_device_nvidia); + } + + if (acc_get_num_devices (acc_device_radeon)) + { + acc_init (acc_device_radeon); + + if (acc_get_current_cuda_device () != 0) + abort (); - acc_shutdown (acc_device_nvidia); + acc_shutdown (acc_device_radeon); + } if (acc_get_current_cuda_device () != 0) abort (); diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-87.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-87.c index 147d443b54d..cdc87edc590 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-87.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-87.c @@ -7,9 +7,6 @@ int main (int argc, char **argv) { - if (acc_get_num_devices (acc_device_nvidia) == 0) - return 0; - if (acc_get_current_cuda_context () != 0) abort (); @@ -20,18 +17,28 @@ main (int argc, char **argv) acc_shutdown (acc_device_host); - if (acc_get_num_devices (acc_device_nvidia) == 0) - return 0; - if (acc_get_current_cuda_context () != 0) abort (); - acc_init (acc_device_nvidia); + if (acc_get_num_devices (acc_device_nvidia)) + { + acc_init (acc_device_nvidia); - if (acc_get_current_cuda_context () == 0) - abort (); + if (acc_get_current_cuda_context () == 0) + abort (); + + acc_shutdown (acc_device_nvidia); + } + + if (acc_get_num_devices (acc_device_radeon)) + { + acc_init (acc_device_radeon); + + if (acc_get_current_cuda_context () != 0) + abort (); - acc_shutdown (acc_device_nvidia); + acc_shutdown (acc_device_radeon); + } if (acc_get_current_cuda_context () != 0) abort (); diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-88.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-88.c index 10f4ad8664a..c1cccd919c3 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-88.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-88.c @@ -1,4 +1,4 @@ -/* { dg-do run } */ +/* { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } } */ #include #include @@ -47,10 +47,7 @@ main (int argc, char **argv) pthread_attr_t attr; pthread_t *tid; - if (acc_get_num_devices (acc_device_nvidia) == 0) - return 0; - - acc_init (acc_device_nvidia); + acc_init (acc_device_default); x = (unsigned char *) malloc (N); @@ -103,8 +100,6 @@ main (int argc, char **argv) if (acc_is_present (x, N) != 0) abort (); - acc_shutdown (acc_device_nvidia); - return 0; } diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-89.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-89.c index 061c4099c2d..6b4e3acf7db 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-89.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-89.c @@ -1,4 +1,4 @@ -/* { dg-do run } */ +/* { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } } */ #include #include @@ -23,11 +23,16 @@ test (void *arg) tid = (int) (long) arg; - devnum = acc_get_device_num (acc_device_nvidia); - acc_set_device_num (devnum, acc_device_nvidia); + devnum = acc_get_device_num (acc_device_default); + acc_set_device_num (devnum, acc_device_default); +#if ACC_DEVICE_TYPE_nvidia if (acc_get_current_cuda_context () == NULL) abort (); +#else + if (acc_get_current_cuda_context () != NULL) + abort (); +#endif p = (unsigned char *) malloc (N); @@ -50,10 +55,7 @@ main (int argc, char **argv) pthread_attr_t attr; pthread_t *tid; - if (acc_get_num_devices (acc_device_nvidia) == 0) - return 0; - - acc_init (acc_device_nvidia); + acc_init (acc_device_default); x = (unsigned char **) malloc (NTHREADS * N); d_x = (void **) malloc (NTHREADS * N); @@ -110,8 +112,6 @@ main (int argc, char **argv) abort (); } - acc_shutdown (acc_device_nvidia); - return 0; } diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-92.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-92.c index 18193e0e8f9..0043fb3109d 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-92.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-92.c @@ -1,4 +1,4 @@ -/* { dg-do run } */ +/* { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } } */ #include #include @@ -22,11 +22,16 @@ test (void *arg) tid = (int) (long) arg; - devnum = acc_get_device_num (acc_device_nvidia); - acc_set_device_num (devnum, acc_device_nvidia); + devnum = acc_get_device_num (acc_device_default); + acc_set_device_num (devnum, acc_device_default); +#if ACC_DEVICE_TYPE_nvidia if (acc_get_current_cuda_context () == NULL) abort (); +#else + if (acc_get_current_cuda_context () != NULL) + abort (); +#endif acc_copyout (x[tid], N); @@ -49,10 +54,7 @@ main (int argc, char **argv) pthread_t *tid; unsigned char *p; - if (acc_get_num_devices (acc_device_nvidia) == 0) - return 0; - - acc_init (acc_device_nvidia); + acc_init (acc_device_default); x = (unsigned char **) malloc (NTHREADS * N); d_x = (void **) malloc (NTHREADS * N); @@ -104,8 +106,6 @@ main (int argc, char **argv) abort (); } - acc_shutdown (acc_device_nvidia); - return 0; } diff --git a/libgomp/testsuite/libgomp.oacc-fortran/lib-10.f90 b/libgomp/testsuite/libgomp.oacc-fortran/lib-10.f90 index 2875f162ba4..2b2f8fede02 100644 --- a/libgomp/testsuite/libgomp.oacc-fortran/lib-10.f90 +++ b/libgomp/testsuite/libgomp.oacc-fortran/lib-10.f90 @@ -15,9 +15,7 @@ program main integer, parameter :: c_size = sizeof (c) integer, parameter :: r_size = sizeof (r) - if (acc_get_num_devices (acc_device_nvidia) .eq. 0) call exit - - call acc_init (acc_device_nvidia) + call acc_init (acc_device_default) call set3d (.FALSE., a_3d_i, a_3d_c, a_3d_r) @@ -39,8 +37,6 @@ program main end do end do - call acc_shutdown (acc_device_nvidia) - contains subroutine set3d (clear, a_i, a_c, a_r) diff --git a/libgomp/testsuite/libgomp.oacc-fortran/lib-14.f90 b/libgomp/testsuite/libgomp.oacc-fortran/lib-14.f90 index bf35631c96b..90c2868e643 100644 --- a/libgomp/testsuite/libgomp.oacc-fortran/lib-14.f90 +++ b/libgomp/testsuite/libgomp.oacc-fortran/lib-14.f90 @@ -1,7 +1,8 @@ ! Exercise the data movement runtime library functions on non-shared memory ! targets. -! { dg-do run { target openacc_nvidia_accel_selected } } +! { dg-do run } +! { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } } program main use openacc diff --git a/libgomp/testsuite/libgomp.oacc-fortran/lib-5.f90 b/libgomp/testsuite/libgomp.oacc-fortran/lib-5.f90 index 505b2c6f246..08808a4023b 100644 --- a/libgomp/testsuite/libgomp.oacc-fortran/lib-5.f90 +++ b/libgomp/testsuite/libgomp.oacc-fortran/lib-5.f90 @@ -6,26 +6,52 @@ program main integer n - if (acc_get_num_devices (acc_device_nvidia) .eq. 0) call exit + if (acc_get_num_devices (acc_device_nvidia) .ne. 0) then - call acc_init (acc_device_nvidia) + call acc_init (acc_device_nvidia) - n = 0 + n = 0 - call acc_set_device_num (n, acc_device_nvidia) + call acc_set_device_num (n, acc_device_nvidia) - if (acc_get_device_num (acc_device_nvidia) .ne. 0) STOP 1 + if (acc_get_device_num (acc_device_nvidia) .ne. 0) stop 11 - if (acc_get_num_devices (acc_device_nvidia) .gt. 1) then + if (acc_get_num_devices (acc_device_nvidia) .gt. 1) then - n = 1 + n = 1 - call acc_set_device_num (n, acc_device_nvidia) + call acc_set_device_num (n, acc_device_nvidia) - if (acc_get_device_num (acc_device_nvidia) .ne. 1) STOP 2 + if (acc_get_device_num (acc_device_nvidia) .ne. 1) stop 12 + + end if + + call acc_shutdown (acc_device_nvidia) end if - call acc_shutdown (acc_device_nvidia) + if (acc_get_num_devices (acc_device_radeon) .ne. 0) then + + call acc_init (acc_device_radeon) + + n = 0 + + call acc_set_device_num (n, acc_device_radeon) + + if (acc_get_device_num (acc_device_radeon) .ne. 0) stop 21 + + if (acc_get_num_devices (acc_device_radeon) .gt. 1) then + + n = 1 + + call acc_set_device_num (n, acc_device_radeon) + + if (acc_get_device_num (acc_device_radeon) .ne. 1) stop 22 + + end if + + call acc_shutdown (acc_device_radeon) + + end if end program diff --git a/libgomp/testsuite/libgomp.oacc-fortran/lib-7.f90 b/libgomp/testsuite/libgomp.oacc-fortran/lib-7.f90 index 2ce93c359ca..fa610b16d34 100644 --- a/libgomp/testsuite/libgomp.oacc-fortran/lib-7.f90 +++ b/libgomp/testsuite/libgomp.oacc-fortran/lib-7.f90 @@ -6,26 +6,52 @@ program main integer n - if (acc_get_num_devices (acc_device_nvidia) .eq. 0) call exit + if (acc_get_num_devices (acc_device_nvidia) .ne. 0) then - call acc_init (acc_device_nvidia) + call acc_init (acc_device_nvidia) - n = 0 + n = 0 - call acc_set_device_num (n, acc_device_nvidia) + call acc_set_device_num (n, acc_device_nvidia) - if (acc_get_device_num (acc_device_nvidia) .ne. 0) STOP 1 + if (acc_get_device_num (acc_device_nvidia) .ne. 0) STOP 1 - if (acc_get_num_devices (acc_device_nvidia) .gt. 1) then + if (acc_get_num_devices (acc_device_nvidia) .gt. 1) then - n = 1 + n = 1 - call acc_set_device_num (n, acc_device_nvidia) + call acc_set_device_num (n, acc_device_nvidia) - if (acc_get_device_num (acc_device_nvidia) .ne. 1) STOP 2 + if (acc_get_device_num (acc_device_nvidia) .ne. 1) STOP 2 + + end if + + call acc_shutdown (acc_device_nvidia) end if - call acc_shutdown (acc_device_nvidia) + if (acc_get_num_devices (acc_device_radeon) .ne. 0) then + + call acc_init (acc_device_radeon) + + n = 0 + + call acc_set_device_num (n, acc_device_radeon) + + if (acc_get_device_num (acc_device_radeon) .ne. 0) STOP 1 + + if (acc_get_num_devices (acc_device_radeon) .gt. 1) then + + n = 1 + + call acc_set_device_num (n, acc_device_radeon) + + if (acc_get_device_num (acc_device_radeon) .ne. 1) STOP 2 + + end if + + call acc_shutdown (acc_device_radeon) + + end if end program diff --git a/libgomp/testsuite/libgomp.oacc-fortran/lib-8.f90 b/libgomp/testsuite/libgomp.oacc-fortran/lib-8.f90 index 263cedb5c5b..2b36b4078f6 100644 --- a/libgomp/testsuite/libgomp.oacc-fortran/lib-8.f90 +++ b/libgomp/testsuite/libgomp.oacc-fortran/lib-8.f90 @@ -16,9 +16,7 @@ program main integer, parameter :: c_size = sizeof (c) integer, parameter :: r_size = sizeof (r) - if (acc_get_num_devices (acc_device_nvidia) .eq. 0) call exit - - call acc_init (acc_device_nvidia) + call acc_init (acc_device_default) call set3d (.FALSE., a_3d_i, a_3d_c, a_3d_r) @@ -40,8 +38,6 @@ program main end do end do - call acc_shutdown (acc_device_nvidia) - contains subroutine set3d (clear, a_i, a_c, a_r) -- 2.30.2