Fixing M_PI compile error on MSVC.
M_PI and other math constants (used in chlo_legalize_hlo_patterns.td) are not part of the C++ standard and must be enabled on MSVC (similar to _GNU_SOURCE adding glibc symbols to posix headers). PiperOrigin-RevId: 342432987
This commit is contained in:
parent
d0901a83e5
commit
88a5bde51f
|
@ -13,6 +13,12 @@ See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
==============================================================================*/
|
==============================================================================*/
|
||||||
|
|
||||||
|
// Enable the use of M_* math constants.
|
||||||
|
// NOTE: this must be first in the file to ensure that if cmath is transitively
|
||||||
|
// included by any other header it has the define set on first processing.
|
||||||
|
// https://docs.microsoft.com/en-us/cpp/c-runtime-library/math-constants
|
||||||
|
#define _USE_MATH_DEFINES
|
||||||
|
#include <cmath>
|
||||||
#include <numeric>
|
#include <numeric>
|
||||||
|
|
||||||
#include "mlir-hlo/Dialect/mhlo/IR/chlo_ops.h"
|
#include "mlir-hlo/Dialect/mhlo/IR/chlo_ops.h"
|
||||||
|
|
Loading…
Reference in New Issue