Libgomp: Fix reverse offload capability checking for OpenMP 'omp requires'.
Correctly checks capabilities for OpenMP reverse offloading, resolving a regression.
This commit corrects an issue in libgomp’s handling of OpenMP ‘requires’ clauses, specifically for reverse offloading to devices. A regression caused tests for NVIDIA GPU offloading to pass incorrectly; this fix ensures accurate capability checking in gomp_target_init, restoring proper behavior for reverse offload executions.
In Details
The libgomp.fortran/reverse-offload-5.f90 test case was erroneously passing due to a regression introduced by a previous commit (7cb252f60c1f600066300ede2781a2c9e3808adb) which affected capability checking in gomp_target_init. This fix patches the target initialization logic to correctly evaluate capabilities for reverse offload scenarios.
- libgomp
- The GCC implementation of the OpenMP runtime library, responsible for managing threads and parallel regions for OpenMP programs.
- OpenMP
- A standard API for parallel programming that supports multi-platform shared-memory parallel programming in C, C++, and Fortran.
- reverse offload
- A feature in OpenMP where computation is offloaded from the host CPU to a target device (like a GPU), but the control flow and some operations remain on the host. It's often used in heterogeneous computing environments.
- 'omp requires' clause
- An OpenMP directive clause that specifies requirements for the execution environment or features that must be supported by the target device or runtime for a construct to be valid.