From bc1f8180ee6df7b8559b73ee37c2fde404662745 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/hip commit: 36ecdf9c3a356ed3835037e8263deb966720260f] --- projects/hip/rocclr/hip_platform.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/projects/hip/rocclr/hip_platform.cpp b/projects/hip/rocclr/hip_platform.cpp index 6e6f08bf44..cc206e6cb7 100755 --- a/projects/hip/rocclr/hip_platform.cpp +++ b/projects/hip/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); }