public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgomp/109837] New: [OpenMP] despite 'requires unified_address' there is segfault when 'is_device_ptr' is not used
@ 2023-05-12 23:08 burnus at gcc dot gnu.org
  2023-05-15  9:31 ` [Bug libgomp/109837] " burnus at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: burnus at gcc dot gnu.org @ 2023-05-12 23:08 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 109837
           Summary: [OpenMP] despite 'requires unified_address' there is
                    segfault when 'is_device_ptr' is not used
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Keywords: 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: ---

Cf. https://github.com/SOLLVE/sollve_vv/pull/734 for a testcase.

For nvptx, we currently have:

GOMP_OFFLOAD_get_num_devices (unsigned int omp_requires_mask)
...
      && ((omp_requires_mask
           & ~(GOMP_REQUIRES_UNIFIED_ADDRESS
               | GOMP_REQUIRES_REVERSE_OFFLOAD)) != 0))

That is: we accept for nvptx

  omp requires unfied_address

However, while the address space is the same, the following is not handled:

> the is_device_ptr clause is not necessary to obtain device addresses from device pointers for use inside target regions.

Expected:
(A) Mapping related: is_device_ptr can be left out.
(B) omp_target_is_accessible - will properly work for such pointers.


For nvptx, the check can be done via cudaPointerGetAttributes
if I understand
https://docs.nvidia.com/cuda/cuda-runtime-api/group__CUDART__UNIFIED.html
correctly.

 * * *

NOTE: Something similar is needed for GCN, except that its
GOMP_OFFLOAD_get_num_devices currently returns -1 when
GOMP_REQUIRES_UNIFIED_ADDRESS has been requested.

It seems as if hsa_amd_pointer_info is the function to be used,
cf.
https://github.com/RadeonOpenCompute/ROCR-Runtime/blob/master/src/inc/hsa_ext_amd.h

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

end of thread, other threads:[~2023-06-13  9:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-12 23:08 [Bug libgomp/109837] New: [OpenMP] despite 'requires unified_address' there is segfault when 'is_device_ptr' is not used burnus at gcc dot gnu.org
2023-05-15  9:31 ` [Bug libgomp/109837] " burnus at gcc dot gnu.org
2023-06-06 13:25 ` burnus at gcc dot gnu.org
2023-06-06 16:28 ` burnus at gcc dot gnu.org
2023-06-13  9:29 ` cvs-commit at gcc dot gnu.org
2023-06-13  9:38 ` 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).