summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhigang Gong <zhigang.gong@intel.com>2014-12-24 08:54:59 +0800
committerZhigang Gong <zhigang.gong@intel.com>2015-01-09 14:22:19 +0800
commit04805dd9f733c2f8c4ee50f1c404e91765c4b5ef (patch)
tree8dbc4f92446c56331ab9acabc0cb26d066e198e4
parent73a3c155d7e80915633d64d709e4fcda4c27d6dc (diff)
utests: reduce test count.
No need to iterate so many times. Signed-off-by: Zhigang Gong <zhigang.gong@intel.com> Tested-by: "Meng, Mengmeng" <mengmeng.meng@intel.com>
-rw-r--r--utests/sub_buffer.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/utests/sub_buffer.cpp b/utests/sub_buffer.cpp
index d32fd653..62280344 100644
--- a/utests/sub_buffer.cpp
+++ b/utests/sub_buffer.cpp
@@ -15,6 +15,7 @@ void sub_buffer_check(void)
error = clGetDeviceInfo(device, CL_DEVICE_MEM_BASE_ADDR_ALIGN, sizeof(address_align ), &address_align, NULL );
OCL_ASSERT(error == CL_SUCCESS);
+ max_alloc_size /= 8;
main_buf_content = (char *)malloc(sizeof(char) * max_alloc_size);
for (cl_ulong i = 0; i < max_alloc_size; i++) {
@@ -25,8 +26,8 @@ void sub_buffer_check(void)
OCL_ASSERT(error == CL_SUCCESS);
/* Test read sub buffer. */
- for (cl_ulong sz = 64; sz < max_alloc_size; sz*=4) {
- for (cl_ulong off = 0; off < max_alloc_size; off += 1234) {
+ for (cl_ulong sz = max_alloc_size / 4; sz <= max_alloc_size; sz += max_alloc_size / 4) {
+ for (cl_ulong off = 0; off < max_alloc_size; off += 1234 + max_alloc_size / 3) {
cl_buffer_region region;
region.origin = off;
region.size = sz;
@@ -71,8 +72,8 @@ void sub_buffer_check(void)
}
- for (cl_ulong sz = 64; sz < max_alloc_size; sz*=4) {
- for (cl_ulong off = 0; off < max_alloc_size; off += 1234) {
+ for (cl_ulong sz = max_alloc_size / 4; sz <= max_alloc_size; sz += max_alloc_size / 4) {
+ for (cl_ulong off = 0; off < max_alloc_size; off += 1234 + max_alloc_size / 3) {
cl_buffer_region region;
region.origin = off;
region.size = sz;