mirror of
https://github.com/saymrwulf/pytorch.git
synced 2026-05-14 20:57:59 +00:00
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
12 lines
274 B
C++
12 lines
274 B
C++
// define constants like M_PI and C keywords for MSVC
|
|
#ifdef _MSC_VER
|
|
#ifndef _USE_MATH_DEFINES
|
|
#define _USE_MATH_DEFINES
|
|
#endif
|
|
#endif
|
|
|
|
#include <c10/util/MathConstants.h>
|
|
|
|
#include <math.h>
|
|
|
|
static_assert(M_PI == c10::pi<double>, "c10::pi<double> must be equal to M_PI");
|