aboutsummaryrefslogtreecommitdiff
path: root/libgomp/libgomp.map
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2021-09-30 09:30:18 +0200
committerJakub Jelinek <jakub@redhat.com>2021-09-30 09:30:18 +0200
commitb38a4bd10249b5070ea1f4708a0fd228df268c26 (patch)
tree432fb7276617f8c2caae8723fa38e2f8a2b44e06 /libgomp/libgomp.map
parent257fd0333fe9fe5b0b4f9fddde50a09afa82b2ef (diff)
downloadgcc-b38a4bd10249b5070ea1f4708a0fd228df268c26.zip
gcc-b38a4bd10249b5070ea1f4708a0fd228df268c26.tar.gz
gcc-b38a4bd10249b5070ea1f4708a0fd228df268c26.tar.bz2
openmp: Add omp_aligned_{,c}alloc and omp_{c,re}alloc
This patch adds new OpenMP 5.1 allocator entrypoints and in addition to that fixes an omp_alloc bug which is hard to test for - if the first allocator fails but has a larger alignment trait and has a fallback allocator, either the default behavior or a user fallback, then the extra alignment will be used even in the fallback allocation, rather than just starting with whatever alignment has been requested (in GOMP_alloc or the minimum one in omp_alloc). Jonathan's comment on IRC this morning made me realize that I should add alloc_align attributes to 2 of the prototypes and I still need to add testsuite coverage for omp_realloc, will do that in a follow-up. 2021-09-30 Jakub Jelinek <jakub@redhat.com> * omp.h.in (omp_aligned_alloc, omp_calloc, omp_aligned_calloc, omp_realloc): New prototypes. (omp_alloc): Move after omp_free prototype, add __malloc__ (omp_free) attribute. * allocator.c: Include string.h. (omp_aligned_alloc): No longer static, add ialias. Add new_alignment variable and use it instead of alignment so that when retrying the old alignment is used again. Don't retry if new alignment is the same as old alignment, unless allocator had pool size. (omp_alloc, GOMP_alloc, GOMP_free): Use ialias_call. (omp_aligned_calloc, omp_calloc, omp_realloc): New functions. * libgomp.map (OMP_5.0.2): Export omp_aligned_alloc, omp_calloc, omp_aligned_calloc and omp_realloc. * testsuite/libgomp.c-c++-common/alloc-4.c (main): Add omp_aligned_alloc, omp_calloc and omp_aligned_calloc tests. * testsuite/libgomp.c-c++-common/alloc-5.c: New test. * testsuite/libgomp.c-c++-common/alloc-6.c: New test. * testsuite/libgomp.c-c++-common/alloc-7.c: New test. * testsuite/libgomp.c-c++-common/alloc-8.c: New test.
Diffstat (limited to 'libgomp/libgomp.map')
-rw-r--r--libgomp/libgomp.map4
1 files changed, 4 insertions, 0 deletions
diff --git a/libgomp/libgomp.map b/libgomp/libgomp.map
index e0c813c..460a7a4 100644
--- a/libgomp/libgomp.map
+++ b/libgomp/libgomp.map
@@ -203,6 +203,10 @@ OMP_5.0.2 {
global:
omp_get_device_num;
omp_get_device_num_;
+ omp_aligned_alloc;
+ omp_calloc;
+ omp_aligned_calloc;
+ omp_realloc;
} OMP_5.0.1;
OMP_5.1 {