public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgomp/111707] New: omp_target_alloc and omp_target_is_present - corner case handling & spec conformance
@ 2023-10-05 17:28 burnus at gcc dot gnu.org
  0 siblings, 0 replies; only message in thread
From: burnus at gcc dot gnu.org @ 2023-10-05 17:28 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 111707
           Summary: omp_target_alloc and omp_target_is_present - corner
                    case handling & spec conformance
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Keywords: documentation, wrong-code
          Severity: normal
          Priority: P3
         Component: libgomp
          Assignee: unassigned at gcc dot gnu.org
          Reporter: burnus at gcc dot gnu.org
                CC: jakub at gcc dot gnu.org
  Target Milestone: ---

To be checked / updated.

Besides fixing the code, also libgomp.texi needs to be updated.

omp_target_alloc:
  For size == 0, the spec meanwhile requires that NULL is returned.

  However, we call 'malloc' on the host which might return a
  a non-NULL pointer that can be passed to 'free'.
  And on the device side, an GOMP_error diagnostic is printed
  to stderr for nvptx and gcn if the allocation fails.
  Both the HSA and CUDA documentation imply that size==0 is
  an error.

omp_target_is_present
  OpenMP states that this functions checks whether the pointer is
  mapped.
  In GCC, we also return 'true' for shared memory systems and
  for the device_num being the host.
  The question is whether that's OK or not.
  Does a SELF MAP qualify or not?
  (self map - A mapping operation that, when corresponding storage is not
   already present, results in corresponding storage that is the same as
   its original storage.)

  [The current behavior is about to be documented, but we can
   change it.]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-10-05 17:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-05 17:28 [Bug libgomp/111707] New: omp_target_alloc and omp_target_is_present - corner case handling & spec conformance 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).