From patchwork Fri Feb 26 16:00:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Jambor X-Patchwork-Id: 589168 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 CC49E1402D6 for ; Sat, 27 Feb 2016 03:00:57 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=OOrFlvI6; 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:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=VSCG1UiQjK/hTmu+BWlvU1Beyu49ijzJ41u0aQCgMY9/r/ZNz6KSJ IWLPW5NzNYJhDySNszMKw32VPxlMdFWrs2E1GjCciQuv4kyjOR5CHJtl/kFW5sTw mY/tQWDQ4/SjnzuWnw5rQXXAS30gKWoIJgrQ1edriq4gZfLeSB5+ig= 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:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=3RHdJBZY5v/PGJZz5q1QyVm/nvs=; b=OOrFlvI6gZ9FdvwGN0/4 MMp910m76ATX+qromEDL1rkuIwrJ/eo56p4z4d7hR5yzkleHqkzIJkt0AXP8CJxb Z5TG4AzcKiiHj1f7XoXR8rDdd0urOvz9ELCcE1FlPMcGAm3DOabkn4Q1gGyUqu5X VxSAjI+Y5uUDRwTvvKX/R+c= Received: (qmail 6539 invoked by alias); 26 Feb 2016 16:00:29 -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 6426 invoked by uid 89); 26 Feb 2016 16:00:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx2.suse.de Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Fri, 26 Feb 2016 16:00:20 +0000 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 6758FACDF for ; Fri, 26 Feb 2016 16:00:16 +0000 (UTC) Date: Fri, 26 Feb 2016 17:00:16 +0100 From: Martin Jambor To: GCC Patches Subject: [hsa, testsuite] Adjust libgomp tests that do not work on host fallback Message-ID: <20160226160016.GK3094@virgil.suse.cz> Mail-Followup-To: GCC Patches MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-IsSubscribed: yes Hi, this patch avoids run-time failures in libgomp testsuite that curtrently happen when HSA offloading is actually used. All of them currently 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 really 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. The 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) and so the host fallback is called, even though the test actually is not supposed to be called on it. The tests then call omp_is_initial_device to verify they are not running on the host and decide to fail. 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. 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 f5eb05a..383d032 100644 --- a/libgomp/testsuite/libgomp.fortran/examples-4/async_target-2.f90 +++ b/libgomp/testsuite/libgomp.fortran/examples-4/async_target-2.f90 @@ -1,6 +1,6 @@ ! { dg-do run } ! { dg-additional-options "-Wno-hsa" } -! { 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