Hi Tobias!

Thanks for looking into this mess ;-) of Fortran optional arguments
support for OMP, based on what Kwok has already developed.


On 2019-11-08T16:41:23+0100, Tobias Burnus <tob...@codesourcery.com> wrote:
> --- /dev/null
> +++ b/libgomp/testsuite/libgomp.fortran/use_device_ptr-optional-2.f90

When adding '{ dg-do run }' for torture testing (please remember to), I
see the '-O0' and '-O1' execution testing FAIL, complaining that
"libgomp: use_device_ptr pointer wasn't mapped".


Grüße
 Thomas


> @@ -0,0 +1,33 @@
> +! Check whether absent optional arguments are properly
> +! handled with use_device_{addr,ptr}.
> +program main
> + implicit none (type, external)
> + call foo()
> +contains
> +  subroutine foo(v, w, x, y, z)
> +    integer, target, optional, value :: v
> +    integer, target, optional :: w
> +    integer, target, optional :: x(:)
> +    integer, target, optional, allocatable :: y
> +    integer, target, optional, allocatable :: z(:)
> +    integer :: d
> +
> +    !$omp target data map(d) use_device_addr(v, w, x, y, z)
> +      if(present(v)) stop 1
> +      if(present(w)) stop 2
> +      if(present(x)) stop 3
> +      if(present(y)) stop 4
> +      if(present(z)) stop 5
> +    !$omp end target data
> +
> +! Using 'v' in use_device_ptr gives an ICE
> +! TODO: Find out what the OpenMP spec permits for use_device_ptr
> +
> +    !$omp target data map(d) use_device_ptr(w, x, y, z)
> +      if(present(w)) stop 6
> +      if(present(x)) stop 7
> +      if(present(y)) stop 8
> +      if(present(z)) stop 9
> +    !$omp end target data
> +  end subroutine foo
> +end program main

Attachment: signature.asc
Description: PGP signature

Reply via email to