Enable math defines for MSVC. (#3503)

The symbol M_PI is breaking the build on Windows.  The _USE_MATH_DEFINES macro enables M_PI and other math constants on Windows. (I'm guessing this is more idomatic than the old trick of using PI=acos(-1.0).)

https://learn.microsoft.com/en-us/cpp/c-runtime-library/math-constants?view=msvc-170

Co-authored-by: BradPepersAMD <Brad.Pepers@amd.com>
This commit is contained in:
John Shumway
2026-01-02 11:36:42 -08:00
committed by GitHub
parent cc1392a405
commit 1da340031c

View File

@@ -7,6 +7,7 @@
#include "ck/utility/common_header.hpp"
#include "ck/library/utility/device_tensor_generator.hpp"
#include "ck/utility/data_type.hpp"
#define _USE_MATH_DEFINES // Required for M_PI in MSVC
#include <cmath>
// use xorshift for now since it is simple. Should be suitable enough, but feel free to switch in