Commit Graph

21 Commits

Author SHA1 Message Date
cyy
a2bc2e38f9 Use clang-tidy 17 (#139678)
Fixes #ISSUE_NUMBER

Pull Request resolved: https://github.com/pytorch/pytorch/pull/139678
Approved by: https://github.com/Skylion007
2024-11-05 16:00:25 +00:00
cyy
0c0d8c8ff0 [1/N] Fix extra warnings brought by clang-tidy-17 (#137407)
Before we can use clang-tidy-17
Pull Request resolved: https://github.com/pytorch/pytorch/pull/137407
Approved by: https://github.com/Skylion007, https://github.com/aaronenyeshi
2024-10-07 17:53:59 +00:00
cyy
55905c4a1a [2/N] Enable clang-tidy to c10/test/*cpp (#110270)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/110270
Approved by: https://github.com/Skylion007, https://github.com/kit1980
2023-10-01 07:36:23 +00:00
cyy
3dc479e70b [1/N] Apply clang-tidy to c10/test/*cpp (#109278)
This series of PR enables clang-tidy checks in c10/test. We aim to finally add the path to lintrunner.toml
Pull Request resolved: https://github.com/pytorch/pytorch/pull/109278
Approved by: https://github.com/kit1980
2023-09-29 02:20:57 +00:00
8d56b0a5b5 remove unused tuple_cat utility (#100731)
remove unused tuple_cat utility

Test Plan: Verified unused with `git grep`.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/100731
Approved by: https://github.com/ezyang
2023-05-06 12:48:44 +00:00
f76d0e1b82 remove unused extract_arg_by_filtered_index utility (#100649)
remove unused extract_arg_by_filtered_index utility

Test Plan: Verified unused with `git grep`.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/100649
Approved by: https://github.com/ezyang
2023-05-05 22:25:43 +00:00
e53b288679 remove unused filter_map utility (#100647)
remove unused filter_map utility

Test Plan: Verified unused with `git grep`.

---
Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/pytorch/pytorch/pull/100647).
* #100649
* __->__ #100647
Pull Request resolved: https://github.com/pytorch/pytorch/pull/100647
Approved by: https://github.com/ezyang
2023-05-05 16:15:56 +00:00
a3989b2802 remove unused concat_iseq (#100648)
remove unused concat_iseq

Test Plan: Verified with `git grep`.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/100648
Approved by: https://github.com/Skylion007
2023-05-05 02:02:57 +00:00
7498e23bd5 Re-enabled 2 Metaprogramming tests on Windows (#87284)
With C++17 these tests are not failing

Fixes #25161

Depends on https://github.com/pytorch/pytorch/pull/85969

Pull Request resolved: https://github.com/pytorch/pytorch/pull/87284
Approved by: https://github.com/soulitzer
2022-12-13 04:34:26 +00:00
a9b0a921d5 Disable avoid-non-const-global-variables lint check (#62008)
Summary:
As GoogleTest `TEST` macro is non-compliant with it as well as `DEFINE_DISPATCH`

All changes but the ones to `.clang-tidy` are generated using following script:
```
for i in `find . -type f -iname "*.c*" -or -iname "*.h"|xargs grep cppcoreguidelines-avoid-non-const-global-variables|cut -f1 -d:|sort|uniq`;  do sed -i "/\/\/ NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)/d" $i; done
```

Pull Request resolved: https://github.com/pytorch/pytorch/pull/62008

Reviewed By: driazati, r-barnes

Differential Revision: D29838584

Pulled By: malfet

fbshipit-source-id: 1b2f8602c945bd4ce50a9bfdd204755556e31d13
2021-07-22 18:04:40 -07:00
3a66a1cb99 [clang-tidy] Exclude cppcoreguidelines-avoid-magic-numbers (#57841)
Summary:
Add cppcoreguidelines-avoid-magic-numbers exclusion to clang-tidy
Remove existing nolint warnings using following script:
```
for file in `git ls-files | grep -v \.py`; do gsed '/^ *\/\/ NOLINTNEXTLINE(cppcoreguidelines-avoid-magic-numbers)/d' -i  $file; done
```

Pull Request resolved: https://github.com/pytorch/pytorch/pull/57841

Reviewed By: samestep

Differential Revision: D28295045

Pulled By: malfet

fbshipit-source-id: 7c6e8d1213c9593f169ed3df6a916498f1a97163
2021-05-07 20:02:33 -07:00
44cc873fba [PyTorch] Autoformat c10 (#56830)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/56830

Opt into formatting on GitHub and format everything. This is a trial run before turning on formatting for more and eventually all of the codebase.

Test Plan: CI

Reviewed By: zertosh

Differential Revision: D27979080

fbshipit-source-id: a80f0c48691c08ae8ca0af06377b87e6a2351151
2021-04-30 21:23:28 -07:00
087049000b Make c10 clang-tidy clean (#55870)
Summary:
This change was autogenerated by running:
```
% find c10 -iname "*.cpp" -exec python3 tools/clang_tidy.py -c build -x {} -s \;
```

Pull Request resolved: https://github.com/pytorch/pytorch/pull/55870

Reviewed By: janeyx99

Differential Revision: D27728617

Pulled By: malfet

fbshipit-source-id: bede4d7f0c106d51394d1e9efddf01bf894421c5
2021-04-14 11:23:28 -07:00
41bab9a4b6 Plumbing dispatch keys through the dispatcher (#49354)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/49354

Test Plan: Imported from OSS

Reviewed By: smessmer

Differential Revision: D25614042

Pulled By: bdhirsh

fbshipit-source-id: 269a75e9a3ac518aa63bff2cafbd47ed2c4ff780
2021-02-08 11:09:51 -08:00
56a157fc79 hacky_wrapper_for_legacy_signatures reorders out arguments (#48911)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/48911

This enables us to use hacky_wrapper_for_legacy_signatures for ops with out arguments so they can use templated unboxing logic without having to be rewritten.

This only actually enables it for one op as a proof of concept. There will be a separate PR enabling it for more ops.
ghstack-source-id: 118379659

Test Plan: waitforsandcastle

Reviewed By: bhosmer

Differential Revision: D25363336

fbshipit-source-id: da075d2cc58814f886a25d52652511dbbe990cec
2020-12-10 23:29:00 -08:00
6b94830cdc faithful signature support in BoxedKernelWrapper (#47267)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/47267

Test Plan: Imported from OSS

Reviewed By: ezyang

Differential Revision: D24701488

Pulled By: bhosmer

fbshipit-source-id: dbce246319670f9590c5762ad20c26cb24575fe8
2020-11-10 13:58:36 -08:00
24199e0768 tuple_map / tuple_concat (#42326)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/42326

ghstack-source-id: 108868289

Test Plan: Unit tests

Reviewed By: smessmer

Differential Revision: D22846504

fbshipit-source-id: fa9539d16e21996bbd80db3e3c524b174b22069e
2020-08-03 19:19:47 -07:00
029007c8b6 Improved coverage for unboxed->boxed kernel wrappers (#38999)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/38999

Adds boxing for inplace and outplace kernels, itemizes
remaining unsupported cases, and fails compilation when
new unsupported types are introduced in op signatures.

Test Plan: Imported from OSS

Differential Revision: D21718547

Pulled By: bhosmer

fbshipit-source-id: 03295128b21d1843e86789fb474f38411b26a8b6
2020-07-29 11:31:16 -07:00
2ef5b947a8 Disable unit test failing on Windows (#35549)
Summary:
Introduce DISABLED_ON_WINDOWS macro, that adds `DISABLED_` prefix to string if compiled for Win32
Pull Request resolved: https://github.com/pytorch/pytorch/pull/35549

Test Plan: CI

Differential Revision: D20700915

Pulled By: malfet

fbshipit-source-id: adddfe2db89b7139093ceef6899862bce0adcf2d
2020-03-27 19:20:29 -07:00
643ca5def2 Replace c10::guts::stuff with std::stuff (#30915)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/30915

Since we now have C++14, we don't need these c10::guts helpers anymore
ghstack-source-id: 95777609

Test Plan: waitforsandcastle

Differential Revision: D18869639

fbshipit-source-id: 97716f932297c64c6e814410ac47b444c33d4e2e
2019-12-16 13:57:19 -08:00
0b96e5d792 Move some files to c10/util (#12245)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12245

Move these files to c10/util:
- C++17.h
- Metaprogramming.h
- TypeList.h
- TypeTraits.h
- Array.h

(including .cpp files and test cases)

Reviewed By: ezyang

Differential Revision: D10139933

fbshipit-source-id: ce7ce89392bf1a6be070ffdfc0407a8a2ce4ba6e
2018-10-15 16:25:12 -07:00