From ec34ea376bd09d03817d127519304a331d77b6f8 Mon Sep 17 00:00:00 2001 From: Mirza Halilcevic Date: Mon, 5 Feb 2024 20:11:52 +0530 Subject: [PATCH] EXSWHTEC-335 - Introduce float16 support to numerical accuracy test base #409 Change-Id: I2b8ba06b4a078b72469615d2e075d18d58de9652 [ROCm/hip-tests commit: 6b9857cf177a5535c5d233bbd21e19b603aeda2f] --- projects/hip-tests/catch/unit/math/Float16.hh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/projects/hip-tests/catch/unit/math/Float16.hh b/projects/hip-tests/catch/unit/math/Float16.hh index 79d2064cd2..636941d33d 100644 --- a/projects/hip-tests/catch/unit/math/Float16.hh +++ b/projects/hip-tests/catch/unit/math/Float16.hh @@ -33,9 +33,7 @@ class Float16 { __host__ __device__ Float16(__half2 x) : x_{__low2half(x)} {} __host__ __device__ Float16(float x) : x_{__float2half(x)} {} - __host__ __device__ bool operator==(Float16 other) const { - return static_cast<__half_raw>(x_).data == static_cast<__half_raw>(other.x_).data; - } + __host__ __device__ bool operator==(Float16 other) const { return __heq(x_, other.x_); } __host__ __device__ bool operator!=(Float16 other) const { return !(*this == other); } __host__ __device__ operator __half() const { return x_; }