Enable correctness checks in runtime for map clauses under unified_shared_memory mode.
Add OPENMP_DISABLE_MAPS environment variable input to disable this behavior.
As an example, before this patch is applied, this example would not fail:
#pragma omp requires unified_shared_memory
void foo() {
int a[10]; #pragma omp target enter data map(to:a[0:5]) #pragma omp target enter data map(to:a[0:10]) // extending already mapped memory, illegal!
}
This is illegal in OpenMP, and presumably also under unified_shared_memory mode, but the current implementation bails out on map checks under this mode.
By specifications, under unified_shared_memory mode, the user is allowed not to use maps and can expect the program to work on an system that supports the mode. However, for portability to systems that do not support unified_shared_memory, map clauses should always be correct. Not applying checks in the runtime should be a conscious request by the user.