From patchwork Thu Jul 23 08:51:11 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 499260 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 EF148140D19 for ; Thu, 23 Jul 2015 18:51:43 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=RAXLiJLs; 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:from :to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-type; q=dns; s=default; b=aEGI3LS/LJaZHicd RQ+FOFZugy7E9Fbn+9Je+NaQzGBG/LDuTfYv7L7iTvAArxWIOv+P9bbNMjwuZ5UI ZHzgJhT8IMqlZX9ZvweLV5VxHR6SWCxmxHwOEXiXlvAFPdeSF5IYsxmOFdyjzA+Q f+tzi6Mmn1Zz13+EGqCZiiQ/jlw= 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:from :to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-type; s=default; bh=F8nYwnqf/pbpZNHWXiCfj1 RHA4w=; b=RAXLiJLs1MfSt25g3So79Aq/YcQWMDQvuvasJqxUYyd9VB6PxcvP4G zAYZ6546KAXs6AhyTUlg6xwHVB8S09ZRyNVy1d3MDMPXuxXVfLJRHP2yM6btsPpH 9oTmNT+dLeW50kNkoO+DctdF3aumwFC5DpLgfJZDJ9sQ26hCkYlNo= Received: (qmail 63609 invoked by alias); 23 Jul 2015 08:51:37 -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 63595 invoked by uid 89); 23 Jul 2015 08:51:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 23 Jul 2015 08:51:34 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-02.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1ZICDx-0002o5-VO from Thomas_Schwinge@mentor.com ; Thu, 23 Jul 2015 01:51:30 -0700 Received: from feldtkeller.schwinge.homeip.net (137.202.0.76) by SVR-IES-FEM-02.mgc.mentorg.com (137.202.0.106) with Microsoft SMTP Server id 14.3.224.2; Thu, 23 Jul 2015 09:51:28 +0100 From: Thomas Schwinge To: Nathan Sidwell , GCC Patches CC: Jakub Jelinek Subject: [gomp4] libgomp: Some torture testing for C and C++ OpenACC test cases (was: [gomp] Move openacc vector& worker single handling to RTL) In-Reply-To: <55AFC924.7050709@acm.org> References: <5597120D.2080308@acm.org> <20150703231159.GP10247@tucnak.redhat.com> <559844EF.6010208@acm.org> <559AD85B.2050102@acm.org> <20150707095408.GD10247@tucnak.redhat.com> <559BDE68.9010302@acm.org> <20150707142229.GG10247@tucnak.redhat.com> <559D381C.7020804@acm.org> <20150708145822.GB10247@tucnak.redhat.com> <559D9A29.2020409@acm.org> <559F10F2.9050102@acm.org> <87bnf9v5ma.fsf@kepler.schwinge.homeip.net> <55ACF144.4050201@acm.org> <55AD0ED6.8020105@acm.org> <55AFC924.7050709@acm.org> User-Agent: Notmuch/0.9-101-g81dad07 (http://notmuchmail.org) Emacs/24.3.1 (x86_64-pc-linux-gnu) Date: Thu, 23 Jul 2015 10:51:11 +0200 Message-ID: <87oaj3z280.fsf@schwinge.name> MIME-Version: 1.0 Hi! On Wed, 22 Jul 2015 12:47:32 -0400, Nathan Sidwell wrote: > On 07/20/15 11:08, Nathan Sidwell wrote: > > On 07/20/15 09:01, Nathan Sidwell wrote: > >> On 07/18/15 11:37, Thomas Schwinge wrote: > >>> For OpenACC nvptx offloading, there must still be something wrong; here's > >>> a count of the (non-deterministic!) regressions of ten runs of the > >>> libgomp testsuite. > Thomas helped me reproduce them -- they are very intermittent. Anyway, fixed > with the attached patch I've committed to gomp branch. \o/ > This appears to fix all the -O0 regressions you observed Thomas. Thanks, confirmed! To get better test coverage for device-specific code that is only ever used in offloading configurations, it's a good idea to do a (limited) set of torture testing also for some libgomp C and C++ test cases (it's done for all testing in Fortran): those that are dealing with the specifics of gang/worker/vector single/redundant/partitioned modes. They're selected based on their file names -- not a perfect property to detect such test cases, but should be sufficient. To avoid testing time exploding too much, limit any torture testing to -O0 and -O2 only, under the assumption that between -O0 and -O[something] there is the biggest difference in the overall structure of the generated code. Committed to gomp-4_0-branch in r226091: commit b1bd5f92c3f536ebab9b36510636c7ab845123f8 Author: tschwinge Date: Thu Jul 23 08:50:15 2015 +0000 libgomp: Some torture testing for C and C++ OpenACC test cases libgomp/ * testsuite/libgomp.oacc-c++/c++.exp: Run ttests with gcc-dg-runtest. * testsuite/libgomp.oacc-c/c.exp: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gomp-4_0-branch@226091 138bc75d-0d04-0410-961f-82ee72b054a4 --- libgomp/ChangeLog.gomp | 6 ++++++ libgomp/testsuite/libgomp.oacc-c++/c++.exp | 26 ++++++++++++++++++++++++++ libgomp/testsuite/libgomp.oacc-c/c.exp | 25 +++++++++++++++++++++++++ 3 files changed, 57 insertions(+) Grüße, Thomas diff --git libgomp/ChangeLog.gomp libgomp/ChangeLog.gomp index 33e7b3b..b5ace3f 100644 --- libgomp/ChangeLog.gomp +++ libgomp/ChangeLog.gomp @@ -1,3 +1,9 @@ +2015-07-23 Thomas Schwinge + + * testsuite/libgomp.oacc-c++/c++.exp: Run ttests with + gcc-dg-runtest. + * testsuite/libgomp.oacc-c/c.exp: Likewise. + 2015-07-22 Thomas Schwinge * testsuite/libgomp.oacc-c-c++-common/lib-1.c: Remove explicit diff --git libgomp/testsuite/libgomp.oacc-c++/c++.exp libgomp/testsuite/libgomp.oacc-c++/c++.exp index 7309f78..3dbc917 100644 --- libgomp/testsuite/libgomp.oacc-c++/c++.exp +++ libgomp/testsuite/libgomp.oacc-c++/c++.exp @@ -1,5 +1,12 @@ # This whole file adapted from libgomp.c++/c++.exp. +# To avoid testing time exploding too much, limit any torture testing to -O0 +# and -O2 only, under the assumption that between -O0 and -O[something] there +# is the biggest difference in the overall structure of the generated code. +set TORTURE_OPTIONS [list \ + { -O0 } \ + { -O2 } ] + load_lib libgomp-dg.exp load_gcc_lib gcc-dg.exp @@ -61,6 +68,22 @@ if { $lang_test_file_found } { set tests [lsort [concat \ [find $srcdir/$subdir *.C] \ [find $srcdir/$subdir/../libgomp.oacc-c-c++-common *.c]]] + # To get better test coverage for device-specific code that is only ever + # used in offloading configurations, we'd like more thorough (torture) + # testing for test cases that are dealing with the specifics of + # gang/worker/vector single/redundant/partitioned modes. They're selected + # based on their file names -- not a perfect property to detect such test + # cases, but should be sufficient. + set ttests [lsort -unique [concat \ + [find $srcdir/$subdir/../libgomp.oacc-c-c++-common *gang*.c] \ + [find $srcdir/$subdir/../libgomp.oacc-c-c++-common *worker*.c] \ + [find $srcdir/$subdir/../libgomp.oacc-c-c++-common *vec*.c]]] + # tests := tests - ttests. + foreach t $ttests { + set i [lsearch -exact $tests $t] + set tests [lreplace $tests $i $i] + } + if { $blddir != "" } { set ld_library_path "$always_ld_library_path:${blddir}/${lang_library_path}" @@ -116,6 +139,7 @@ if { $lang_test_file_found } { set tagopt "$tagopt -DACC_MEM_SHARED=$acc_mem_shared" dg-runtest $tests "$tagopt" "$libstdcxx_includes $DEFAULT_CFLAGS" + gcc-dg-runtest $ttests "$tagopt" "$libstdcxx_includes" } } @@ -124,5 +148,7 @@ if { [info exists HAVE_SET_GXX_UNDER_TEST] } { unset GXX_UNDER_TEST } +unset TORTURE_OPTIONS + # All done. dg-finish diff --git libgomp/testsuite/libgomp.oacc-c/c.exp libgomp/testsuite/libgomp.oacc-c/c.exp index 60be15d..988dfc6 100644 --- libgomp/testsuite/libgomp.oacc-c/c.exp +++ libgomp/testsuite/libgomp.oacc-c/c.exp @@ -11,6 +11,13 @@ if [info exists lang_include_flags] then { unset lang_include_flags } +# To avoid testing time exploding too much, limit any torture testing to -O0 +# and -O2 only, under the assumption that between -O0 and -O[something] there +# is the biggest difference in the overall structure of the generated code. +set TORTURE_OPTIONS [list \ + { -O0 } \ + { -O2 } ] + load_lib libgomp-dg.exp load_gcc_lib gcc-dg.exp @@ -31,6 +38,21 @@ lappend libgomp_compile_options "compiler=$GCC_UNDER_TEST" set tests [lsort [concat \ [find $srcdir/$subdir *.c] \ [find $srcdir/$subdir/../libgomp.oacc-c-c++-common *.c]]] +# To get better test coverage for device-specific code that is only ever +# used in offloading configurations, we'd like more thorough (torture) +# testing for test cases that are dealing with the specifics of +# gang/worker/vector single/redundant/partitioned modes. They're selected +# based on their file names -- not a perfect property to detect such test +# cases, but should be sufficient. +set ttests [lsort -unique [concat \ + [find $srcdir/$subdir/../libgomp.oacc-c-c++-common *gang*.c] \ + [find $srcdir/$subdir/../libgomp.oacc-c-c++-common *worker*.c] \ + [find $srcdir/$subdir/../libgomp.oacc-c-c++-common *vec*.c]]] +# tests := tests - ttests. +foreach t $ttests { + set i [lsearch -exact $tests $t] + set tests [lreplace $tests $i $i] +} set ld_library_path $always_ld_library_path append ld_library_path [gcc-set-multilib-library-path $GCC_UNDER_TEST] @@ -75,7 +97,10 @@ foreach offload_target_openacc $offload_targets_s_openacc { set tagopt "$tagopt -DACC_MEM_SHARED=$acc_mem_shared" dg-runtest $tests "$tagopt" $DEFAULT_CFLAGS + gcc-dg-runtest $ttests "$tagopt" "" } +unset TORTURE_OPTIONS + # All done. dg-finish