mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 12:54:11 +08:00
Remove unused c10/util/C++17.h inclusion and outdated checks (#120149)
This is a continued work to clean up pre-C++17 code. Pull Request resolved: https://github.com/pytorch/pytorch/pull/120149 Approved by: https://github.com/ezyang
This commit is contained in:
@ -5,6 +5,7 @@
|
||||
|
||||
#include <c10/core/Backend.h>
|
||||
#include <c10/core/ScalarType.h>
|
||||
#include <memory>
|
||||
|
||||
namespace at {
|
||||
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include <c10/core/TensorOptions.h>
|
||||
#include <c10/core/UndefinedTensorImpl.h>
|
||||
#include <c10/core/WrapDimMinimal.h>
|
||||
#include <c10/util/C++17.h>
|
||||
#include <c10/util/Exception.h>
|
||||
#include <c10/util/ExclusivelyOwned.h>
|
||||
#include <c10/util/ExclusivelyOwnedTensorTraits.h>
|
||||
|
@ -3,6 +3,7 @@
|
||||
#include <ATen/core/boxing/impl/WrapFunctionIntoFunctor.h>
|
||||
#include <ATen/core/boxing/impl/WrapFunctionIntoRuntimeFunctor.h>
|
||||
|
||||
#include <c10/util/C++17.h>
|
||||
#include <type_traits>
|
||||
|
||||
namespace c10 {
|
||||
|
@ -6,8 +6,6 @@
|
||||
#include <iterator>
|
||||
#include <limits>
|
||||
|
||||
#include <c10/util/C++17.h>
|
||||
|
||||
#include <ATen/cuda/cub_definitions.cuh>
|
||||
|
||||
#if USE_GLOBAL_CUB_WRAPPED_NAMESPACE()
|
||||
|
@ -8,17 +8,6 @@
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
|
||||
#if !defined(__clang__) && !defined(_MSC_VER) && defined(__GNUC__) && \
|
||||
__GNUC__ < 5
|
||||
#error \
|
||||
"You're trying to build PyTorch with a too old version of GCC. We need GCC 5 or later."
|
||||
#endif
|
||||
|
||||
#if defined(__clang__) && __clang_major__ < 4
|
||||
#error \
|
||||
"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
|
||||
|
@ -15,7 +15,6 @@
|
||||
/// and inspired by Half implementation from pytorch/c10/util/Half.h
|
||||
|
||||
#include <c10/macros/Macros.h>
|
||||
#include <c10/util/C++17.h>
|
||||
#include <c10/util/TypeSafeSignMath.h>
|
||||
#include <c10/util/floating_point_utils.h>
|
||||
#include <type_traits>
|
||||
|
@ -18,7 +18,6 @@
|
||||
/// the existing Float8_e4m3fn implementation.
|
||||
|
||||
#include <c10/macros/Macros.h>
|
||||
#include <c10/util/C++17.h>
|
||||
#include <c10/util/TypeSafeSignMath.h>
|
||||
#include <c10/util/floating_point_utils.h>
|
||||
#include <type_traits>
|
||||
|
@ -18,7 +18,6 @@
|
||||
/// the existing Float8_e4m3fn implementation.
|
||||
|
||||
#include <c10/macros/Macros.h>
|
||||
#include <c10/util/C++17.h>
|
||||
#include <c10/util/TypeSafeSignMath.h>
|
||||
#include <c10/util/floating_point_utils.h>
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
#include <c10/util/C++17.h>
|
||||
#include <c10/util/TypeTraits.h>
|
||||
#include <algorithm>
|
||||
#include <cstddef>
|
||||
@ -501,10 +500,8 @@ struct map_types_to_values final {
|
||||
template <class... Types>
|
||||
struct map_types_to_values<typelist<Types...>> final {
|
||||
template <class Func>
|
||||
static std::tuple<c10::invoke_result_t<Func, type_<Types>>...> call(
|
||||
Func&& func) {
|
||||
return std::tuple<c10::invoke_result_t<Func, type_<Types>>...>{
|
||||
std::forward<Func>(func)(type_<Types>())...};
|
||||
static auto call(Func&& func) {
|
||||
return std::tuple{std::forward<Func>(func)(type_<Types>())...};
|
||||
}
|
||||
};
|
||||
} // namespace detail
|
||||
|
@ -1,6 +1,5 @@
|
||||
#pragma once
|
||||
#include <c10/macros/Macros.h>
|
||||
#include <c10/util/C++17.h>
|
||||
#include <c10/util/Exception.h>
|
||||
#include <torch/csrc/Export.h>
|
||||
#include <torch/csrc/jit/frontend/parser_constants.h>
|
||||
|
Reference in New Issue
Block a user