diff --git a/include/ck/utility/mxf4_utils.hpp b/include/ck/utility/mxf4_utils.hpp index 15e693bd0d..f6536377ba 100644 --- a/include/ck/utility/mxf4_utils.hpp +++ b/include/ck/utility/mxf4_utils.hpp @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -// Copyright (c) 2024, Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2024-2025, Advanced Micro Devices, Inc. All rights reserved. #pragma once @@ -13,7 +13,7 @@ __host__ __device__ inline bool is_nan(e8m0_bexp_t const scale, f4_t const dataBytes [[maybe_unused]]) { // no need to check for data as it does not have NaN representation - return scale == NumericLimits::QuietNaN(); + return scale.is_nan(); } // no infinity representation in ocp_e2m1_mxfp4 will always return false @@ -26,11 +26,9 @@ __host__ __device__ inline bool is_inf(e8m0_bexp_t const scale [[maybe_unu } template <> -__host__ __device__ inline bool is_zero(e8m0_bexp_t const scale, f4_t const data) +__host__ __device__ inline bool is_zero(e8m0_bexp_t const scale [[maybe_unused]], + f4_t const data) { - if(is_nan(scale, data)) - return false; - // no need to check for scale as it does not have a 0 representation f4_t result = (data & 0b00001111) & NumericUtils::set_sign_mask; @@ -41,7 +39,9 @@ template <> __host__ __device__ inline float to_float(e8m0_bexp_t const scale, f4_t const data) { if(is_nan(scale, data)) + { return std::numeric_limits::quiet_NaN(); + } if(is_zero(scale, data)) return 0.0f;