summaryrefslogtreecommitdiff
path: root/utests/utest_helper.hpp
diff options
context:
space:
mode:
authorLuo Xionghu <xionghu.luo@intel.com>2016-04-21 18:50:40 +0800
committerYang Rong <rong.r.yang@intel.com>2016-04-22 18:13:12 +0800
commit830d3c32d00669f7eec5d80a083b3a0a88b39d11 (patch)
tree7e5ae3183877cb3e404ee9cc9ba08305b78726cd /utests/utest_helper.hpp
parent0eebe2536c8e76cd20867d1ca00ba4735736f629 (diff)
downloadbeignet-830d3c32d00669f7eec5d80a083b3a0a88b39d11.tar.gz
fix failed cases for stand alone utest;
1. use clEnqueueMapBuffer/Image instead of clEnqueueReadBuffer/Image; 2. add sanity check for clEnqueueMapImage; v2: disable OpenCL 2.0 specific builtin cases for stand alone utest. v3: don't hide failed cases. fix utest build warnings. Signed-off-by: Luo Xionghu <xionghu.luo@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
Diffstat (limited to 'utests/utest_helper.hpp')
-rw-r--r--utests/utest_helper.hpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/utests/utest_helper.hpp b/utests/utest_helper.hpp
index 70b983b9..8ce77074 100644
--- a/utests/utest_helper.hpp
+++ b/utests/utest_helper.hpp
@@ -129,7 +129,7 @@ extern EGLSurface eglSurface;
size_t size = 0; \
status = clGetMemObjectInfo(buf[ID], CL_MEM_SIZE, sizeof(size), &size, NULL);\
if (status != CL_SUCCESS) OCL_THROW_ERROR(FN, status); \
- RET = FN(__VA_ARGS__, CL_TRUE, CL_MAP_READ, 0, size, 0, NULL, NULL, &status);\
+ RET = FN(__VA_ARGS__, CL_TRUE, CL_MAP_READ|CL_MAP_WRITE, 0, size, 0, NULL, NULL, &status);\
if (status != CL_SUCCESS) OCL_THROW_ERROR(FN, status); \
} while (0)
@@ -162,9 +162,11 @@ extern EGLSurface eglSurface;
size_t image_depth= 0; \
status = clGetImageInfo(buf[ID], CL_IMAGE_DEPTH, sizeof(image_depth), &image_depth, NULL);\
if (status != CL_SUCCESS) OCL_THROW_ERROR(FN, status); \
+ if(image_depth == 0) image_depth = 1; \
+ if(image_height == 0) image_height = 1; \
size_t origin[3] = {0, 0, 0}; \
size_t region[3] = {image_width, image_height, image_depth}; \
- RET = FN(__VA_ARGS__, CL_TRUE, CL_MAP_READ, origin, region, &image_row_pitch, &image_slice_pitch, 0, NULL, NULL, &status);\
+ RET = FN(__VA_ARGS__, CL_TRUE, CL_MAP_READ|CL_MAP_WRITE, origin, region, &image_row_pitch, &image_slice_pitch, 0, NULL, NULL, &status);\
if (status != CL_SUCCESS) OCL_THROW_ERROR(FN, status); \
} while (0)