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

--- Comment #1 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Andrew Stubbs <[email protected]>:

https://gcc.gnu.org/g:a53c5c42c6c3c28275b79a8c29883f7a5ee754c0

commit r16-7258-ga53c5c42c6c3c28275b79a8c29883f7a5ee754c0
Author: Andrew Stubbs <[email protected]>
Date:   Mon Dec 8 16:18:02 2025 +0000

    libgomp, amdgcn, nvptx: Improve omp_target_is_accessible [PR121813]

    This patch extends omp_target_is_accessible to check the actual device
status
    for the memory region, on amdgcn and nvptx devices (rather than just
checking
    if shared memory is enabled).

    In both cases, we check the status of each 4k region within the given
memory
    range (assuming 4k pages should be safe for all the currently supported
hosts)
    and returns true if all of the pages report accessible.

    The testcases have been modified to check that allocations marked
accessible
    actually are accessible (inaccessibility can't be checked without invoking
    memory faults), and to understand that some parts of an array can be
accessible
    but other parts not (I have observed this intermittently for the stack
memory
    on amdgcn using the Fortran testcase, which can have the allocation span
pages).

    There's also new testcases for the various other memory modes, and for
managed
    memory.

    include/ChangeLog:

            * cuda/cuda.h (CUpointer_attribute): New enum.
            (cuPointerGetAttribute): New prototype.

    libgomp/ChangeLog:

            PR libgomp/121813
            PR libgomp/113213
            * libgomp-plugin.h (GOMP_OFFLOAD_is_accessible_ptr): New prototype.
            * libgomp.h
            (struct gomp_device_descr): Add GOMP_OFFLOAD_is_accessible_ptr.
            * libgomp.texi: Update omp_target_is_accessible docs.
            * plugin/cuda-lib.def (cuPointerGetAttribute): New entry.
            * plugin/plugin-gcn.c (struct hsa_runtime_fn_info): Add
            hsa_amd_svm_attributes_get_fn and hsa_amd_pointer_info_fn.
            (init_hsa_runtime_functions): Add hsa_amd_svm_attributes_get and
            hsa_amd_pointer_info.
            (enum accessible): New enum type.
            (host_memory_is_accessible): New function.
            (device_memory_is_accessible): New function.
            (GOMP_OFFLOAD_is_accessible_ptr): New function.
            * plugin/plugin-nvptx.c (GOMP_OFFLOAD_is_accessible_ptr): Likewise.
            * target.c (omp_target_is_accessible): Call is_accessible_ptr_func.
            (gomp_load_plugin_for_device): Add is_accessible_ptr.
            * testsuite/libgomp.c-c++-common/target-is-accessible-1.c: Rework
            to match more details of the GPU implementation.
            * testsuite/libgomp.fortran/target-is-accessible-1.f90: Likewise.
            * testsuite/libgomp.c-c++-common/target-is-accessible-2.c: New
test.
            * testsuite/libgomp.c-c++-common/target-is-accessible-3.c: New
test.
            * testsuite/libgomp.c-c++-common/target-is-accessible-4.c: New
test.
            * testsuite/libgomp.c-c++-common/target-is-accessible-5.c: New
test.
  • [Bug libgomp/113213] [OpenMP] U... cvs-commit at gcc dot gnu.org via Gcc-bugs

Reply via email to