pytorch/c10/util
Nikita Shulga 36ac095ff8 Migrate PyTorch to C++17 (#85969)
With CUDA-10.2 gone we can finally do it!

This PR mostly contains build system related changes, invasive functional ones are to be followed.
Among many expected tweaks to the build system, here are few unexpected ones:
 - Force onnx_proto project to be updated to C++17 to avoid `duplicate symbols` error when compiled by gcc-7.5.0, as storage rule for `constexpr` changed in C++17, but gcc does not seem to follow it
 - Do not use `std::apply` on CUDA but rely on the built-in variant, as it results in test failures when CUDA runtime picks host rather than device function when `std::apply` is invoked from CUDA code.
 - `std::decay_t` -> `::std::decay_t` and `std::move`->`::std::move` as VC++ for some reason claims that `std` symbol is ambigious
 - Disable use of `std::aligned_alloc` on Android, as its `libc++` does not implement it.

Some prerequisites:
 - https://github.com/pytorch/pytorch/pull/89297
 - https://github.com/pytorch/pytorch/pull/89605
 - https://github.com/pytorch/pytorch/pull/90228
 - https://github.com/pytorch/pytorch/pull/90389
 - https://github.com/pytorch/pytorch/pull/90379
 - https://github.com/pytorch/pytorch/pull/89570
 - https://github.com/facebookincubator/gloo/pull/336
 - https://github.com/facebookincubator/gloo/pull/343
 - 919676fb32

Fixes https://github.com/pytorch/pytorch/issues/56055

Pull Request resolved: https://github.com/pytorch/pytorch/pull/85969
Approved by: https://github.com/ezyang, https://github.com/kulinseth
2022-12-08 02:27:48 +00:00
..
accumulate.h Fix c10 sign-compare violations 2022-04-01 19:15:51 +00:00
AlignOf.h
Array.cpp
Array.h [PyTorch] Autoformat c10 (#56830) 2021-04-30 21:23:28 -07:00
ArrayRef.h List of SymInt rebase on master 2022-04-20 02:09:55 +00:00
Backtrace.cpp Revert "Improve and expose cpp_backtrace to python binding (#84896)" 2022-09-21 03:13:20 +00:00
Backtrace.h
BFloat16-inl.h [warnings][Caffe2] Suppress warnings in caffe2 headers (#71196) 2022-01-12 10:16:35 -08:00
BFloat16-math.h [fbcode][warnings] Suppress warnings in caffe2/c10 (#71356) 2022-01-15 18:34:08 -08:00
BFloat16.h [AutoAccept][Codemod][FBSourceClangFormatLinter] Daily arc lint --take CLANGFORMAT 2022-02-04 11:14:53 +00:00
Bitset.h Enable win-arm64 2022-02-28 17:17:56 +00:00
BUILD.bazel extract out //c10/util:base library (#70854) 2022-01-26 11:51:45 +00:00
build.bzl Export c10/[macros|util] headers to be used by internal inductor builds (#89249) 2022-11-18 10:51:07 +00:00
C++17.cpp
C++17.h Migrate PyTorch to C++17 (#85969) 2022-12-08 02:27:48 +00:00
CallOnce.h simple c10 implementation for std::call_once (#78051) 2022-06-28 15:47:03 +00:00
complex_math.cpp [PyTorch] Autoformat c10 (#56830) 2021-04-30 21:23:28 -07:00
complex_math.h Added log1p for complex in c10 (#89214) 2022-11-24 11:11:51 +00:00
complex_utils.h [PyTorch] Autoformat c10 (#56830) 2021-04-30 21:23:28 -07:00
complex.h [AutoAccept][Codemod][FBSourceClangFormatLinter] Daily arc lint --take CLANGFORMAT 2022-02-04 11:14:53 +00:00
ConstexprCrc.h Remove 9.2 related macros for CONSTEXPR (#65066) 2021-09-17 17:31:20 -07:00
copysign.h [PyTorch] Autoformat c10 (#56830) 2021-04-30 21:23:28 -07:00
DeadlockDetection.cpp torch/deadlockdetection: add TORCH_DISABLE_DEADLOCK_DETECTION env for use with torch deploy (#77270) 2022-05-12 00:10:59 +00:00
DeadlockDetection.h [PyTorch] Autoformat c10, round 2 (#57645) 2021-05-05 15:45:53 -07:00
Deprecated.h [PyTorch] Autoformat c10 (#56830) 2021-04-30 21:23:28 -07:00
DimVector.h Store SymInt out of line (#84390) 2022-09-06 20:24:39 +00:00
either.h [PyTorch] Remove unnecessary iostream includes in headers (#61500) 2021-08-19 18:54:51 -07:00
env.h ROCm MIOpen NHWC Convolution support (#63617) 2021-09-10 08:06:32 -07:00
Exception.cpp Add Warning class and refactor C++ warnings to use it (#84101) 2022-10-18 20:02:42 +00:00
Exception.h Add torch.distributed.DistBackendError exception type, thrown from C10D_NCCL_CHECK (#88134) 2022-11-08 13:26:42 +00:00
ExclusivelyOwned.h [PyTorch] Remove buggy ExclusivelyOwnedTraits<intrusive_ptr<T>> (#70647) 2022-01-12 12:19:52 -08:00
ExclusivelyOwnedTensorTraits.h [PyTorch] Support ExclusivelyOwned<caffe2::Tensor> (#81964) 2022-07-27 22:14:40 +00:00
flags_use_gflags.cpp
flags_use_no_gflags.cpp Disable avoid-non-const-global-variables lint check (#62008) 2021-07-22 18:04:40 -07:00
Flags.h zero initialize some members and other fixes (#59915) 2021-07-19 07:36:26 -07:00
flat_hash_map.h [caffe2] Fix shadowed variable warnings in clang (#80902) 2022-07-07 16:07:41 +00:00
FunctionRef.h [BE] Get rid of std::result_of in c10 (#85977) 2022-09-30 23:13:42 +00:00
Half-inl.h Be compatible with SYCL 2020 and SYCL1.2.1 for sycl.hpp (#83259) 2022-09-06 18:38:30 +00:00
Half.cpp
Half.h Be compatible with SYCL 2020 and SYCL1.2.1 for sycl.hpp (#83259) 2022-09-06 18:38:30 +00:00
hash.h [NVFuser] Upstream push 0907 (#84626) 2022-09-23 20:29:48 +00:00
IdWrapper.h Fix missing include for size_t (#84088) 2022-08-26 03:11:46 +00:00
in_place.h [PyTorch] Autoformat c10 (#56830) 2021-04-30 21:23:28 -07:00
int128.cpp Fix c10 sign-compare violations 2022-04-01 19:15:51 +00:00
int128.h [AutoAccept][Codemod][FBSourceClangFormatLinter] Daily arc lint --take CLANGFORMAT 2021-10-07 21:09:22 -07:00
intrusive_ptr.cpp
intrusive_ptr.h Add nullptr_t overload to c10::intrusive_ptr (#89196) 2022-11-19 21:40:07 +00:00
irange.h fix c10::detail::integer_iterator for C++17 (#90174) 2022-12-05 18:39:47 +00:00
LeftRight.cpp
LeftRight.h In order to make pytorch headers consumable from cpp20 code bases, … (#79985) 2022-07-04 20:14:36 +00:00
llvmMathExtras.h Eliminate unused parameters in PyTorch (#73749) 2022-03-04 02:31:37 +00:00
Load.h Accept non-standard bools in more CUDA kernels 2022-06-09 08:31:28 +00:00
logging_is_google_glog.h Fix TORCH_CHECK macros when glog is used (#83216) 2022-08-11 15:27:45 +00:00
logging_is_not_google_glog.h [BE] Use default constructor in LoggerVoidify (#88054) 2022-11-01 03:59:51 +00:00
Logging.cpp [caffe2] drop XROS ports (#76366) 2022-04-26 23:54:22 +00:00
Logging.h Replace all CHECK_ and DCHECK_ with TORCH_* macros (#82032) 2022-07-26 01:20:44 +00:00
math_compat.h Add Elementwise unary ops 4 references (#78216) 2022-05-27 21:55:34 +00:00
MathConstants.cpp Make c10 clang-tidy clean (#55870) 2021-04-14 11:23:28 -07:00
MathConstants.h c10 mathematical constants (#78910) 2022-06-06 22:21:05 +00:00
MaybeOwned.h Eliminate unused parameters in PyTorch (#73749) 2022-03-04 02:31:37 +00:00
Metaprogramming.cpp
Metaprogramming.h Eliminate unused parameters in PyTorch (#73749) 2022-03-04 02:31:37 +00:00
numa.cpp Disable avoid-non-const-global-variables lint check (#62008) 2021-07-22 18:04:40 -07:00
numa.h
Optional.cpp Remove CUDA 9.2 references conditionals and workarounds (#65070) 2021-09-17 12:28:23 -07:00
Optional.h C++20 compatible changes (#85703) 2022-09-27 19:43:14 +00:00
OptionalArrayRef.h Reland: Enable dim=None for torch.sum (#79881) 2022-07-09 00:54:42 +00:00
order_preserving_flat_hash_map.h [caffe2] Fix shadowed variable warnings in clang (#80902) 2022-07-07 16:07:41 +00:00
overloaded.h [PyTorch] Autoformat c10 (#56830) 2021-04-30 21:23:28 -07:00
python_stub.h
qint8.h
qint32.h
quint2x4.h [oss][pytorch] Add quint2x4 dtype (#65545) 2021-10-06 14:22:00 -07:00
quint4x2.h [PyTorch] Autoformat c10 (#56830) 2021-04-30 21:23:28 -07:00
quint8.h
Registry.h Replace all CHECK_ and DCHECK_ with TORCH_* macros (#82032) 2022-07-26 01:20:44 +00:00
reverse_iterator.h [PyTorch] Autoformat c10 (#56830) 2021-04-30 21:23:28 -07:00
safe_numerics.h Use software approach to catch overflow ( c10/utils/safe_numerics.h ) on ARM devices (#89042) 2022-11-17 05:55:28 +00:00
ScopeExit.h [RFC] [PyTorch Edge] Simplify error logging in mobile/import.cpp (#55711) 2021-05-04 20:45:32 -07:00
signal_handler.cpp disable the format library in C10 (#60052) 2021-07-09 12:28:19 -07:00
signal_handler.h Move caffe2 signal_handler to c10. (#56717) 2021-04-26 23:08:12 -07:00
SmallBuffer.h Remove deprecated usage of is_pod/is_pod_v (#88918) 2022-12-05 16:50:00 +00:00
SmallVector.cpp [PyTorch] Remove unused sstream/string includes from c10/macros/Macros.h (#83353) 2022-08-23 16:56:00 +00:00
SmallVector.h [PyTorch] Remove unused sstream/string includes from c10/macros/Macros.h (#83353) 2022-08-23 16:56:00 +00:00
sparse_bitset.h [fbcode][warnings] Suppress warnings in caffe2/c10 (#71356) 2022-01-15 18:34:08 -08:00
strides.h Golf the function contiguous_strides (#82709) 2022-08-03 16:44:54 +00:00
string_utils.h [PyTorch] Autoformat c10 (#56830) 2021-04-30 21:23:28 -07:00
string_view.h Strip GCC5 stuff from PyTorch (#85914) 2022-10-26 00:07:44 +00:00
StringUtil.cpp StringUtils: Avoid unnecessary allocation in ReplaceAll (#79915) 2022-06-27 21:28:04 +00:00
StringUtil.h Remove unnecessary allocations in processErrorMsg 2022-06-21 00:04:17 +00:00
strong_type.h Consistent compute numel/contiguous strategy with SymInts (#85858) 2022-09-30 21:26:34 +00:00
Synchronized.h In order to make pytorch headers consumable from cpp20 code bases, … (#79985) 2022-07-04 20:14:36 +00:00
tempfile.h [DataLoader] Fix tempfile binding and removing for torch_shm_manager (#57566) 2021-05-11 14:14:58 -07:00
thread_name.cpp c10/util/thread_name.cpp: pthread_setname_np requires Glibc 2.12 (#55063) 2021-05-21 10:26:51 -07:00
thread_name.h
ThreadLocal.h Include Macros.h in ThreadLocal 2021-05-27 20:47:56 -07:00
ThreadLocalDebugInfo.cpp (fix): Add some missing std::moves to C10 (#88512) 2022-11-07 22:17:13 +00:00
ThreadLocalDebugInfo.h Fix modernize-use-equals-default nolint failures in torch/csrcs (#61142) 2021-07-06 09:46:46 -07:00
Type_demangle.cpp [PyTorch] Split c10 Type.cpp into two files to allow targets to include one of them (#66445) 2021-10-11 21:52:24 -07:00
Type_no_demangle.cpp [PyTorch] Split c10 Type.cpp into two files to allow targets to include one of them (#66445) 2021-10-11 21:52:24 -07:00
Type.h
TypeCast.cpp Avoid inlining error reporting in checked_convert (#66721) 2021-10-20 16:04:09 -07:00
TypeCast.h Always convert truthy booleans to 1 2022-06-07 16:00:30 +00:00
typeid.cpp [PyTorch][caffe2] Add CAFFE2_{DECLARE,DEFINE}_KNOWN_TYPE (#83707) 2022-08-30 23:09:49 +00:00
typeid.h [PyTorch][caffe2] Add CAFFE2_{DECLARE,DEFINE}_KNOWN_TYPE (#83707) 2022-08-30 23:09:49 +00:00
TypeIndex.h Intel compiler support in c10/util/TypeIndex.h (#89610) 2022-12-02 05:32:21 +00:00
TypeList.cpp
TypeList.h In order to make pytorch headers consumable from cpp20 code bases, … (#79985) 2022-07-04 20:14:36 +00:00
TypeSafeSignMath.h Extend sign-compare warnings to gcc (take 2) 2022-04-13 00:06:52 +00:00
TypeTraits.cpp
TypeTraits.h [PyTorch] Autoformat c10 (#56830) 2021-04-30 21:23:28 -07:00
Unicode.cpp [PyTorch] Autoformat c10 (#56830) 2021-04-30 21:23:28 -07:00
Unicode.h [PyTorch] Autoformat c10 (#56830) 2021-04-30 21:23:28 -07:00
UniqueVoidPtr.cpp
UniqueVoidPtr.h [PyTorch] Autoformat c10 (#56830) 2021-04-30 21:23:28 -07:00
Unroll.h Migrate nonzero from TH to ATen (CPU) (#59149) 2021-06-02 12:26:29 -07:00
variant.h Remove unnecessary copy constructor (#83030) 2022-08-09 01:07:13 +00:00
win32-headers.h [PyTorch] Autoformat c10 (#56830) 2021-04-30 21:23:28 -07:00