[OpenMP] Modify OMP_ALLOCATOR environment variable
authorNawrin Sultana <nawrin.sultana@intel.com>
Mon, 2 Nov 2020 22:17:37 +0000 (16:17 -0600)
committerNawrin Sultana <nawrin.sultana@intel.com>
Wed, 27 Jan 2021 00:27:39 +0000 (18:27 -0600)
commit927af4b3c57681e623b8449fb717a447559358d0
tree1af6beaecca0238964a11b468037ebeeded0b5c5
parent653655040f3e89f7725ce6961d797d4ac918708b
[OpenMP] Modify OMP_ALLOCATOR environment variable

This patch sets the def-allocator-var ICV based on the environment variables
provided in OMP_ALLOCATOR. Previously, only allowed value for OMP_ALLOCATOR
was a predefined memory allocator. OpenMP 5.1 specification allows predefined
memory allocator, predefined mem space, or predefined mem space with traits in
OMP_ALLOCATOR. If an allocator can not be created using the provided environment
variables, the def-allocator-var is set to omp_default_mem_alloc.

Differential Revision: https://reviews.llvm.org/D94985
openmp/runtime/src/kmp_settings.cpp
openmp/runtime/test/env/omp51_alloc_env.c [new file with mode: 0644]