diff options
author | Luo Xionghu <xionghu.luo@intel.com> | 2015-08-10 16:02:31 +0800 |
---|---|---|
committer | Yang Rong <rong.r.yang@intel.com> | 2015-08-11 10:36:37 +0800 |
commit | 8864700bb995b980e4d6acd4d301b8d228e85bcc (patch) | |
tree | 0c02f33cbb4cf9c9dff46fbaf06ba1457d32d8f7 /utests/compiler_degrees.cpp | |
parent | fc693bc2e1fa9a48d126a612544b14af63211562 (diff) | |
download | beignet-8864700bb995b980e4d6acd4d301b8d228e85bcc.tar.gz |
fix utest fail.
should use M_180_PI_F to improve the precision.
Signed-off-by: Luo Xionghu <xionghu.luo@intel.com>
Reviewed-by: "Yang, Rong R" <rong.r.yang@intel.com>
Diffstat (limited to 'utests/compiler_degrees.cpp')
-rw-r--r-- | utests/compiler_degrees.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/utests/compiler_degrees.cpp b/utests/compiler_degrees.cpp index 7a17ca78..20792672 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); } |