This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [gomp4] Questions about "declare target" and "target update" pragmas

On Thu, Mar 19, 2015 at 09:42:58PM +0300, Ilya Verbin wrote:
> Ok, got it.
> And what about global allocatable fortran arrays?  I didn't find any
> restrictions in the specification.  Here is a reduced testcase:

This really can't be supported.  If you have global allocatables, you really
should allocate them in the target IMNSHO.  The allocation on the host
doesn't make it allocated on the target.  Otherwise, how you could e.g.
deallocate it on the target or allocate again?
> module test
>   integer, allocatable, target :: x(:)
>   !$omp declare target(x)
> end module test
>   use test
>   integer :: n = 1000
>   allocate (x(n))
>   !$omp target map(x(1:n))
>      x(123) = 456
>   !$omp end target
>   deallocate (x)
> end
> It crashes on target with NULL-pointer access, however the memory for x(1:n) is
> allocated on target.  Looks like there's something wrong with pointer
> transformation.  Is this a wrong testcase or a bug in gcc?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]