Commit Graph

5 Commits

Author SHA1 Message Date
Peter Bell
8acf0e62d0 Use c10 math constants consistently in Math.h (#91967)
On MSVC the `M_` constants are hidden behind the `USE_MATH_DEFINES` macro, so
it's better to avoid them in headers otherwise the include order can break
compilation.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/91967
Approved by: https://github.com/malfet
2023-01-12 11:53:52 +00:00
Allen Goodman
b40c751c33 c10 mathematical constants (#78910)
Adds useful c10 mathematical constants
Pull Request resolved: https://github.com/pytorch/pytorch/pull/78910
Approved by: https://github.com/ezyang
2022-06-06 22:21:05 +00:00
Nolan O'Brien
a383d01774 [fbcode][warnings] Suppress warnings in caffe2/c10 (#71356)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/71356

Suppress remaining header based warnings in `caffe2/c10` when building with `clang`

Test Plan: CI pass

Reviewed By: r-barnes

Differential Revision: D33600097

fbshipit-source-id: e1c0d84a0bad768eb03e047d62b5379cf28b48e2
2022-01-15 18:34:08 -08:00
Scott Wolchok
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
Nikita Shulga
de8cd6b201 [BE] Replace M_PI with c10::pi constexpr variable (#50819)
Summary:
Also, get rid of MSVC specific `_USE_MATH_DEFINES`

Test at compile time that c10::pi<double> == M_PI

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

Reviewed By: albanD

Differential Revision: D25976330

Pulled By: malfet

fbshipit-source-id: 8f3ddfd58a5aa4bd382da64ad6ecc679706d1284
2021-01-22 15:15:31 -08:00