Commit 34c636d9 by Philip Hyunsu Cho Committed by Tianqi Chen

Fix compilaton of bfloat16 on Windows (#4415)

parent 2f1685fe
...@@ -60,19 +60,23 @@ void BFloat16Add(const uint16_t* a, const uint16_t* b, uint16_t* dst, ...@@ -60,19 +60,23 @@ void BFloat16Add(const uint16_t* a, const uint16_t* b, uint16_t* dst,
} }
extern "C" { 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; uint16_t out;
FloatToBFloat16(&in, &out, 1); FloatToBFloat16(&in, &out, 1);
return out; return out;
} }
TVM_DLL float BFloat16ToFloat_wrapper(uint16_t in) { float BFloat16ToFloat_wrapper(uint16_t in) {
float out; float out;
BFloat16ToFloat(&in, &out, 1); BFloat16ToFloat(&in, &out, 1);
return out; 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; uint16_t out;
BFloat16Add(&a, &b, &out, 1); BFloat16Add(&a, &b, &out, 1);
return out; return out;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment