Skip to content

Commit ca1c081

Browse files
committed
Remove hash friendship
Signed-off-by: Larsen, Steffen <[email protected]>
1 parent 8a7ad74 commit ca1c081

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

sycl/include/sycl/ext/oneapi/bfloat16.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ class bfloat16 {
154154

155155
// Friend traits.
156156
friend std::numeric_limits<bfloat16>;
157-
friend std::hash<bfloat16>;
158157

159158
// Friend classes for vector operations
160159
friend class sycl::vec<bfloat16, 1>;
@@ -633,7 +632,7 @@ namespace std {
633632
// Specialization of `std::hash<sycl::ext::oneapi::bfloat16>`.
634633
template <> struct hash<sycl::ext::oneapi::bfloat16> {
635634
size_t operator()(sycl::ext::oneapi::bfloat16 const &Key) const noexcept {
636-
return hash<uint16_t>{}(Key.value);
635+
return hash<uint16_t>{}(sycl::bit_cast<uint16_t>(Key));
637636
}
638637
};
639638

0 commit comments

Comments
 (0)