public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "burnus at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/107517] New: [OpenMP][5.0] 'target update' with strides — for C/C++ and Fortran
Date: Thu, 03 Nov 2022 13:18:23 +0000	[thread overview]
Message-ID: <bug-107517-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 107517
           Summary: [OpenMP][5.0] 'target update' with strides — for C/C++
                    and Fortran
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Keywords: openmp, rejects-valid
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: burnus at gcc dot gnu.org
  Target Milestone: ---

Cf. https://gcc.gnu.org/pipermail/gcc-patches/2022-November/604938.html

"on the library side we certainly have omp_target_memcpy_rect which under the
hood just does multiple copies of the contiguous subparts, but I don't remember
something similar done in GOMP_target_update.  And I think it is not ok to copy
bytes that aren't requested to be copied."


OpenMP 5.0 (and later) seems to permit list items with strides
for the 'to' and 'from' clause of 'target update', e.g.

For C/C++:
   int array[1];
    ....
   #pragma omp target update from(arr[::2])

For Fortran:

   arr(::2)  ! stride, but must be positive
   arr([1,7,2,4]) ! first index must be first in element order
but not
   dt(:)%comp ! Invalid - not last part-ref

OpenMP 5.2 wording for 'to'/'from':
"5.9 Data-Motion Clauses": "The list items may include array sections with
stride expressions."


OpenMP 5.0 - same in 5.2 (in "3.2.5 Array Sections")
C/C++:
"The stride must evaluate to a positive integer."

Fortran:
• If a stride expression is specified, it must be positive.
• The upper bound for the last dimension of an assumed-size dummy array must be
specified.
• If a list item is an array section with vector subscripts, the first array
element must be the lowest in the array element order of the array section.
• If a list item is an array section, the last part-ref of the list item must
have a section subscript list


[Fortran] Regarding substrings: "variable list item" does not permit them – and
this implies extended list items and locator list items may not have them
neither.
(See OpenMP 5.2's "3.2.1 OpenMP Argument Lists")


Unrelated to this issue but related to mapping:

[Fortran] In "5.1.1 Variables Referenced in a Construct", OpenMP 5.2 states:
* "A type parameter inquiry or complex part designator that is referenced in a
construct is treated as if its designator is referenced."

[Fortran] For the map clause, OpenMP 5.2 states:
* "A list item must not be a complex part designator."

             reply	other threads:[~2022-11-03 13:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-03 13:18 burnus at gcc dot gnu.org [this message]
2022-11-03 13:48 ` [Bug middle-end/107517] " jakub at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-107517-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).