-
Notifications
You must be signed in to change notification settings - Fork 789
[SYCL] Fix bfloat16::to_float() host implementation. #6675
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Konstantin S Bobrovsky <[email protected]>
@v-klochkov, FYI |
@cperkinsintel, @intel/llvm-reviewers-runtime - please take a look at this small PR |
Success &= check_bf16_to_float( | ||
0, bitsToFloatConv(std::string("00000000000000000000000000000000"))); | ||
Success &= check_bf16_to_float( | ||
1, bitsToFloatConv(std::string("01000111100000000000000000000000"))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, that was a huge mistake, sorry about that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bugs happen, no problem )
union { | ||
uint32_t bits; | ||
float res; | ||
} val; | ||
val.bits = a; | ||
val.bits <<= 16; | ||
return val.res; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We seem to have sycl::bit_cast
, can we use it here? If not, then a comment is necessary to explain why.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point, will fix
@aelovikov-intel, @cperkinsintel - please review |
@aelovikov-intel, @cperkinsintel, ping |
New E2E test: intel/llvm-test-suite#1189
Signed-off-by: Konstantin S Bobrovsky [email protected]