For GCC, ``-Wunused`` contains: ``` -Wunused-function Warn whenever a static function is declared but not defined or a non\-inline static function is unused. -Wunused-label Warn whenever a label is declared but not used. To suppress this warning use the unused attribute. -Wunused-parameter Warn whenever a function parameter is unused aside from its declaration. To suppress this warning use the unused attribute. -Wunused-variable Warn whenever a local variable or non-constant static variable is unused aside from its declaration To suppress this warning use the unused attribute. ``` For Clang, some of the diagnostics controlled by ``-Wunused`` are enabled by default: ``` Controls [-Wunused-argument](https://clang.llvm.org/docs/DiagnosticsReference.html#wunused-argument), [-Wunused-but-set-variable](https://clang.llvm.org/docs/DiagnosticsReference.html#wunused-but-set-variable), [-Wunused-function](https://clang.llvm.org/docs/DiagnosticsReference.html#wunused-function), [-Wunused-label](https://clang.llvm.org/docs/DiagnosticsReference.html#wunused-label), [-Wunused-lambda-capture](https://clang.llvm.org/docs/DiagnosticsReference.html#wunused-lambda-capture), [-Wunused-local-typedef](https://clang.llvm.org/docs/DiagnosticsReference.html#wunused-local-typedef), [-Wunused-private-field](https://clang.llvm.org/docs/DiagnosticsReference.html#wunused-private-field), [-Wunused-property-ivar](https://clang.llvm.org/docs/DiagnosticsReference.html#wunused-property-ivar), [-Wunused-value](https://clang.llvm.org/docs/DiagnosticsReference.html#wunused-value), [-Wunused-variable](https://clang.llvm.org/docs/DiagnosticsReference.html#wunused-variable). ``` These checks are all usefull. This PR aims to enable ``-Wunused`` without breaking code. Pull Request resolved: https://github.com/pytorch/pytorch/pull/150077 Approved by: https://github.com/zou3519, https://github.com/wdvr |
||
|---|---|---|
| .. | ||
| alloc_cpu.cpp | ||
| alloc_cpu.h | ||
| COW.cpp | ||
| COW.h | ||
| COWDeleter.cpp | ||
| COWDeleter.h | ||
| DeviceGuardImplInterface.cpp | ||
| DeviceGuardImplInterface.h | ||
| FakeGuardImpl.h | ||
| GPUTrace.cpp | ||
| GPUTrace.h | ||
| HermeticPyObjectTLS.cpp | ||
| HermeticPyObjectTLS.h | ||
| InlineDeviceGuard.h | ||
| InlineEvent.h | ||
| InlineStreamGuard.h | ||
| LocalDispatchKeySet.cpp | ||
| LocalDispatchKeySet.h | ||
| PyInterpreter.cpp | ||
| PyInterpreter.h | ||
| PyObjectSlot.cpp | ||
| PyObjectSlot.h | ||
| PythonDispatcherTLS.cpp | ||
| PythonDispatcherTLS.h | ||
| README-cow.md | ||
| README.md | ||
| SizesAndStrides.cpp | ||
| SizesAndStrides.h | ||
| TorchDispatchModeTLS.cpp | ||
| TorchDispatchModeTLS.h | ||
| VirtualGuardImpl.h | ||
c10/core/impl provides headers for functionality that is only needed in very specific use-cases (e.g., you are defining a new device type), which are generally only needed by C10 or PyTorch code. If you are an ordinary end-user, you should not use headers in this folder. We permanently give NO backwards-compatibility guarantees for implementations in this folder.
Compare with c10/util, which provides functionality that is not directly related to being a deep learning library (e.g., C++20 polyfills), but may still be generally useful and visible to users.
(We don't call this c10/detail, because the detail namespace convention is for header private details. However, c10::impl may be utilized from external headers; it simply indicates that the functionality is not for end users.)