From ca96ee8a47ff9ebb1d112cb34d71011e51574a1a Mon Sep 17 00:00:00 2001 From: Tao Sang Date: Thu, 20 Feb 2020 12:08:22 -0500 Subject: [PATCH] Make __gnu_h2f_ieee and __gnu_f2h_ieee visible Make __gnu_h2f_ieee and __gnu_f2h_ieee visible so that hipTestHalf test can succeed in Clang compiler + Hcc RT. Change-Id: I5f7d5db19e559b3b66356f0170a8dbc1e5505f3e [ROCm/hip commit: ceb942375d8b77c367e3792e848b3f143ec8b6be] --- projects/hip/src/h2f.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/projects/hip/src/h2f.cpp b/projects/hip/src/h2f.cpp index a8c60e7c48..84d067166f 100644 --- a/projects/hip/src/h2f.cpp +++ b/projects/hip/src/h2f.cpp @@ -57,12 +57,14 @@ static inline std::uint32_t __convert_float_to_half(float a) noexcept { // On machines without fp16 instructions, clang lowers llvm.convert.from.fp16 // to call of this function. -extern "C" float __gnu_h2f_ieee(unsigned short h){ +extern "C" __attribute__((visibility("default"))) +float __gnu_h2f_ieee(unsigned short h){ return __convert_half_to_float((std::uint32_t) h); } // On machines without fp16 instructions, clang lowers llvm.convert.to.fp16 // to call of this function. -extern "C" unsigned short __gnu_f2h_ieee(float f){ +extern "C" __attribute__((visibility("default"))) +unsigned short __gnu_f2h_ieee(float f){ return (unsigned short)__convert_float_to_half(f); }