]> git.ipfire.org Git - thirdparty/gcc.git/commit
openmp, nvptx: low-lat memory access traits
authorAndrew Stubbs <ams@codesourcery.com>
Fri, 11 Mar 2022 14:33:11 +0000 (14:33 +0000)
committerHafiz Abid Qadeer <abidh@codesourcery.com>
Fri, 11 Mar 2022 23:03:58 +0000 (23:03 +0000)
commitef3c1a66eec978a1e20e29aaab8af2772560efcd
treea387dee3d525d409703ec391d34875525599bf9e
parentb46496636969dc3b2af56debfa617e8864bca62c
openmp, nvptx: low-lat memory access traits

The NVPTX low latency memory is not accessible outside the team that allocates
it, and therefore should be unavailable for allocators with the access trait
"all".  This change means that the omp_low_lat_mem_alloc predefined
allocator now implicitly implies the "pteam" trait.

Backport of a patch posted at
https://gcc.gnu.org/pipermail/gcc-patches/2022-January/589355.html

libgomp/ChangeLog:

* allocator.c (MEMSPACE_VALIDATE): New macro.
(omp_aligned_alloc): Use MEMSPACE_VALIDATE.
(omp_aligned_calloc): Likewise.
(omp_realloc): Likewise.
* config/nvptx/allocator.c (nvptx_memspace_validate): New function.
(MEMSPACE_VALIDATE): New macro.
* testsuite/libgomp.c/allocators-4.c (main): Add access trait.
* testsuite/libgomp.c/allocators-6.c (main): Add access trait.
* testsuite/libgomp.c/allocators-7.c: New test.
libgomp/ChangeLog.omp
libgomp/allocator.c
libgomp/config/nvptx/allocator.c
libgomp/testsuite/libgomp.c/allocators-4.c
libgomp/testsuite/libgomp.c/allocators-6.c
libgomp/testsuite/libgomp.c/allocators-7.c [new file with mode: 0644]