| 1103 | }; |
| 1104 | |
| 1105 | AF_CONSTEXPR __DH__ static inline bool operator==( |
| 1106 | arrayfire::common::half lhs, arrayfire::common::half rhs) noexcept { |
| 1107 | #if __CUDA_ARCH__ >= 530 |
| 1108 | return __heq(lhs.data_, rhs.data_); |
| 1109 | #elif defined(__CUDA_ARCH__) |
| 1110 | return __half2float(lhs.data_) == __half2float(rhs.data_); |
| 1111 | #elif defined(AF_ONEAPI) |
| 1112 | return lhs.data_ == rhs.data_; |
| 1113 | #else |
| 1114 | return (lhs.data_ == rhs.data_ || !((lhs.data_ | rhs.data_) & 0x7FFF)) && |
| 1115 | !isnan(lhs); |
| 1116 | #endif |
| 1117 | } |
| 1118 | |
| 1119 | AF_CONSTEXPR __DH__ static inline bool operator!=( |
| 1120 | arrayfire::common::half lhs, arrayfire::common::half rhs) noexcept { |