From patchwork Mon Feb 29 16:30:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Jambor X-Patchwork-Id: 593072 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 5A593140216 for ; Tue, 8 Mar 2016 04:35:37 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=KaeI+UvU; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :resent-from:resent-date:resent-message-id:resent-to:message-id :in-reply-to:references:from:date:subject:to; q=dns; s=default; b= f0D37CXuTpPhm6XqIc29XbeX248UkROxmqpOK4xWT4eLq6G9clacbxFkuB6HOQj7 c8Oj1Qh82ghGK4UqBW+BtSPCH3jNUzN0HVs+aq2LTgMrE5Mpg8zzgb5g/M5O92MN ZQonKCpGpQLguuICD0gMHGuuCykBm7oDvW9cB5jciYk= 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 :resent-from:resent-date:resent-message-id:resent-to:message-id :in-reply-to:references:from:date:subject:to; s=default; bh=Fgmt qjbeQtg/Jdbyf7vYAnLRDfA=; b=KaeI+UvUvtvnrkgeuGBSgeicZ+7TAwa4Z0Zl RqnMa2SglVUuc1npgcHdcaFvIWdz1QktWkLRYoBUo0sObgXq0BWqIouhB6BhQvMH 4FD6x4DxHs9WP4z3XsSkPQZcKrGNCVOOHck/c817qzWJ7hAd0JMJXPLvwAhxKvzA tAuodGI= Received: (qmail 115709 invoked by alias); 7 Mar 2016 17:34: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 115659 invoked by uid 89); 7 Mar 2016 17:34:44 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=BAYES_00, SPF_SOFTFAIL autolearn=no version=3.3.2 spammy=non-shared, nonshared, problematic, HX-HELO:eggs.gnu.org X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (208.118.235.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Mon, 07 Mar 2016 17:34:33 +0000 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1acz34-0002IZ-SC for gcc-patches@gcc.gnu.org; Mon, 07 Mar 2016 12:34:31 -0500 Received: from mx2.suse.de ([195.135.220.15]:44925) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1acz34-0002I9-Hu for gcc-patches@gcc.gnu.org; Mon, 07 Mar 2016 12:34:26 -0500 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 071B6ADEB for ; Mon, 7 Mar 2016 17:34:23 +0000 (UTC) Resent-From: Martin Jambor Resent-Date: Mon, 7 Mar 2016 18:34:23 +0100 Resent-Message-ID: <20160307173423.GE23597@virgil.suse.cz> Resent-To: GCC Patches Message-Id: <5549e0c1de13ee45d421517a140bf13083685894.1457369363.git.mjambor@suse.cz> In-Reply-To: References: From: Martin Jambor Date: Mon, 29 Feb 2016 17:30:05 +0100 Subject: [hsa testsuite 4/5] Adjust libgomp tests that do not work on host fallback To: GCC Patches X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] X-Received-From: 195.135.220.15 X-IsSubscribed: yes Hi, this patch avoids run-time failures in libgomp testsuite that curtrently happen when HSA offloading is actually used. All of these tests require the offload_device effective target which the patch changes to offload_device_nonshared_as one. For some tests, such as libgomp.c/examples-4/device-1.c this is clearly just the correct thing to do because the test explicitely checks that changes that happen in a target construct and are not "mapped" back are not observable on the host. However, the majority of the tests has a different problem. If a test for some reason is not compiled into HSAIL (usually because it would require the dynamic parallelism path which is disabled or because it calls abort from within target which HSA so far cannot handle), the host fallback is called, even though the test actually is not supposed to be called on it. Such problematic tests then call omp_is_initial_device to verify they are not running on the host and decide to fail when they figure out they are. Changing the effective target only to devices with non-shared memory probably isn't the really correct fix. We basically want to disable the host fallback for them regardeless of address spaces but I cannot think of a simple and generic way of doing that. However, all testcases for non-shared memory devices were written with disallowed fallback in mind and so this soulution also gives the desired result. Perhaps we need something better for the long term, any suggestions are welcome. Tested both with and without HSA (enabled or present). OK for trunk? Thanks, Martin 2016-02-12 Martin Jambor libgomp/ * testsuite/libgomp.c/examples-4/async_target-2.c: Only run on non-shared memory accelerators. * testsuite/libgomp.c/examples-4/device-1.c: Likewise. * testsuite/libgomp.c/examples-4/target-5.c: Likewise. * testsuite/libgomp.c/examples-4/target_data-6.c: Likewise. * testsuite/libgomp.c/examples-4/target_data-7.c: Likewise. * testsuite/libgomp.fortran/examples-4/async_target-2.f90: Likewise. * testsuite/libgomp.fortran/examples-4/device-1.f90: Likewise. * testsuite/libgomp.fortran/examples-4/target-5.f90: Likewise. * testsuite/libgomp.fortran/examples-4/target_data-6.f90: Likewise. * testsuite/libgomp.fortran/examples-4/target_data-7.f90: Likewise. --- libgomp/testsuite/libgomp.c/examples-4/async_target-2.c | 2 +- libgomp/testsuite/libgomp.c/examples-4/device-1.c | 2 +- libgomp/testsuite/libgomp.c/examples-4/target-5.c | 2 +- libgomp/testsuite/libgomp.c/examples-4/target_data-6.c | 2 +- libgomp/testsuite/libgomp.c/examples-4/target_data-7.c | 2 +- libgomp/testsuite/libgomp.fortran/examples-4/async_target-2.f90 | 2 +- libgomp/testsuite/libgomp.fortran/examples-4/device-1.f90 | 2 +- libgomp/testsuite/libgomp.fortran/examples-4/target-5.f90 | 2 +- libgomp/testsuite/libgomp.fortran/examples-4/target_data-6.f90 | 2 +- libgomp/testsuite/libgomp.fortran/examples-4/target_data-7.f90 | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/libgomp/testsuite/libgomp.c/examples-4/async_target-2.c b/libgomp/testsuite/libgomp.c/examples-4/async_target-2.c index ce63328..0c76f8e 100644 --- a/libgomp/testsuite/libgomp.c/examples-4/async_target-2.c +++ b/libgomp/testsuite/libgomp.c/examples-4/async_target-2.c @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-require-effective-target offload_device } */ +/* { dg-require-effective-target offload_device_nonshared_as } */ #include #include diff --git a/libgomp/testsuite/libgomp.c/examples-4/device-1.c b/libgomp/testsuite/libgomp.c/examples-4/device-1.c index dad8572..46aa160 100644 --- a/libgomp/testsuite/libgomp.c/examples-4/device-1.c +++ b/libgomp/testsuite/libgomp.c/examples-4/device-1.c @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-require-effective-target offload_device } */ +/* { dg-require-effective-target offload_device_nonshared_as } */ #include #include diff --git a/libgomp/testsuite/libgomp.c/examples-4/target-5.c b/libgomp/testsuite/libgomp.c/examples-4/target-5.c index 1853fba..1c14bae 100644 --- a/libgomp/testsuite/libgomp.c/examples-4/target-5.c +++ b/libgomp/testsuite/libgomp.c/examples-4/target-5.c @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-require-effective-target offload_device } */ +/* { dg-require-effective-target offload_device_nonshared_as } */ #include #include diff --git a/libgomp/testsuite/libgomp.c/examples-4/target_data-6.c b/libgomp/testsuite/libgomp.c/examples-4/target_data-6.c index affeb49..57c7c0c 100644 --- a/libgomp/testsuite/libgomp.c/examples-4/target_data-6.c +++ b/libgomp/testsuite/libgomp.c/examples-4/target_data-6.c @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-require-effective-target offload_device } */ +/* { dg-require-effective-target offload_device_nonshared_as } */ #include #include diff --git a/libgomp/testsuite/libgomp.c/examples-4/target_data-7.c b/libgomp/testsuite/libgomp.c/examples-4/target_data-7.c index c18d480..8ec41ea 100644 --- a/libgomp/testsuite/libgomp.c/examples-4/target_data-7.c +++ b/libgomp/testsuite/libgomp.c/examples-4/target_data-7.c @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-require-effective-target offload_device } */ +/* { dg-require-effective-target offload_device_nonshared_as } */ #include #include diff --git a/libgomp/testsuite/libgomp.fortran/examples-4/async_target-2.f90 b/libgomp/testsuite/libgomp.fortran/examples-4/async_target-2.f90 index b12b0ea..a94db89 100644 --- a/libgomp/testsuite/libgomp.fortran/examples-4/async_target-2.f90 +++ b/libgomp/testsuite/libgomp.fortran/examples-4/async_target-2.f90 @@ -1,5 +1,5 @@ ! { dg-do run } -! { dg-require-effective-target offload_device } +! { dg-require-effective-target offload_device_nonshared_as } subroutine init (v1, v2, N) !$omp declare target diff --git a/libgomp/testsuite/libgomp.fortran/examples-4/device-1.f90 b/libgomp/testsuite/libgomp.fortran/examples-4/device-1.f90 index 291604b..a411db4 100644 --- a/libgomp/testsuite/libgomp.fortran/examples-4/device-1.f90 +++ b/libgomp/testsuite/libgomp.fortran/examples-4/device-1.f90 @@ -1,5 +1,5 @@ ! { dg-do run } -! { dg-require-effective-target offload_device } +! { dg-require-effective-target offload_device_nonshared_as } program e_57_1 use omp_lib, only: omp_is_initial_device diff --git a/libgomp/testsuite/libgomp.fortran/examples-4/target-5.f90 b/libgomp/testsuite/libgomp.fortran/examples-4/target-5.f90 index 3f454d7..813a273 100644 --- a/libgomp/testsuite/libgomp.fortran/examples-4/target-5.f90 +++ b/libgomp/testsuite/libgomp.fortran/examples-4/target-5.f90 @@ -1,5 +1,5 @@ ! { dg-do run } -! { dg-require-effective-target offload_device } +! { dg-require-effective-target offload_device_nonshared_as } module e_50_5_mod integer, parameter :: THRESHOLD1 = 500, THRESHOLD2 = 100 diff --git a/libgomp/testsuite/libgomp.fortran/examples-4/target_data-6.f90 b/libgomp/testsuite/libgomp.fortran/examples-4/target_data-6.f90 index 258da21e..9b79104 100644 --- a/libgomp/testsuite/libgomp.fortran/examples-4/target_data-6.f90 +++ b/libgomp/testsuite/libgomp.fortran/examples-4/target_data-6.f90 @@ -1,5 +1,5 @@ ! { dg-do run } -! { dg-require-effective-target offload_device } +! { dg-require-effective-target offload_device_nonshared_as } module e_51_6_mod integer, parameter :: THRESHOLD = 500 diff --git a/libgomp/testsuite/libgomp.fortran/examples-4/target_data-7.f90 b/libgomp/testsuite/libgomp.fortran/examples-4/target_data-7.f90 index 2ddac9e..8fc5832 100644 --- a/libgomp/testsuite/libgomp.fortran/examples-4/target_data-7.f90 +++ b/libgomp/testsuite/libgomp.fortran/examples-4/target_data-7.f90 @@ -1,5 +1,5 @@ ! { dg-do run } -! { dg-require-effective-target offload_device } +! { dg-require-effective-target offload_device_nonshared_as } module e_51_7_mod integer, parameter :: THRESHOLD = 500