7 Commits

Author SHA1 Message Date
cyy
13fadea888 [Clang-tidy header][21/N] Fix clang-tidy warnings in aten/src/ATEN/*.{cpp,h} (#120763)
This PR continues to fix clang-tidy warnings in aten/src/ATEN/*, following #120574.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/120763
Approved by: https://github.com/Skylion007
2024-03-03 23:18:43 +00:00
cyy
7663ffb673 [10/N] Fixes clang-tidy warnings in c10/util/*.h (#116326)
Still a continued work for clean up c10/util/*.h
Pull Request resolved: https://github.com/pytorch/pytorch/pull/116326
Approved by: https://github.com/Skylion007
2023-12-23 04:59:55 +00:00
64b8d20a5c Fix typos under c10 directory (#98079)
This PR fixes typos in comments and messages of files under `c10` directory

Pull Request resolved: https://github.com/pytorch/pytorch/pull/98079
Approved by: https://github.com/Skylion007
2023-03-31 18:31:11 +00:00
cyy
e4d81a9ec9 fix various pointer issues (#90651)
Fix some issues found by static analyser

Pull Request resolved: https://github.com/pytorch/pytorch/pull/90651
Approved by: https://github.com/Skylion007
2023-01-21 06:26:41 +00:00
301d9c0556 Remove deprecated usage of is_pod/is_pod_v (#88918)
… as equivalent replacements for std::is_pod and std::is_pod_v because they are deprecated in C++20.

When consuming libtorch header files in a project that uses C++20, there are warnings about std::is_pod being deprecated.  This patch fixes that issue.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/88918
Approved by: https://github.com/ezyang
2022-12-05 16:50:00 +00:00
2a78f6376c TensorIterator: Reduce serial_for_each static overhead (#58909)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/58909

Test Plan: Imported from OSS

Reviewed By: mruberry

Differential Revision: D28776507

Pulled By: ngimel

fbshipit-source-id: 4f0283d03b26aa5785b687b78d77e6b0efcbaf65
2021-05-30 21:08:54 -07:00
f993ceffb5 TensorIteratorReduce: Avoid tensor operations in parallel_for (#58655)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/58655

Ref gh-56794

The two pass reduction calls `copy_` and `select` inside a parallel region. The
`copy_` can just be moved outside of the parallel region, but avoiding the
`select` call is more complicated because it's needed to construct the
`TensorIterator`. Instead, I factor out a `serial_for_each` free-function that
just takes pointers and strides. Then manually advance the pointer to the
thread-specific slice of data.

Test Plan: Imported from OSS

Reviewed By: mruberry

Differential Revision: D28735330

Pulled By: ngimel

fbshipit-source-id: 8e096eb5801af9381ebd305e3ae7796a79b86298
2021-05-27 15:58:03 -07:00