libgomp: Fix nvptx GOMP_RUNTIME_USM=auto handling
Corrects handling of Unified Shared Memory (USM) auto-detection for nvptx devices in libgomp.
This commit fixes how libgomp handles GOMP_RUNTIME_USM=auto for nvptx devices. Previously, an incorrect ‘is-integrated’ check prevented USM auto-detection. The logic has been updated to correctly identify integrated devices and to check USM accessibility on a per-device basis within GOMP_OFFLOAD_is_accessible_ptr, ensuring USM works as expected.
In Details
The libgomp plugin for nvptx has been updated to correctly handle GOMP_RUNTIME_USM=auto. The is_integrated_apu check was not properly enabled, leading to incorrect behavior. This change moves the check for Unified Shared Memory (USM) support to GOMP_OFFLOAD_get_dev_caps and GOMP_OFFLOAD_is_accessible_ptr, making it a per-device capability rather than a global one. This ensures that USM is correctly detected and utilized when auto is specified.
- libgomp
- The GNU Offloading and Managed Execution Library, implementing OpenMP run-time support for offloading and managed execution.
- nvptx
- NVIDIA Parallel Thread Execution, an intermediate representation used by NVIDIA's CUDA compiler toolchain.
- GOMP_RUNTIME_USM
- An environment variable that controls the use of Unified Shared Memory (USM) at runtime for OpenMP offloading.
- Unified Shared Memory
- A memory addressing mode that allows CPU and GPU to access the same memory space, simplifying data management in heterogeneous systems.