]> git.ipfire.org Git - thirdparty/gcc.git/commit
libgomp.fortran/map-alloc-comp-9{,-usm}.f90: Add unified_shared_memory variant
authorTobias Burnus <tburnus@baylibre.com>
Wed, 7 May 2025 11:46:51 +0000 (13:46 +0200)
committerTobias Burnus <tburnus@baylibre.com>
Wed, 7 May 2025 11:46:51 +0000 (13:46 +0200)
commit9565076f9b810541aeb63cb621d694326aa12216
tree5e0a662022be7849060e708e95aa8f815e30478b
parent0a5855d14dbe25c0890da5c5550013c795aab90e
libgomp.fortran/map-alloc-comp-9{,-usm}.f90: Add unified_shared_memory variant

When host memory is device accessible - independent whether mapping is done or
not (i.e. self map), the 'vtab' pointer becomes accessible, which stores the
dynamic type's type and size information.

In principle, we want to test: USM available but mapping is still done, but
as there is no simple + reliable not-crashing way to test for this, those
checks are skipped in the (pre)existing test file map-alloc-comp-9.f90.

Or rather: those are only active with self-maps, which is currently only true
for the host.

This commit adds map-alloc-comp-9-usm.f90 which runs the same test with
'omp requires unified_shared_memory'.  While OpenMP permits both actual
mapping and self maps with this flag, it in theory covers the missing cases.
However, currently, GCC always uses self maps with USM. Still, having a
device-run self-maps check is better than nothing, even if it misses the
most interesting case.

libgomp/ChangeLog:

* testsuite/libgomp.fortran/map-alloc-comp-9.f90: Process differently
when USE_USM_REQUIREMENT is set.
* testsuite/libgomp.fortran/map-alloc-comp-9-usm.f90: New test.
libgomp/testsuite/libgomp.fortran/map-alloc-comp-9-usm.f90 [new file with mode: 0644]
libgomp/testsuite/libgomp.fortran/map-alloc-comp-9.f90