]> git.ipfire.org Git - thirdparty/gcc.git/commit
libgomp, openmp: Add ompx_pinned_mem_alloc
authorAndrew Stubbs <ams@codesourcery.com>
Fri, 11 Mar 2022 12:33:06 +0000 (12:33 +0000)
committerHafiz Abid Qadeer <abidh@codesourcery.com>
Fri, 11 Mar 2022 23:03:58 +0000 (23:03 +0000)
commitb46496636969dc3b2af56debfa617e8864bca62c
tree96f5f464992b50239afadb5447e9ac1f22d8ab9d
parent4356385e58533f4973098b14a8ebe5be21b9e031
libgomp, openmp: Add ompx_pinned_mem_alloc

This creates a new predefined allocator as a shortcut for using pinned
memory with OpenMP.  The name uses the OpenMP extension space and is
intended to be consistent with other OpenMP implementations currently in
development.

The allocator is equivalent to using a custom allocator with the pinned
trait and the null fallback trait.

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

* allocator.c (omp_max_predefined_alloc): Update.
(omp_aligned_alloc): Support ompx_pinned_mem_alloc.
(omp_free): Likewise.
(omp_aligned_calloc): Likewise.
(omp_realloc): Likewise.
* omp.h.in (omp_allocator_handle_t): Add ompx_pinned_mem_alloc.
* omp_lib.f90.in: Add ompx_pinned_mem_alloc.
* testsuite/libgomp.c/alloc-pinned-5.c: New test.
* testsuite/libgomp.c/alloc-pinned-6.c: New test.
* testsuite/libgomp.fortran/alloc-pinned-1.f90: New test.
libgomp/ChangeLog.omp
libgomp/allocator.c
libgomp/omp.h.in
libgomp/omp_lib.f90.in
libgomp/testsuite/libgomp.c/alloc-pinned-5.c [new file with mode: 0644]
libgomp/testsuite/libgomp.c/alloc-pinned-6.c [new file with mode: 0644]
libgomp/testsuite/libgomp.fortran/alloc-pinned-1.f90 [new file with mode: 0644]