From fbafc49449a3096ae2080e1b39104358a2de1852 Mon Sep 17 00:00:00 2001 From: Philip Cho Date: Sun, 24 Nov 2019 11:44:47 -0800 Subject: [PATCH] Fix compilaton of bfloat16 on Windows --- 3rdparty/bfloat16/bfloat16.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/3rdparty/bfloat16/bfloat16.cc b/3rdparty/bfloat16/bfloat16.cc index 1f25be17f72d..56d05efb03a5 100644 --- a/3rdparty/bfloat16/bfloat16.cc +++ b/3rdparty/bfloat16/bfloat16.cc @@ -60,19 +60,23 @@ void BFloat16Add(const uint16_t* a, const uint16_t* b, uint16_t* dst, } extern "C" { -TVM_DLL TVM_DLL uint16_t FloatToBFloat16_wrapper(float in) { +TVM_DLL uint16_t FloatToBFloat16_wrapper(float in); +TVM_DLL float BFloat16ToFloat_wrapper(uint16_t in); +TVM_DLL uint16_t BFloat16Add_wrapper(uint16_t a, uint16_t b); + +uint16_t FloatToBFloat16_wrapper(float in) { uint16_t out; FloatToBFloat16(&in, &out, 1); return out; } -TVM_DLL float BFloat16ToFloat_wrapper(uint16_t in) { +float BFloat16ToFloat_wrapper(uint16_t in) { float out; BFloat16ToFloat(&in, &out, 1); return out; } -TVM_DLL uint16_t BFloat16Add_wrapper(uint16_t a, uint16_t b) { +uint16_t BFloat16Add_wrapper(uint16_t a, uint16_t b) { uint16_t out; BFloat16Add(&a, &b, &out, 1); return out;