Revert "PyTorch -> C++17 (#98209) (#100557)"

This reverts commit 083f88e126.

Reverted https://github.com/pytorch/pytorch/pull/100557 on behalf of https://github.com/jeanschmidt due to breaking internal builds ([comment](https://github.com/pytorch/pytorch/pull/100557#issuecomment-1543285863))
This commit is contained in:
PyTorch MergeBot 2023-05-11 03:43:11 +00:00
parent 2621fbda7d
commit da02ccc60e
7 changed files with 14 additions and 14 deletions

View File

@ -26,7 +26,7 @@ requirements:
about:
home: https://github.com/pytorch/pytorch
license: BSD
summary: A TENsor library for C++17
summary: A TENsor library for C++14
extra:
recipe-maintainers:

View File

@ -1,7 +1,7 @@
#pragma once
#if !defined(_MSC_VER) && __cplusplus < 201703L
#error C++17 or later compatible compiler is required to use ATen.
#if !defined(_MSC_VER) && __cplusplus < 201402L
#error C++14 or later compatible compiler is required to use ATen.
#endif
#include <ATen/Context.h>

View File

@ -121,9 +121,9 @@ endif()
if(UNIX)
add_definitions(-DUSE_PTHREAD)
check_cxx_compiler_flag("-std=c++17" SUPPORTS_STDCXX17)
if(SUPPORTS_STDCXX17)
set(CMAKE_CXX_FLAGS "-std=c++17 ${CMAKE_CXX_FLAGS}")
check_cxx_compiler_flag("-std=c++14" SUPPORTS_STDCXX14)
if(SUPPORTS_STDCXX14)
set(CMAKE_CXX_FLAGS "-std=c++14 ${CMAKE_CXX_FLAGS}")
endif()
check_cxx_compiler_flag("-mrtm -Werror" SUPPORTS_MRTM)

View File

@ -2,9 +2,9 @@ cmake_minimum_required(VERSION 3.0)
find_package(ATen REQUIRED)
include_directories(${ATEN_INCLUDE_DIR})
# C++17
# C++14
if(not MSVC)
set(CMAKE_CXX_FLAGS "--std=c++17 ${CMAKE_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS "--std=c++14 ${CMAKE_CXX_FLAGS}")
endif()
add_executable(main main.cpp)
target_link_libraries(main ${ATEN_LIBRARIES})

View File

@ -22,9 +22,9 @@
"You're trying to build PyTorch with a too old version of Clang. We need Clang 4 or later."
#endif
#if (defined(_MSC_VER) && (!defined(_MSVC_LANG) || _MSVC_LANG < 201703L)) || \
(!defined(_MSC_VER) && __cplusplus < 201703L)
#error You need C++17 to compile PyTorch
#if (defined(_MSC_VER) && (!defined(_MSVC_LANG) || _MSVC_LANG < 201402L)) || \
(!defined(_MSC_VER) && __cplusplus < 201402L)
#error You need C++14 to compile PyTorch
#endif
#if defined(_WIN32) && (defined(min) || defined(max))

View File

@ -1,7 +1,7 @@
# An ATen operator for Caffe2
ATen is a simple tensor library thats exposes the Tensor operations in Torch
and PyTorch directly in C++17. This library provides a generated wrapper around the ATen API
and PyTorch directly in C++14. This library provides a generated wrapper around the ATen API
that makes these functions available in Caffe2 as an operator. It also makes it accessible using the
ToffeeIR.

View File

@ -1,7 +1,7 @@
#pragma once
#if !defined(_MSC_VER) && __cplusplus < 201703L
#error C++17 or later compatible compiler is required to use PyTorch.
#if !defined(_MSC_VER) && __cplusplus < 201402L
#error C++14 or later compatible compiler is required to use PyTorch.
#endif
#include <torch/autograd.h>