-
- Downloads
libgomp, openmp: Add ompx_gnu_pinned_mem_alloc
This creates a new predefined allocator as a shortcut for using pinned
memory with OpenMP. This is not in the OpenMP standard so it uses the "ompx"
namespace and an independent enum baseline of 200 (selected to not clash with
other known implementations).
The allocator is equivalent to using a custom allocator with the pinned
trait and the null fallback trait. One motivation for having this feature is
for use by the (planned) -foffload-memory=pinned feature.
gcc/fortran/ChangeLog:
* openmp.cc (is_predefined_allocator): Update valid ranges to
incorporate ompx_gnu_pinned_mem_alloc.
libgomp/ChangeLog:
* allocator.c (ompx_gnu_min_predefined_alloc): New.
(ompx_gnu_max_predefined_alloc): New.
(predefined_alloc_mapping): Rename to ...
(predefined_omp_alloc_mapping): ... this.
(predefined_ompx_gnu_alloc_mapping): New.
(_Static_assert): Adjust for the new name, and add a new assert for the
new table.
(predefined_allocator_p): New.
(predefined_alloc_mapping): New.
(omp_aligned_alloc): Support ompx_gnu_pinned_mem_alloc.
Use predefined_allocator_p and predefined_alloc_mapping.
(omp_free): Likewise.
(omp_alligned_calloc): Likewise.
(omp_realloc): Likewise.
* env.c (parse_allocator): Add ompx_gnu_pinned_mem_alloc.
* libgomp.texi: Document ompx_gnu_pinned_mem_alloc.
* omp.h.in (omp_allocator_handle_t): Add ompx_gnu_pinned_mem_alloc.
* omp_lib.f90.in: Add ompx_gnu_pinned_mem_alloc.
* omp_lib.h.in: Add ompx_gnu_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.
gcc/testsuite/ChangeLog:
* gfortran.dg/gomp/allocate-pinned-1.f90: New test.
Co-Authored-By:
Thomas Schwinge <thomas@codesourcery.com>
Showing
- gcc/fortran/openmp.cc 7 additions, 4 deletionsgcc/fortran/openmp.cc
- gcc/testsuite/gfortran.dg/gomp/allocate-pinned-1.f90 16 additions, 0 deletionsgcc/testsuite/gfortran.dg/gomp/allocate-pinned-1.f90
- libgomp/allocator.c 83 additions, 32 deletionslibgomp/allocator.c
- libgomp/env.c 1 addition, 0 deletionslibgomp/env.c
- libgomp/libgomp.texi 6 additions, 1 deletionlibgomp/libgomp.texi
- libgomp/omp.h.in 1 addition, 0 deletionslibgomp/omp.h.in
- libgomp/omp_lib.f90.in 2 additions, 0 deletionslibgomp/omp_lib.f90.in
- libgomp/omp_lib.h.in 2 additions, 0 deletionslibgomp/omp_lib.h.in
- libgomp/testsuite/libgomp.c/alloc-pinned-5.c 100 additions, 0 deletionslibgomp/testsuite/libgomp.c/alloc-pinned-5.c
- libgomp/testsuite/libgomp.c/alloc-pinned-6.c 102 additions, 0 deletionslibgomp/testsuite/libgomp.c/alloc-pinned-6.c
- libgomp/testsuite/libgomp.fortran/alloc-pinned-1.f90 16 additions, 0 deletionslibgomp/testsuite/libgomp.fortran/alloc-pinned-1.f90
Loading
Please register or sign in to comment