3.11.1 omp_init_allocator – Create an allocator

Description:

Create an allocator that uses the specified memory space and has the specified traits; if an allocator that fulfills the requirements cannot be created, omp_null_allocator is returned.

The predefined memory spaces and available traits can be found at OMP_ALLOCATOR – Set the default allocator, where the trait names have to be prefixed by omp_atk_ (e.g. omp_atk_pinned) and the named trait values by omp_atv_ (e.g. omp_atv_true); additionally, omp_atv_default may be used as trait value to specify that the default value should be used.

C/C++:
Prototype:omp_allocator_handle_t omp_init_allocator(
omp_memspace_handle_t memspace,
int ntraits,
const omp_alloctrait_t traits[]);
Fortran:
Interface:function omp_init_allocator(memspace, ntraits, traits)
integer (omp_allocator_handle_kind) :: omp_init_allocator
integer (omp_memspace_handle_kind), intent(in) :: memspace
integer, intent(in) :: ntraits
type (omp_alloctrait), intent(in) :: traits(*)
See also:

OMP_ALLOCATOR – Set the default allocator, Memory allocation, omp_destroy_allocator – Destroy an allocator

Reference:

OpenMP specification v5.0, Section 3.7.2