diff options
author | Tobias Burnus <tobias@codesourcery.com> | 2023-06-19 09:08:51 +0200 |
---|---|---|
committer | Tobias Burnus <tobias@codesourcery.com> | 2023-06-19 09:08:51 +0200 |
commit | b25ea7ab78cdb7baec694e56eadb71002726a73e (patch) | |
tree | a54e162292f8f4533c516518047542d803e12a82 /libgomp/libgomp.texi | |
parent | 53953b6f31f18ac2e2241f0c1f3c8d7ecec78e7f (diff) | |
download | gcc-b25ea7ab78cdb7baec694e56eadb71002726a73e.zip gcc-b25ea7ab78cdb7baec694e56eadb71002726a73e.tar.gz gcc-b25ea7ab78cdb7baec694e56eadb71002726a73e.tar.bz2 |
OpenMP (C/C++): Keep pointer value of unmapped ptr with default mapping [PR110270]
For C/C++ pointers, default implicit mapping firstprivatizes the pointer
but if the memory it points to is mapped, the it is updated to point to
the device memory (by attaching a zero sized array section of the pointed-to
storage).
However, if the pointed-to storage wasn't mapped, the pointer was set to
NULL on the device side (OpenMP 5.0/5.1 semantic). With this commit, the
pointer retains the on-host address in that case (OpenMP 5.2 semantic).
The new semantic avoids an explicit map/firstprivate/is_device_ptr in the
following sensible cases: Special values (e.g. pointer or 0x1, 0x2 etc.),
explicitly device allocated memory (e.g. omp_target_alloc), and with
(unified) shared memory.
(Note: With (U)SM, mappings still must be tracked, at least when
omp_target_associate_ptr does not fail when passing in two destinct pointers.)
libgomp/
PR middle-end/110270
* target.c (gomp_map_vars_internal): Copy host value instead of NULL
for GOMP_MAP_ZERO_LEN_ARRAY_SECTION if not mapped.
* libgomp.texi (OpenMP 5.2 Impl.): Mark as 'Y'.
* testsuite/libgomp.c/target-19.c: Update expected value.
* testsuite/libgomp.c++/target-18.C: Likewise.
* testsuite/libgomp.c++/target-19.C: Likewise.
* testsuite/libgomp.c-c++-common/requires-unified-addr-2.c: New test.
* testsuite/libgomp.c-c++-common/target-implicit-map-3.c: New test.
* testsuite/libgomp.c-c++-common/target-implicit-map-4.c: New test.
Diffstat (limited to 'libgomp/libgomp.texi')
-rw-r--r-- | libgomp/libgomp.texi | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libgomp/libgomp.texi b/libgomp/libgomp.texi index 1c57f5a..db8b1f1 100644 --- a/libgomp/libgomp.texi +++ b/libgomp/libgomp.texi @@ -384,7 +384,7 @@ to address of matching mapped list item per 5.1, Sect. 2.21.7.2 @tab N @tab @item @code{declare mapper} with iterator and @code{present} modifiers @tab N @tab @item If a matching mapped list item is not found in the data environment, the - pointer retains its original value @tab N @tab + pointer retains its original value @tab Y @tab @item New @code{enter} clause as alias for @code{to} on declare target directive @tab Y @tab @item Deprecation of @code{to} clause on declare target directive @tab N @tab |