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(+) 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 Grüße, Thomas