Unverified Commit 942796ce authored by cyy's avatar cyy Committed by GitHub
Browse files

switch to C++17 following the core library (#7116)


Co-authored-by: default avatarvfdev <vfdev.5@gmail.com>
parent 6a85ef24
cmake_minimum_required(VERSION 3.12)
cmake_minimum_required(VERSION 3.18)
project(torchvision)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 17)
file(STRINGS version.txt TORCHVISION_VERSION)
option(WITH_CUDA "Enable CUDA support" OFF)
......@@ -13,11 +13,6 @@ if(WITH_CUDA)
add_definitions(-D__CUDA_NO_HALF_OPERATORS__)
add_definitions(-DWITH_CUDA)
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} --expt-relaxed-constexpr")
# CUDA-11.x can not be compiled using C++14 standard on Windows
string(REGEX MATCH "^[0-9]+" CUDA_MAJOR ${CMAKE_CUDA_COMPILER_VERSION})
if(${CUDA_MAJOR} GREATER 10 AND MSVC)
set(CMAKE_CXX_STANDARD 17)
endif()
endif()
find_package(Torch REQUIRED)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment