From 9734ad0e68d03e336e9ef661e432eecf395d8d3d Mon Sep 17 00:00:00 2001 From: Vladislav Sytchenko Date: Tue, 15 Sep 2020 09:36:53 -0400 Subject: [PATCH] Fix Windows build Change-Id: I8769bafba199b9258c610e51b58e454fe10a75e6 [ROCm/clr commit: 1602db41147464670914eee01dd1ad959d3b962b] --- projects/clr/hipamd/rocclr/hip_platform.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/projects/clr/hipamd/rocclr/hip_platform.cpp b/projects/clr/hipamd/rocclr/hip_platform.cpp index 6e6f08bf44..cc206e6cb7 100755 --- a/projects/clr/hipamd/rocclr/hip_platform.cpp +++ b/projects/clr/hipamd/rocclr/hip_platform.cpp @@ -686,11 +686,19 @@ static inline std::uint32_t __convert_float_to_half(float a) noexcept { return s | v; } -extern "C" __attribute__((weak)) float __gnu_h2f_ieee(unsigned short h){ +extern "C" +#if !defined(_MSC_VER) +__attribute__((weak)) +#endif +float __gnu_h2f_ieee(unsigned short h){ return __convert_half_to_float((std::uint32_t) h); } -extern "C" __attribute__((weak)) unsigned short __gnu_f2h_ieee(float f){ +extern "C" +#if !defined(_MSC_VER) +__attribute__((weak)) +#endif +unsigned short __gnu_f2h_ieee(float f){ return (unsigned short)__convert_float_to_half(f); }