diff options
author | Andrew Stubbs <ams@baylibre.com> | 2024-06-12 11:42:21 +0000 |
---|---|---|
committer | Sandra Loosemore <sloosemore@baylibre.com> | 2025-05-15 20:25:47 +0000 |
commit | e13ab24bf919a7c4dc30dcfc9fafa9c6349a90a7 (patch) | |
tree | 4ee9e82d1f2a789b3c219c62c776ff7b96281edb /gcc/c | |
parent | 6c86aec56567424416e52372473c8f0694ce65a9 (diff) | |
download | gcc-e13ab24bf919a7c4dc30dcfc9fafa9c6349a90a7.zip gcc-e13ab24bf919a7c4dc30dcfc9fafa9c6349a90a7.tar.gz gcc-e13ab24bf919a7c4dc30dcfc9fafa9c6349a90a7.tar.bz2 |
openmp: -foffload-memory=pinned
https://patchwork.sourceware.org/project/gcc/list/?series=35022
Implement the -foffload-memory=pinned option such that libgomp is
instructed to enable fully-pinned memory at start-up. The option is
intended to provide a performance boost to certain offload programs without
modifying the code.
This feature only works on Linux, at present, and simply calls mlockall to
enable always-on memory pinning. It requires that the ulimit feature is
set high enough to accommodate all the program's memory usage.
In this mode the ompx_gnu_pinned_memory_alloc feature is disabled as it is not
needed and may conflict.
gcc/ChangeLog:
* omp-builtins.def (BUILT_IN_GOMP_ENABLE_PINNED_MODE): New.
* omp-low.cc (omp_enable_pinned_mode): New function.
(execute_lower_omp): Call omp_enable_pinned_mode.
libgomp/ChangeLog:
* config/linux/allocator.c (always_pinned_mode): New variable.
(GOMP_enable_pinned_mode): New function.
(linux_memspace_alloc): Disable pinning when always_pinned_mode set.
(linux_memspace_calloc): Likewise.
(linux_memspace_free): Likewise.
(linux_memspace_realloc): Likewise.
* libgomp.map: Add GOMP_enable_pinned_mode.
* testsuite/libgomp.c/alloc-pinned-7.c: New test.
* testsuite/libgomp.c-c++-common/alloc-pinned-1.c: New test.
Diffstat (limited to 'gcc/c')
0 files changed, 0 insertions, 0 deletions