Skip to content
Closed
Changes from 4 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
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,14 @@ public:
bfloat16(const float &a);
bfloat16 &operator=(const float &a);

// Convert from bfloat16 to float
// Convert bfloat16 to floating-point types
operator float() const;
operator sycl::half() const;

// Get bfloat16 as uint16.
operator storage_t() const;

// Convert to bool type
// Convert bfloat16 to bool type
explicit operator bool();

friend bfloat16 operator-(bfloat16 &bf) { /* ... */ }
Expand Down Expand Up @@ -195,11 +196,11 @@ Table 1. Member functions of `bfloat16` class.
| `operator float() const;`
| Return `bfloat16` value converted to `float`.

| `operator storage_t() const;`
| Return `uint16_t` value, whose bits represent `bfloat16` value.
| `operator sycl::half() const;`
| Return `bfloat16` value converted to `sycl::half`.

| `explicit operator bool() { /* ... */ }`
| Convert `bfloat16` to `bool` type. Return `false` if the value equals to
| Convert `bfloat16` to `bool` type. Return `false` if the `value` equals to
zero, return `true` otherwise.

| `friend bfloat16 operator-(bfloat16 &bf) { /* ... */ }`
Expand Down Expand Up @@ -333,4 +334,5 @@ None.
Apply code review suggestions
|3|2021-08-18|Alexey Sotkin |Remove `uint16_t` constructor
|4|2022-03-07|Aidan Belton and Jack Kirk |Switch from Intel vendor specific to oneapi
|5|2022-05-02|Alexey Sotkin |Add `operator sycl::half()`
|========================================