Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sycl/source/half_type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ static uint16_t float2Half(const float &Val) {
uint16_t Ret = 0;
Ret |= Sign;
Ret |= Exp16 << 10;
Ret |= Frac16;
Ret += Frac16;// Add the carry bit from operation Frac16 += 1;

return Ret;
}
Expand Down
2 changes: 2 additions & 0 deletions sycl/test/basic_tests/half_type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,8 @@ int main() {
assert(bitwise_comparison_fp16(0.0, 0));
// -0
assert(bitwise_comparison_fp16(-0.0, 32768));
// 1.9999f
assert(bitwise_comparison_fp16(1.9999f, 0x4000));
// nan
assert(bitwise_comparison_fp16(0.0 / 0.0, 32256));
assert(bitwise_comparison_fp16(-0.0 / 0.0, 32256));
Expand Down