Files
Tobias Burnus 73a0d3bf89 libgomp: Extend OMP_ALLOCATOR, add affinity env var doc
Support OpenMP 5.1's syntax for OMP_ALLOCATOR as well,
which permits besides predefined allocators also
predefined memspaces optionally followed by traits.

Additionally, this commit adds the previously lacking
documentation for OMP_ALLOCATOR, OMP_AFFINITY_FORMAT
and OMP_DISPLAY_AFFINITY.

libgomp/ChangeLog:

	* env.c (gomp_def_allocator_envvar): New var.
	(parse_allocator): Handle OpenMP 5.1 syntax.
	(cleanup_env): New.
	(omp_display_env): Output gomp_def_allocator_envvar
	for an allocator with traits.
	* libgomp.texi (OMP_ALLOCATOR, OMP_AFFINITY_FORMAT,
	OMP_DISPLAY_AFFINITY): New.
	* testsuite/libgomp.c/allocator-1.c: New test.
	* testsuite/libgomp.c/allocator-2.c: New test.
	* testsuite/libgomp.c/allocator-3.c: New test.
	* testsuite/libgomp.c/allocator-4.c: New test.
	* testsuite/libgomp.c/allocator-5.c: New test.
	* testsuite/libgomp.c/allocator-6.c: New test.
2023-06-15 12:55:58 +02:00

18 lines
539 B
C

/* { dg-set-target-env-var OMP_ALLOCATOR "omp_large_cap_mem_space" } */
/* { dg-set-target-env-var OMP_DISPLAY_ENV "true" } */
/* Expect omp_large_cap_mem_alloc as allocator for omp_large_cap_mem_space. */
/* { dg-output ".\\\[host\\\] OMP_ALLOCATOR = 'omp_large_cap_mem_alloc'.*" } */
#include <omp.h>
int
main ()
{
omp_allocator_handle_t m = omp_get_default_allocator ();
/* Without traits, omp_large_cap_mem_space implies
omp_large_cap_mem_alloc. */
if (m != omp_large_cap_mem_alloc)
__builtin_abort ();
return 0;
}