You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
C:\src\llvm.monorepo\openmp\runtime\src\kmp_settings.cpp(3358): error C2131: expression did not evaluate to a constant
C:\src\llvm.monorepo\openmp\runtime\src\kmp_settings.cpp(3358): note: failure was caused by a read of a variable outside its lifetime
C:\src\llvm.monorepo\openmp\runtime\src\kmp_settings.cpp(3358): note: see usage of 'ntraits'
[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
C:\src\llvm.monorepo\openmp\runtime\src\kmp_settings.cpp(3358): error C2131:
expression did not evaluate to a constant
C:\src\llvm.monorepo\openmp\runtime\src\kmp_settings.cpp(3358): note:
failure was caused by a read of a variable outside its lifetime
C:\src\llvm.monorepo\openmp\runtime\src\kmp_settings.cpp(3358): note: see
usage of 'ntraits'
I think what MSVC might be trying to say in this convoluted way, is that it doesn't like
omp_alloctrait_t traits[ntraits]
because ntraits is not constant, and so this would be a variable-length array which isn't support in C++ (though often allowed as an extension).
Extended Description
in a VS 2019 x86 Native Tools Command Prompt
with llvmorg-12.0.0-rc1 checked out
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_ENABLE_PROJECTS="clang;openmp" ..\llvm
ninja omp
C:\src\llvm.monorepo\openmp\runtime\src\kmp_settings.cpp(3358): error C2131: expression did not evaluate to a constant
C:\src\llvm.monorepo\openmp\runtime\src\kmp_settings.cpp(3358): note: failure was caused by a read of a variable outside its lifetime
C:\src\llvm.monorepo\openmp\runtime\src\kmp_settings.cpp(3358): note: see usage of 'ntraits'
Bisection points to
commit 927af4b
Author: Nawrin Sultana nawrin.sultana@intel.com
Date: Mon Nov 2 16:17:37 2020 -0600
openmp/runtime/src/kmp_settings.cpp | 391 ++++++++++++++++++++++++------
openmp/runtime/test/env/omp51_alloc_env.c | 31 +++
2 files changed, 353 insertions(+), 69 deletions(-)
create mode 100644 openmp/runtime/test/env/omp51_alloc_env.c
As of this morning the same error happens on the main branch too.
The text was updated successfully, but these errors were encountered: