Skip to content

Commit

Permalink
Merge pull request #747 from gmlueck/gmlueck/bfloat16-test-plan
Browse files Browse the repository at this point in the history
Avoid some bit_cast in bfloat16 test plan
  • Loading branch information
bader committed Jul 10, 2023
2 parents f753b5f + f0f05e5 commit 42ed384
Showing 1 changed file with 2 additions and 8 deletions.
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

0 comments on commit 42ed384

Please sign in to comment.