4.1 OMP_ALLOCATOR – Set the default allocator

ICV: def-allocator-var
Scope: data environment
Description:

Sets the default allocator that is used when no allocator has been specified in the allocate or allocator clause or if an OpenMP memory routine is invoked with the omp_null_allocator allocator. If unset, omp_default_mem_alloc is used.

The value can either be a predefined allocator or a predefined memory space or a predefined memory space followed by a colon and a comma-separated list of memory trait and value pairs, separated by =.

See Memory allocation for a list of supported prefedined allocators, memory spaces, and traits.

Note: The corresponding device environment variables are currently not supported. Therefore, the non-host def-allocator-var ICVs are always initialized to omp_default_mem_alloc. However, on all devices, the omp_set_default_allocator API routine can be used to change value.

Examples:

OMP_ALLOCATOR=omp_high_bw_mem_alloc
OMP_ALLOCATOR=omp_large_cap_mem_space
OMP_ALLOCATOR=omp_low_lat_mem_space:pinned=true,partition=nearest
See also:

Memory allocation, omp_get_default_allocator – Get the default allocator, omp_set_default_allocator – Set the default allocator, Offload-Target Specifics

Reference:

OpenMP specification v5.0, Section 6.21