public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/69090] Allocatable arrays mishandled in 'omp declare target'
       [not found] <bug-69090-4@http.gcc.gnu.org/bugzilla/>
@ 2020-10-05 15:15 ` dominiq at lps dot ens.fr
  2021-02-17 22:39 ` john.donners at atos dot net
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 4+ messages in thread
From: dominiq at lps dot ens.fr @ 2020-10-05 15:15 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69090

--- Comment #6 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Should not this PR be closed?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug fortran/69090] Allocatable arrays mishandled in 'omp declare target'
       [not found] <bug-69090-4@http.gcc.gnu.org/bugzilla/>
  2020-10-05 15:15 ` [Bug fortran/69090] Allocatable arrays mishandled in 'omp declare target' dominiq at lps dot ens.fr
@ 2021-02-17 22:39 ` john.donners at atos dot net
  2022-11-04 10:50 ` tschwinge at gcc dot gnu.org
  2022-11-04 11:42 ` burnus at gcc dot gnu.org
  3 siblings, 0 replies; 4+ messages in thread
From: john.donners at atos dot net @ 2021-02-17 22:39 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69090

John Donners <john.donners at atos dot net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |john.donners at atos dot net

--- Comment #7 from John Donners <john.donners at atos dot net> ---
I have a similar issue, but the allocatable array is defined in a module. The
array is used in a subroutine that is also DECLARE TARGET. Because the routine
is DECLARE TARGET, the allocatable array must be DECLARE TARGET as well. The
case works fine with target intelmicemul, but it does not work on the target
nvptx-none (cuCtxSynchronize error).

Test case:

module b

!$omp declare target (a)
   real, allocatable,dimension(:) :: a
end module b

module c
  use b

  contains
  subroutine d
!$omp declare target
a=7

  end subroutine
  end module

  program arr_a
     use b
     use c
   implicit none

 allocate(a(2))
 a=5

!$omp target map(tofrom:a)
call d 
!$omp end target
print*,a
end

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug fortran/69090] Allocatable arrays mishandled in 'omp declare target'
       [not found] <bug-69090-4@http.gcc.gnu.org/bugzilla/>
  2020-10-05 15:15 ` [Bug fortran/69090] Allocatable arrays mishandled in 'omp declare target' dominiq at lps dot ens.fr
  2021-02-17 22:39 ` john.donners at atos dot net
@ 2022-11-04 10:50 ` tschwinge at gcc dot gnu.org
  2022-11-04 11:42 ` burnus at gcc dot gnu.org
  3 siblings, 0 replies; 4+ messages in thread
From: tschwinge at gcc dot gnu.org @ 2022-11-04 10:50 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69090

Thomas Schwinge <tschwinge at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=96668
                 CC|                            |burnus at gcc dot gnu.org,
                   |                            |tschwinge at gcc dot gnu.org

--- Comment #8 from Thomas Schwinge <tschwinge at gcc dot gnu.org> ---
Has this been fixed via PR96668 "[OpenMP] Re-mapping allocated but previously
unallocated allocatable does not work", by chance?  (Tobias?)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug fortran/69090] Allocatable arrays mishandled in 'omp declare target'
       [not found] <bug-69090-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2022-11-04 10:50 ` tschwinge at gcc dot gnu.org
@ 2022-11-04 11:42 ` burnus at gcc dot gnu.org
  3 siblings, 0 replies; 4+ messages in thread
From: burnus at gcc dot gnu.org @ 2022-11-04 11:42 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69090

--- Comment #9 from Tobias Burnus <burnus at gcc dot gnu.org> ---
(In reply to Thomas Schwinge from comment #8)
> Has this been fixed via PR96668 "[OpenMP] Re-mapping allocated but
> previously unallocated allocatable does not work", by chance?  (Tobias?)

I think both examples should work since that commit went into GCC 11 (untested,
however).

(It is clear why the example in comment 0 did not work back then (2015),
 but the one in comment 7 is unclear as no GCC version was mentioned;
 if it was mainline it should work (GCC 11), if it was a release
 branch, the fail is understandable.)

NOTE: While the fix for PR96668 handles previously unallocated arrays,
the OpenMP specification since 5.1 (or rather already TR 9) clarified that
the 'always' modifier is required. This requirement might go away in
OpenMP 6.0, but even TR11 still has it.

NOTE 2: PR96668 is not yet closed as scalar allocatables are not handled, yet.
(But both examples in this PR use arrays.)

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-11-04 11:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-69090-4@http.gcc.gnu.org/bugzilla/>
2020-10-05 15:15 ` [Bug fortran/69090] Allocatable arrays mishandled in 'omp declare target' dominiq at lps dot ens.fr
2021-02-17 22:39 ` john.donners at atos dot net
2022-11-04 10:50 ` tschwinge at gcc dot gnu.org
2022-11-04 11:42 ` burnus at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).