gcc/libgomp
Jakub Jelinek b38a4bd102 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.
2021-09-30 09:30:18 +02:00
..
config Make the OpenMP 'error' directive work for nvptx offloading 2021-08-22 11:08:26 +02:00
plugin amdgcn: Enable OpenACC worker partitioning for AMD GCN 2021-08-09 15:08:44 +02:00
testsuite openmp: Add omp_aligned_{,c}alloc and omp_{c,re}alloc 2021-09-30 09:30:18 +02:00
.gitattributes
ChangeLog Daily bump. 2021-09-29 00:16:26 +00:00
ChangeLog.graphite
Makefile.am openmp: Implement OpenMP 5.1 scope construct 2021-08-17 09:30:09 +02:00
Makefile.in openmp: Implement OpenMP 5.1 scope construct 2021-08-17 09:30:09 +02:00
acc_prof.h
acinclude.m4
aclocal.m4
affinity-fmt.c
affinity.c
alloc.c
allocator.c openmp: Add omp_aligned_{,c}alloc and omp_{c,re}alloc 2021-09-30 09:30:18 +02:00
atomic.c
barrier.c
config.h.in offload-defaulted: Config option to silently ignore uninstalled offload compilers 2021-04-28 18:46:47 +02:00
configure libgomp: Only check for 2*sizeof(void*) int type with Fortran [PR96661] 2021-09-28 15:15:47 +02:00
configure.ac libgomp: Only check for 2*sizeof(void*) int type with Fortran [PR96661] 2021-09-28 15:15:47 +02:00
configure.tgt [gcn] Work-around libgomp 'error: array subscript 0 is outside array bounds of ‘__lds struct gomp_thread * __lds[0]’ [-Werror=array-bounds]' some more [PR101484] 2021-07-20 09:14:28 +02:00
critical.c
env.c OpenMP 5.1: Add proc-bind 'primary' support 2021-08-12 15:49:49 +02:00
error.c openmp: Implement the error directive 2021-08-20 11:36:52 +02:00
fortran.c openmp: Implement omp_get_device_num routine 2021-08-05 23:29:03 +08:00
hashtab.h libgomp: Structure element mapping for OpenMP 5.0 2021-06-17 21:34:59 +08:00
icv-device.c openmp: Implement omp_get_device_num routine 2021-08-05 23:29:03 +08:00
icv.c
iter.c
iter_ull.c
libgomp-plugin.c
libgomp-plugin.h openmp: Implement omp_get_device_num routine 2021-08-05 23:29:03 +08:00
libgomp.h Fix OpenACC "ephemeral" asynchronous host-to-device copies 2021-07-27 11:16:27 +02:00
libgomp.map openmp: Add omp_aligned_{,c}alloc and omp_{c,re}alloc 2021-09-30 09:30:18 +02:00
libgomp.spec.in
libgomp.texi openmp: Allow private or firstprivate arguments to default clause even for C/C++ 2021-09-18 09:47:25 +02:00
libgomp_f.h.in
libgomp_g.h openmp: Implement the error directive 2021-08-20 11:36:52 +02:00
lock.c
loop.c
loop_ull.c
oacc-async.c
oacc-cuda.c
oacc-host.c
oacc-init.c
oacc-int.h
oacc-mem.c Fix OpenACC "ephemeral" asynchronous host-to-device copies 2021-07-27 11:16:27 +02:00
oacc-parallel.c libgomp: Structure element mapping for OpenMP 5.0 2021-06-17 21:34:59 +08:00
oacc-plugin.c
oacc-plugin.h
oacc-profiling.c
oacc-target.c
omp.h.in openmp: Add omp_aligned_{,c}alloc and omp_{c,re}alloc 2021-09-30 09:30:18 +02:00
omp_lib.f90.in Fortran/OpenMP: Add memory routines existing for C/C++ 2021-08-18 11:15:47 +02:00
omp_lib.h.in Fortran/OpenMP: Add memory routines existing for C/C++ 2021-08-18 11:15:47 +02:00
openacc.f90
openacc.h
openacc_lib.h
ordered.c
parallel.c
priority_queue.c
priority_queue.h
scope.c openmp: Implement OpenMP 5.1 scope construct 2021-08-17 09:30:09 +02:00
sections.c
secure_getenv.h
single.c
splay-tree.c
splay-tree.h
target.c openmp: Implement omp_get_device_num routine 2021-08-05 23:29:03 +08:00
task.c openmp: Notify team barrier of pending tasks in omp_fulfill_event 2021-05-17 13:15:08 -07:00
taskloop.c openmp: Add support for strict modifier on grainsize/num_tasks clauses 2021-08-23 10:16:24 +02:00
team.c Replace VRP threader with a hybrid forward threader. 2021-09-27 17:39:51 +02:00
teams.c
work.c