[Beignet] [PATCH] fix utest fail.

xionghu.luo at intel.com xionghu.luo at intel.com
Mon Aug 10 01:02:31 PDT 2015


From: Luo Xionghu <xionghu.luo at intel.com>

should use M_180_PI_F to improve the precision.
Signed-off-by: Luo Xionghu <xionghu.luo at intel.com>
---
 utests/compiler_degrees.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/utests/compiler_degrees.cpp b/utests/compiler_degrees.cpp
index 7a17ca7..2079267 100644
--- a/utests/compiler_degrees.cpp
+++ b/utests/compiler_degrees.cpp
@@ -1,5 +1,7 @@
 #include "utest_helper.hpp"
 
+#define M_180_PI_F   57.295779513082321F
+
 void compiler_degrees(void)
 {
   const int n = 32;
@@ -24,7 +26,7 @@ void compiler_degrees(void)
 
   OCL_MAP_BUFFER(1);
   for (int i = 0; i < n; ++i) {
-    OCL_ASSERT(((float *)buf_data[1])[i] == src[i] * (180 / 3.141592653589793F));
+    OCL_ASSERT(((float *)buf_data[1])[i] == src[i] * M_180_PI_F);
   }
   OCL_UNMAP_BUFFER(1);
 }
-- 
1.9.1



More information about the Beignet mailing list