[Beignet] [PATCH] Refine calculation for ULP.
Yi Sun
yi.sun at intel.com
Mon Jan 6 00:51:52 PST 2014
Signed-off-by: Yi Sun <yi.sun at intel.com>
---
utests/utest_helper.cpp | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/utests/utest_helper.cpp b/utests/utest_helper.cpp
index a738599..91633f0 100644
--- a/utests/utest_helper.cpp
+++ b/utests/utest_helper.cpp
@@ -664,14 +664,15 @@ typedef union
const float cl_FLT_ULP(float float_number)
{
- SF floatBin, ulpBin;
+ SF floatBin, ulpBin, ulpBinBase;
floatBin.f = float_number;
- ulpBin.spliter.sign = floatBin.spliter.sign;
- ulpBin.spliter.exponent = floatBin.spliter.exponent;
+ ulpBin.spliter.sign = ulpBinBase.spliter.sign = 0;
+ ulpBin.spliter.exponent = ulpBinBase.spliter.exponent = floatBin.spliter.exponent;
ulpBin.spliter.mantissa = 0x1;
+ ulpBinBase.spliter.mantissa = 0x0;
- return ulpBin.f;
+ return ulpBin.f - ulpBinBase.f;
}
const int cl_INT_ULP(int int_number)
--
1.7.6.4
More information about the Beignet
mailing list