This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PR85463 '[nvptx] "exit" in offloaded region doesn't terminate process'
Hi Martin!
On Wed, 25 Apr 2018 15:56:26 +0200, Martin Jambor <mjambor@suse.cz> wrote:
> On Thu, Apr 19 2018, Thomas Schwinge wrote:
> > * testsuite/libgomp.oacc-fortran/error_stop-1.f: New file.
> > * testsuite/libgomp.oacc-fortran/error_stop-2.f: Likewise.
> > * testsuite/libgomp.oacc-fortran/error_stop-3.f: Likewise.
> > * testsuite/libgomp.oacc-fortran/stop-1.f: Likewise.
> > * testsuite/libgomp.oacc-fortran/stop-2.f: Likewise.
> > * testsuite/libgomp.oacc-fortran/stop-3.f: Likewise.
>
> The "output pattern test" part of all of these new testcases fail on my
> HSA tester even though no HSAIL is generated for them
(Right, that's expected: there's currently no HSA/HSAIL support for
OpenACC constructs.)
> only host
> fallback is used.
So that's essentially the configuration that a lot of people use: libgomp
testing with no offloading configured; host fallback only.
> Looking at the first one:
>
> > diff --git libgomp/testsuite/libgomp.oacc-fortran/error_stop-1.f libgomp/testsuite/libgomp.oacc-fortran/error_stop-1.f
> > new file mode 100644
> > index 0000000..4965e67
> > --- /dev/null
> > +++ libgomp/testsuite/libgomp.oacc-fortran/error_stop-1.f
> > @@ -0,0 +1,20 @@
> > +! { dg-do run }
> > +
> > + PROGRAM MAIN
> > + IMPLICIT NONE
> > +
> > + PRINT *, "CheCKpOInT"
> > +!$ACC PARALLEL
> > + ERROR STOP
> > +!$ACC END PARALLEL
> > + PRINT *, "WrONg WAy"
> > +
> > + END PROGRAM MAIN
> > +
> > +! { dg-output "CheCKpOInT(\n|\r\n|\r)+" }
> > +! { dg-output "ERROR STOP (\n|\r\n|\r)+" }
> > +! PR85463. The "minimal" libgfortran implementation used with nvptx
> > +! offloading is a little bit different.
> > +! { dg-output "Error termination.*" { target { ! openacc_nvidia_accel_selected } } }
> > +! { dg-output "libgomp: cuStreamSynchronize error.*" { target openacc_nvidia_accel_selected } }
> > +! { dg-shouldfail "" }
>
> I can tell that checking for "CheCKpOInT" passes but checking for "ERROR
> STOP" and "Error termination" do not. Running the test manually, they
> both appear, but in standard error, not standard output (where
> CheCKpOInT is printed).
ACK (stdout, then stderr). Though, as there are no "FAIL" reports so far
(including posts on the gcc-regression and gcc-testresults mailing
lists), I'm assuming that stdout/stderr do synchronize in order here, as
expected. (As far as I remember, the Fortran PRINT does flush stdout.)
> I am not 100% sure whether that is the reason
> why they fail but do we have a way of testing std error of the executed
> compiled binary?
Is there anything "special" in your HSA machine regarding stdout/stderr?
How are you testing GCC there: native testing or some non-standard *.exp
file, for example? Does using strace give any idea where which part of
the output is going?
Grüße
Thomas