File tree Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -1728,7 +1728,31 @@ signed otherwise.
17281728Various maths functions are defined operate on any floating point types.
17291729`syclcompat::is_floating_point_v` extends the standard library' s
17301730`std::is_floating_point_v` to include `sycl::half` and, where available,
1731- `sycl::ext::oneapi::bfloat16`.
1731+ `sycl::ext::oneapi::bfloat16`. The current version of SYCLcompat also provides
1732+ a specialization of `std::common_type_t` for `sycl::ext::oneapi::bfloat16`,
1733+ though this will be moved to the `sycl_ext_oneapi_bfloat16` extension in
1734+ future.
1735+
1736+ ```cpp
1737+ namespace std {
1738+ template <> struct common_type<sycl::ext::oneapi::bfloat16> {
1739+ using type = sycl::ext::oneapi::bfloat16;
1740+ };
1741+
1742+ template <>
1743+ struct common_type<sycl::ext::oneapi::bfloat16, sycl::ext::oneapi::bfloat16> {
1744+ using type = sycl::ext::oneapi::bfloat16;
1745+ };
1746+
1747+ template <typename T> struct common_type<sycl::ext::oneapi::bfloat16, T> {
1748+ using type = sycl::ext::oneapi::bfloat16;
1749+ };
1750+
1751+ template <typename T> struct common_type<T, sycl::ext::oneapi::bfloat16> {
1752+ using type = sycl::ext::oneapi::bfloat16;
1753+ };
1754+ } // namespace std
1755+ ```
17321756
17331757```cpp
17341758namespace syclcompat{
You can’t perform that action at this time.
0 commit comments