diff options
author | Junyan He <junyan.he@linux.intel.com> | 2015-10-22 14:29:59 +0800 |
---|---|---|
committer | Yang Rong <rong.r.yang@intel.com> | 2015-10-27 15:52:50 +0800 |
commit | 2b5895a18786c9ae8395628da8288e73929eee9a (patch) | |
tree | 61643f5f8e7a8ba1ccc0196a6082a5a61704dad5 /utests/compiler_double.cpp | |
parent | 531a6babe6c852bc3ed62849d7640bf2ef4659a0 (diff) | |
download | beignet-2b5895a18786c9ae8395628da8288e73929eee9a.tar.gz |
Utests: Add double check and refine compiler_double case.
Signed-off-by: Junyan He <junyan.he@linux.intel.com>
Reviewed-by: Yang Rong <rong.r.yang@intel.com>
Diffstat (limited to 'utests/compiler_double.cpp')
-rw-r--r-- | utests/compiler_double.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/utests/compiler_double.cpp b/utests/compiler_double.cpp index 7c54ddfe..fc89a0fb 100644 --- a/utests/compiler_double.cpp +++ b/utests/compiler_double.cpp @@ -12,6 +12,9 @@ void compiler_double(void) const size_t n = 16; double cpu_dst[n], cpu_src[n]; + if (!cl_check_double()) + return; + // Setup kernel and buffers OCL_CREATE_KERNEL("compiler_double"); OCL_CREATE_BUFFER(buf[0], 0, n * sizeof(double), NULL); @@ -38,7 +41,7 @@ void compiler_double(void) // Compare OCL_MAP_BUFFER(1); for (int32_t i = 0; i < (int32_t) n; ++i) - OCL_ASSERT(fabs(((double*)buf_data[1])[i] - cpu_dst[i]) < 1e-4); + OCL_ASSERT(fabs(((double*)buf_data[1])[i] - cpu_dst[i]) < 1e-32); OCL_UNMAP_BUFFER(1); } } |