         return a;
     else if (half_isnan(b.value))
         return b;
-    else if ((half_greater_than(b.value, a.value)) ||
+    else if ((half_less(b.value, a.value)) ||
              (half_equal(a.value, b.value) && (b.key < a.key)))
         return b;
     else

#endif
}

__host__ __device__ __forceinline__ bool half_greater_than(const __half& l, const __half& r) {
#ifdef __CUDA_ARCH__
    return l < r;
#else

        return a;
    else if (half_isnan(b.value))
        return b;
    else if ((half_less(a.value, b.value)) ||
             (half_equal(a.value, b.value) && (b.key < a.key)))
        return b;
    else
