Skip to content

Commit 3ff4e2e

Browse files
committed
[OpenMP] Switch default C++ standard to C++ 14
Reviewed By: JonChesterfield Differential Revision: https://reviews.llvm.org/D74258
1 parent d3a96fc commit 3ff4e2e

File tree

7 files changed

+12
-12
lines changed

7 files changed

+12
-12
lines changed

openmp/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ set(ENABLE_LIBOMPTARGET ON)
6262
# Currently libomptarget cannot be compiled on Windows or MacOS X.
6363
# Since the device plugins are only supported on Linux anyway,
6464
# there is no point in trying to compile libomptarget on other OSes.
65-
if (APPLE OR WIN32 OR NOT OPENMP_HAVE_STD_CPP11_FLAG)
65+
if (APPLE OR WIN32 OR NOT OPENMP_HAVE_STD_CPP14_FLAG)
6666
set(ENABLE_LIBOMPTARGET OFF)
6767
endif()
6868

@@ -72,8 +72,8 @@ if (OPENMP_ENABLE_LIBOMPTARGET)
7272
# Check that the library can actually be built.
7373
if (APPLE OR WIN32)
7474
message(FATAL_ERROR "libomptarget cannot be built on Windows and MacOS X!")
75-
elseif (NOT OPENMP_HAVE_STD_CPP11_FLAG)
76-
message(FATAL_ERROR "Host compiler must support C++11 to build libomptarget!")
75+
elseif (NOT OPENMP_HAVE_STD_CPP14_FLAG)
76+
message(FATAL_ERROR "Host compiler must support C++14 to build libomptarget!")
7777
endif()
7878

7979
add_subdirectory(libomptarget)

openmp/cmake/HandleOpenMPOptions.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ append_if(OPENMP_HAVE_WNO_EXTRA_FLAG "-Wno-extra" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
2929
append_if(OPENMP_HAVE_WNO_PEDANTIC_FLAG "-Wno-pedantic" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
3030
append_if(OPENMP_HAVE_WNO_MAYBE_UNINITIALIZED_FLAG "-Wno-maybe-uninitialized" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
3131

32-
append_if(OPENMP_HAVE_STD_GNUPP11_FLAG "-std=gnu++11" CMAKE_CXX_FLAGS)
33-
if (NOT OPENMP_HAVE_STD_GNUPP11_FLAG)
34-
append_if(OPENMP_HAVE_STD_CPP11_FLAG "-std=c++11" CMAKE_CXX_FLAGS)
32+
append_if(OPENMP_HAVE_STD_GNUPP14_FLAG "-std=gnu++14" CMAKE_CXX_FLAGS)
33+
if (NOT OPENMP_HAVE_STD_GNUPP14_FLAG)
34+
append_if(OPENMP_HAVE_STD_CPP14_FLAG "-std=c++14" CMAKE_CXX_FLAGS)
3535
endif()

openmp/cmake/config-ix.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ check_cxx_compiler_flag(-Wno-extra OPENMP_HAVE_WNO_EXTRA_FLAG)
1414
check_cxx_compiler_flag(-Wno-pedantic OPENMP_HAVE_WNO_PEDANTIC_FLAG)
1515
check_cxx_compiler_flag(-Wno-maybe-uninitialized OPENMP_HAVE_WNO_MAYBE_UNINITIALIZED_FLAG)
1616

17-
check_cxx_compiler_flag(-std=gnu++11 OPENMP_HAVE_STD_GNUPP11_FLAG)
18-
check_cxx_compiler_flag(-std=c++11 OPENMP_HAVE_STD_CPP11_FLAG)
17+
check_cxx_compiler_flag(-std=gnu++14 OPENMP_HAVE_STD_GNUPP14_FLAG)
18+
check_cxx_compiler_flag(-std=c++14 OPENMP_HAVE_STD_CPP14_FLAG)

openmp/libomptarget/cmake/Modules/LibomptargetNVPTXBitcodeLibrary.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ endfunction()
7878

7979
# These flags are required to emit LLVM Bitcode. We check them together because
8080
# if any of them are not supported, there is no point in finding out which are.
81-
set(compiler_flags_required -emit-llvm -O1 --cuda-device-only -std=c++11 --cuda-path=${CUDA_TOOLKIT_ROOT_DIR})
81+
set(compiler_flags_required -emit-llvm -O1 --cuda-device-only -std=c++14 --cuda-path=${CUDA_TOOLKIT_ROOT_DIR})
8282
set(compiler_flags_required_src "extern \"C\" __device__ int thread() { return threadIdx.x; }")
8383
check_bitcode_compilation(LIBOMPTARGET_NVPTX_CUDA_COMPILER_SUPPORTS_FLAGS_REQUIRED "${compiler_flags_required_src}" ${compiler_flags_required})
8484

openmp/libomptarget/deviceRTLs/amdgcn/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ endif()
9898

9999
macro(add_cuda_bc_library)
100100
set(cu_cmd ${AOMP_BINDIR}/clang++
101-
-std=c++11
101+
-std=c++14
102102
-fcuda-rdc
103103
-fvisibility=default
104104
--cuda-device-only

openmp/runtime/test/lit.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ config.substitutions.append(("%libomp-compile-and-run", \
111111
config.substitutions.append(("%libomp-cxx-compile-and-run", \
112112
"%libomp-cxx-compile && %libomp-run"))
113113
config.substitutions.append(("%libomp-cxx-compile", \
114-
"%clangXX %openmp_flags %flags -std=c++11 %s -o %t" + libs))
114+
"%clangXX %openmp_flags %flags -std=c++14 %s -o %t" + libs))
115115
config.substitutions.append(("%libomp-compile", \
116116
"%clang %openmp_flags %flags %s -o %t" + libs))
117117
config.substitutions.append(("%libomp-run", "%t"))

openmp/tools/archer/tests/lit.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ config.substitutions.append(("%libarcher-compile-and-run", \
9797
config.substitutions.append(("%libarcher-cxx-compile-and-run", \
9898
"%libarcher-cxx-compile && %libarcher-run"))
9999
config.substitutions.append(("%libarcher-cxx-compile", \
100-
"%clang-archerXX %openmp_flags %archer_flags %flags -std=c++11 %s -o %t" + libs))
100+
"%clang-archerXX %openmp_flags %archer_flags %flags -std=c++14 %s -o %t" + libs))
101101
config.substitutions.append(("%libarcher-compile", \
102102
"%clang-archer %openmp_flags %archer_flags %flags %s -o %t" + libs))
103103
config.substitutions.append(("%libarcher-run-race", "%suppression %deflake %t 2>&1 | tee %t.log"))

0 commit comments

Comments
 (0)