Skip to content
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

Avoid some bit_cast in bfloat16 test plan #747

Merged
merged 1 commit into from
Jul 10, 2023
Merged
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
10 changes: 2 additions & 8 deletions test_plans/bfloat16.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -78,25 +78,19 @@ Use `uint*_t` variables representing `bfloat16` and `float` values in bitset for
[source, c++]
----
uint16_t bfloat16_bits = 0b0000000010000000;
uint32_t float_bits = 0b00000000100000000000000000000000;

bfloat16 bf_min = sycl::bit_cast<bfloat16>(bfloat16_bits);
float float_min = sycl::bit_cast<float>(float_bits);
----

Verify that the minimum values of `bfloat16` type is equal to the minimum value of `float` by using the `bfloat16` operator `==`.
Verify that `bf_min == std::numeric_limits<float>::min()`.

==== Zero

[source, c++]
----
uint16_t bfloat16_bits = 0b0000000000000000;
uint32_t float_bits = 0b00000000000000000000000000000000;

bfloat16 bf_zero = sycl::bit_cast<bfloat16>(bfloat16_bits);
float float_zero = sycl::bit_cast<float>(float_bits);
----
Verify that `bf_zero == float_zero`.
Verify that `bf_zero == 0.f`.

==== NaN

Expand Down