From 4f0fb9236e892fc5474fb506f3c83ed53bec0928 Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Thu, 15 Aug 2019 22:13:33 -0400 Subject: [PATCH] Fix assert for windows. (#1329) MSVC assert.h has no guard for include once. The macro assert overrides device assert definition. Do not include it for device compilation. [ROCm/hip commit: 7aa7a4ce222a4ee401016a885c7d70054f56f60d] --- projects/hip/include/hip/hcc_detail/math_functions.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/projects/hip/include/hip/hcc_detail/math_functions.h b/projects/hip/include/hip/hcc_detail/math_functions.h index c384c5573d..19def9ec7e 100644 --- a/projects/hip/include/hip/hcc_detail/math_functions.h +++ b/projects/hip/include/hip/hcc_detail/math_functions.h @@ -29,7 +29,14 @@ THE SOFTWARE. #include #include + +// assert.h is only for the host version of assert. +// The device version of assert is implemented in hip/hcc_detail/hip_runtime.h. +// Users should include hip_runtime.h for the device version of assert. +#if !__HIP_DEVICE_COMPILE__ #include +#endif + #include #include #include