[patch, libgomp] Add tests for print from offload target

Thomas Schwinge thomas@codesourcery.com
Wed Nov 27 18:00:00 GMT 2019


Hi!

On 2019-11-14T18:22:39+0100, Jakub Jelinek <jakub@redhat.com> wrote:
> 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.

Thanks.

>> > > 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?

Note that for libgomp OpenMP testing that means FAIL as soon as nvptx
plus possibly any other offload targets are configured, as we will always
compile for all offload targets, as no specific '-foffload' gets passed
-- in contrast to the libgomp OpenACC testing.  (Changing that would be a
separate discussion.)

>> > If yes, perhaps there should be effective target check that it is not nvptx
>> > offloading.

>> Here's the version with the nvptx xfails.
>> 
>> OK?
>
> Ok.

... but that doesn't work as expected:

    {+ERROR: libgomp.fortran/target-print-1.f90   -O0 : can't read "openacc_device_type": no such variable for " dg-xfail-if 5 "no write for nvidia" { openacc_nvidia_accel_selected } "+}
    [Etc.]

..., and:

    {+XFAIL: libgomp.oacc-fortran/print-1.f90 -DACC_DEVICE_TYPE_nvidia=1 -DACC_MEM_SHARED=0 -foffload=nvptx-none  -O0  (test for excess errors)+}
    {+UNRESOLVED: libgomp.oacc-fortran/print-1.f90 -DACC_DEVICE_TYPE_nvidia=1 -DACC_MEM_SHARED=0 -foffload=nvptx-none  -O0  compilation failed to produce executable+}
    [Etc.]

To fix the ERRORs, I'm adding
'check_effective_target_offload_target_nvptx' to generally test whether
"compiling for offload target nvptx", and to fix the UNRESOLVEDs, I'm
adding separate "nvptx" variants, as I couldn't find a way to express the
'dg-*' directives in one combined file.  I want to actually see the nvptx
XFAILs, so that we'll notice XPASSes once/if nvptx switches away from the
minimal libgfortran.  (Changing that would be a separate discussion.)

Committed "Fix 'libgomp.fortran/target-print-1.f90',
'libgomp.oacc-fortran/print-1.f90' for offload target nvptx" to trunk in
r278779, see attached.


Grüße
 Thomas


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-libgomp.fortran-target-print-1.f90-libgomp.trunk.patch
Type: text/x-diff
Size: 6624 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20191127/107a8032/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 658 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20191127/107a8032/attachment.sig>


More information about the Gcc-patches mailing list