From 7e3274671b2319bb196375d57b849017243d7fcd Mon Sep 17 00:00:00 2001 From: John Shumway Date: Fri, 2 Jan 2026 11:36:42 -0800 Subject: [PATCH] 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 [ROCm/composable_kernel commit: 1da340031c98bfde0f142bf34493d087490ec70d] --- include/ck/library/utility/device_tensor_generator.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/include/ck/library/utility/device_tensor_generator.hpp b/include/ck/library/utility/device_tensor_generator.hpp index 4da38bf399..ede6d131e7 100644 --- a/include/ck/library/utility/device_tensor_generator.hpp +++ b/include/ck/library/utility/device_tensor_generator.hpp @@ -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 // use xorshift for now since it is simple. Should be suitable enough, but feel free to switch in