Skip to content

Commit bf40594

Browse files
committed
[SYCL] Fix bfloat16::to_float() host implementation.
Signed-off-by: Konstantin S Bobrovsky <[email protected]>
1 parent 1cb5cb0 commit bf40594

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

sycl/include/sycl/ext/oneapi/experimental/bfloat16.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,9 @@ class bfloat16 {
6363
return __spirv_ConvertBF16ToFINTEL(a);
6464
#endif
6565
#else
66-
// Shift temporary variable to silence the warning
6766
uint32_t bits = a;
6867
bits <<= 16;
69-
return static_cast<float>(bits);
68+
return *(reinterpret_cast<float *>(&bits));
7069
#endif
7170
}
7271

0 commit comments

Comments
 (0)