On Thu, Nov 14, 2019 at 05:18:41PM +0000, Andrew Stubbs wrote:
> On 14/11/2019 17:05, Jakub Jelinek wrote:
> > On Thu, Nov 14, 2019 at 04:47:49PM +0000, Andrew Stubbs wrote:
> > > This patch adds new libgomp tests to ensure that C "printf" and Fortran
> > > "write" work correctly within offload kernels. Both should work for 
> > > amdgcn,
> > > but nvptx uses the libgfortran "minimal" mode which lacks "write" support.
> > 
> > So, do those *.f90 testcases now FAIL with nvptx offloading?
> > If yes, perhaps there should be effective target check that it is not nvptx
> > offloading.
> > Once the declare variant support is finished, at least in OpenMP it could be
> > handled through that, but Fortran support for that will definitely not make
> > GCC 10.
> 
> Oops, I forgot to regenerate the patch before posting it.
> 
> Here's the version with the nvptx xfails.
> 
> OK?

Ok.

> Add tests for print from offload target.
> 
> 2019-11-14  Andrew Stubbs  <a...@codesourcery.com>
> 
>       libgomp/
>       * testsuite/libgomp.c/target-print-1.c: New file.
>       * testsuite/libgomp.fortran/target-print-1.f90: New file.
>       * testsuite/libgomp.oacc-c/print-1.c: New file.
>       * testsuite/libgomp.oacc-fortran/print-1.f90: New file.

> +int
> +main ()
> +{
> +#pragma omp target
> +    {
> +      printf ("The answer is %d\n", var);
> +    }

Just a nit,
#pragma omp target
  printf ("The answer is %d\n", var);
would be valid too, but no need to change the testcase.

        Jakub

Reply via email to