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

--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Minor correction/clarification:

  (B) omp_target_is_accessible - will properly work for such pointers.

While it might be useful to handle also (C/C++) code like:
  ptr = omp_target_alloc (...);
  ...
  is_accessible = omp_target_is_accessible(ptr, ...);

The OpenMP spec only requires:
"The *omp_target_is_accessible* routine tests whether host memory is accessible
from a given device."

And "ptr" is a device pointer. Thus, returning FALSE for all such pointers,
unless in shared memory, is OK.

→ Still, we might consider to add checking for memory that is both host and
device accessible - or is a device pointer in the unified-address case.
(Quality of Implementation Feature).

* * *

Besides 'is_device_ptr', the same is required for has_device_addr like in
(Fortran):

  c_ptr = omp_alloc(...)
  call c_f_pointer (c_ptr, fptr)
  !$omp target
    fptr = ...

[That has_device_addr is not mentioned for 'requires unified_addr' is the
OpenMP Spec Issue #3606.]

Reply via email to