From ee8937a8a0f19028224e746e1f747a63e3296aa7 Mon Sep 17 00:00:00 2001 From: Rostyslav Geyyer Date: Wed, 12 Feb 2025 16:03:27 +0000 Subject: [PATCH] Fix conversion logic --- include/ck/utility/type_convert.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/ck/utility/type_convert.hpp b/include/ck/utility/type_convert.hpp index e9b2e3fff2..f14ff4b924 100644 --- a/include/ck/utility/type_convert.hpp +++ b/include/ck/utility/type_convert.hpp @@ -742,8 +742,8 @@ inline __host__ __device__ f4x2_t f4_convert_rne(float2_t x, float scale = 1.0f) uint32_t bitwise; f4x2_t f4x2_array[4]; } value{0}; - uint8_t l = utils::sat_convert_to_type(x[1] / scale); - uint8_t h = utils::sat_convert_to_type(x[0] / scale); + uint8_t l = utils::sat_convert_to_type(x[0] / scale); + uint8_t h = utils::sat_convert_to_type(x[1] / scale); value.bitwise = (h << 4) | l; return value.f4x2_array[0]; #endif @@ -969,8 +969,8 @@ inline __host__ __device__ f4x2_t f4_convert_sr(float2_t x, float scale = 1.0f) uint32_t bitwise; f4x2_t f4x2_array[4]; } value{0}; - uint8_t l = utils::sat_convert_to_type_sr(x[1] / scale, rng); - uint8_t h = utils::sat_convert_to_type_sr(x[0] / scale, rng); + uint8_t l = utils::sat_convert_to_type_sr(x[0] / scale, rng); + uint8_t h = utils::sat_convert_to_type_sr(x[1] / scale, rng); value.bitwise = (h << 4) | l; return value.f4x2_array[0]; #endif